“mount disk dump images eg. from the raspberry pi”

goals:

  • read blocksize
  • mount partitions

read image information

## using fdisk and the image
> fdisk -l backup.img

## shows following
Gerät      Boot  Anfang Ende     Sektoren Größe Kn Typ
backup.img1        2048   206847   204800  100M  c W95 FAT32 (LBA)
backup.img2      206848 31116287 30909440 14,7G 83 Linux

## we have to multiply the "Start" unit size with512
> bc <<< 512*2048
1048576 #backup.img1
> bc <<< 512*206848
105906176 #backup.img2

mount partitions

## mount filesystems
> mount -v -o offset=1048576 -t vfat backup.img /mnt/backup1
> mount -v -o offset=105906176 -t ext4 backup.img /mnt/backup2

## when errored with "overlapping loop" try to specify the partition size
## multiply "Blocks" with 512
> bc <<< 512*30909440
15825633280 #backup.img2

## then mount with
> mount -v -o offset=1048576,sizelimit=15825633280 \
    -t ext4 backup.img /mnt/disk2