Device file listed by fdisk doesn't exist
Nils Kassube
kassube at gmx.net
Sat Jun 20 13:16:39 UTC 2020
Volker Wysk wrote:
> I have an image file of an USB stick. It contains a regular MBR and
> one partition, not just the partition.
>
> I've set up a loop device, like this (*.img part is the image file):
>
> losetup -f "2020-01-09 Wartung 1804.img"
>
> This creates the new loop device /dev/loop23.
>
> Now I wonder how to access the partition inside. I can access the MBR
> inside /dev/loop23:
>
> -----snip-----
> desktop ~ % fdisk --list /dev/loop23
> Festplatte /dev/loop23: 14,3 GiB, 15376318464 Bytes, 30031872
> 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: 0x807b71ab
>
> Gerät Boot Anfang Ende Sektoren Größe Kn Typ
> /dev/loop23p1 * 2048 30031871 30029824 14,3G 83 Linux
The losetup part isn't necessary ...
file="2020-01-09 Wartung 1804.img"
fdisk -l "$file"
sudo mount -oloop,offset=$((2048*512)) "$file" /mnt
should suffice.
Nils
More information about the ubuntu-users
mailing list