ダウンロードしてきたファイルシステムの dd イメージ (→ Raspbian とか) を、メディアに焼かずに Linux 上でループバックマウントして中身だけ見たい場合には以下のようにする。
- まず fdisk を使って dd イメージファイルの構成を把握する (特に Sector size と Start の数値)
- mount コマンドを、 -o で loop と offset=<開始位置> を付けて実行する。開始位置は上で調べた Sector size * Start を使って計算する。
$ fdisk -u -l 2016-02-26-raspbian-jessie.img Disk 2016-02-26-raspbian-jessie.img: 4029 MB, 4029677568 bytes 255 heads, 63 sectors/track, 489 cylinders, total 7870464 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0cf63fa8 Device Boot Start End Blocks Id System 2016-02-26-raspbian-jessie.img1 8192 131071 61440 c W95 FAT32 (LBA) 2016-02-26-raspbian-jessie.img2 131072 7870463 3869696 83 Linux $ mkdir -p mnt/p1 mnt/p2 $ sudo mount -t vfat -o loop,offset="`expr 8192 * 512`" 2016-02-26-raspbian-jessie.img mnt/p1 $ sudo mount -t ext4 -o loop,offset="`expr 131072 * 512`" 2016-02-26-raspbian-jessie.img mnt/p2