Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| parted [2021/09/12 09:32] – norman | parted [2025/06/20 13:35] (current) – [Attach IMG file] norman | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Mount single partition from image of entire disk (device) ====== | ||
| + | |||
| + | Get the partition layout of the image | ||
| + | |||
| + | < | ||
| + | |||
| + | |||
| + | < | ||
| + | Units = sectors of 1 * 512 = 512 bytes | ||
| + | Sector size (logical/ | ||
| + | ... | ||
| + | Device Boot Start | ||
| + | sda.img1 | ||
| + | |||
| + | |||
| + | 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 | ||
| + | |||
| + | < | ||
| + | |||
| + | Now the partition resides on /dev/loop0. You can fsck it, mount it etc | ||
| + | |||
| + | < | ||
| + | mount /dev/loop0 / | ||
| + | |||
| + | |||
| + | Unmount | ||
| + | |||
| + | < | ||
| + | losetup -d / | ||
| + | |||
| + | |||
| + | Source: [[https:// | ||
| + | |||
| + | ====== Attach IMG file ====== | ||
| + | |||
| + | < | ||
| + | losetup --find --show --partscan fred.image.dd | ||
| + | </ | ||
| + | there should be partitions ( / | ||
| + | Find one, You need: | ||
| + | < | ||
| + | cat / | ||
| + | ls -l /dev/loop* | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | mdadm -A -R /dev/md9 / | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | mount /dev/md9 /mnt/loop | ||
| + | </ | ||
| ====== Parted Use ====== | ====== Parted Use ====== | ||
| - | ====== A partitioning scheme for UEFI GPT simpler than the one suggested by the Gentoo Handbook | + | ===== A partitioning scheme for UEFI GPT simpler than the one suggested by the Gentoo Handbook ===== |
| I had always gone the BIOS MBR route and used fdisk for partitioning, | I had always gone the BIOS MBR route and used fdisk for partitioning, | ||
| Line 28: | Line 84: | ||
| mkpart primary fat32 1 101 # or 257 for non-GRUB | mkpart primary fat32 1 101 # or 257 for non-GRUB | ||
| name 1 esp | name 1 esp | ||
| + | |||
| + | SWAP MISSING | ||
| + | |||
| + | |||
| mkpart primary ext4 101 -1 # or 257 for non-GRUB | mkpart primary ext4 101 -1 # or 257 for non-GRUB | ||
| name 2 rootfs | name 2 rootfs | ||