Eine Partition aus dem Image extrahieren

# ls -lh *.img
-rw-r--r-- 1 hss hss 2009071616 Nov  4 18:14 2022-09-22-raspios-bullseye-arm64-lite.img

# fdisk -lu 2022-09-22-raspios-bullseye-arm64-lite.img
Festplatte 2022-09-22-raspios-bullseye-arm64-lite.img: 1,89 GiB, 2009071616 Bytes, 3923968 Sektoren
Einheiten: Sektoren von 1 * 512 = 512 Bytes
Sektorgröße (logisch/physikalisch): 512 Bytes / 512 Bytes
E/A-Größe (minimal/optimal): 512 Bytes / 512 Bytes
Festplattenbezeichnungstyp: dos
Festplattenbezeichner: 0x21e60f8c

Gerät                                       Boot Anfang    Ende Sektoren Größe Kn Typ
2022-09-22-raspios-bullseye-arm64-lite.img1        8192  532479   524288  256M  c W95
2022-09-22-raspios-bullseye-arm64-lite.img2      532480 3923967  3391488  1,6G 83 Lin

# mkdir /mnt/boot /mnt/root

# mount -t vfat -o loop,offset=$((8192 * 512)),sizelimit=$((524288 * 512)) 2022-09-22-raspios-bullseye-arm64-lite.img /mnt/boot

# ls /mnt/boot

# mount -t ext4 -o loop,offset=$((532480 * 512)),sizelimit=$((3391488 * 512)) 2022-09-22-raspios-bullseye-arm64-lite.img /mnt/root

# ls /mnt/root
bin   dev  home  lost+found  mnt  proc  run   srv  tmp  var
boot  etc  lib   media       opt  root  sbin  sys  usr

# umount /mnt/boot

# umount /mnt/root

Andere Möglichkeit:

# losetup -P --show -f 2022-09-22-raspios-bullseye-arm64-lite.img


KategorieRaspberry

Eine Partition aus dem Image extrahieren (zuletzt geändert am 2022-12-02 17:05:38 durch HansStefanSuhle)