Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to loop mount a partition in a full disk image
- ---------------------------------------------------------------------------------------------------------
- How to loop mount a partition in a full disk image
- ---
- Get the partition layout of the image
- sudo fdisk -lu /home/jc/Desktop/MMC/ampd_max2/work/ampd2Full.img
- ---
- Disk /home/jc/Desktop/MMC/ampd_max2/work/ampd2Full.img: 8120 MB, 8120172544 bytes
- 255 heads, 63 sectors/track, 987 cylinders, total 15859712 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: 0x00000000
- Device Boot Start End Blocks Id System
- /home/jc/Desktop/MMC/ampd_max2/work/ampd2Full.img 1 * 193406 15859711 7833153 1 FAT12
- /home/jc/Desktop/MMC/ampd_max2/work/ampd2Full.img 2 4 126207 63102 53 OnTrack DM6 Aux3
- /home/jc/Desktop/MMC/ampd_max2/work/ampd2Full.img 3 189310 191357 1024 1 FAT12
- /home/jc/Desktop/MMC/ampd_max2/work/ampd2Full.img 4 191358 193405 1024 1 FAT12
- Partition table entries are not in disk order
- ---
- Calculate the offset from the start of the image to the partition start
- Sector size * Start = Offset
- 512 * 193406 = 99023872
- ---
- Mount it on /dev/loop0 using the offset
- sudo losetup -o 99023872 /dev/loop7 /home/jc/Desktop/MMC/ampd_max2/work/ampd2Full.img
- OR
- mount -o loop,offset=$((512 * 99023872)) /home/jc/Desktop/MMC/ampd_max2/work/ampd2Full.img /mnt/ampd2_1
- ---
- Now the partition resides on /dev/loop0. You can fsck it, mount it etc
- sudo fsck -fv /dev/loop7
- fsck.msdos
- sudo mount /dev/loop7 /mnt/ampd2_1
- ---
- Unmount
- sudo umount /mnt
- sudo losetup -d /dev/loop0
- ---------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement