Raspberry Pi mount image

Aus Nicki Wiki
Zur Navigation springen Zur Suche springen

Ein Image mit mehreren Partitionen wie beim Rasspberry PI Image muss sektor abhängig gemountet werde.

Image mount Variante 1

Image-partionen anzeigen:

fdisk -l raspian.img

Ausgabe:

Device         Boot     Start       End  Blocks  Id System
raspian.img1             8192    122879   57344   c W95 FAT32 (LBA)
raspian.img2           122880   5785599 2831360  83 Linux

Sektorgröße = 512 bytes
Partition 1: 512 * 8192 = 4194304
Partition 2: 512 * 122880 = 62914560

Patitionen mounten:

mount -v -o offset=4194304 -t vfat raspian.img /mnt/img/one
mount -v -o offset=62914560 -t ext4 raspian.img /mnt/img/two

Image mount Variante 2

losetup -P /dev/loop0 raspbian.img
mount /dev/loop0p2 /mnt
mount /dev/loop0p1 /mnt/boot