This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
parted [2022/03/17 13:17] norman |
parted [2023/12/15 15:01] (current) norman |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Mount single partition from image of entire disk (device) ====== | ||
+ | |||
+ | Get the partition layout of the image | ||
+ | |||
+ | <code>fdisk -lu sda.img</code> | ||
+ | |||
+ | |||
+ | <code>... | ||
+ | Units = sectors of 1 * 512 = 512 bytes | ||
+ | Sector size (logical/physical): 512 bytes / 512 bytes | ||
+ | ... | ||
+ | Device Boot Start End Blocks Id System | ||
+ | sda.img1 * 56 6400000 3199972+ c W95 FAT32 (LBA)</code> | ||
+ | |||
+ | |||
+ | Calculate the offset from the start of the image to the partition start | ||
+ | |||
+ | Sector size * Start = (in the case) 512 * 56 = 28672 | ||
+ | |||
+ | Mount it on /dev/loop0 using the offset | ||
+ | |||
+ | <code>losetup -o 28672 /dev/loop0 sda.img</code> | ||
+ | |||
+ | Now the partition resides on /dev/loop0. You can fsck it, mount it etc | ||
+ | |||
+ | <code>fsck -fv /dev/loop0 | ||
+ | mount /dev/loop0 /mnt</code> | ||
+ | |||
+ | |||
+ | Unmount | ||
+ | |||
+ | <code>umount /mnt | ||
+ | losetup -d /dev/loop0</code> | ||
+ | |||
+ | |||
+ | Source: [[https://askubuntu.com/questions/69363/mount-single-partition-from-image-of-entire-disk-device|External Link]] | ||
+ | |||
+ | |||
====== Parted Use ====== | ====== Parted Use ====== | ||