mounting partition images made with dd
5,213
Yes, it is perfectly possible to mount partition images made with dd. You should add a -o loop
(i.e., use a loopback device) to the mount command.
The final command should look like:
mount -oloop -t vfat ~/part.img /mnt
Of course, you should have dd'ed from a valid and previously formatted vfat filesystem in the original partition.
Related videos on Youtube
![IlikePepsi](https://i.stack.imgur.com/GYVuS.jpg?s=256&g=1)
Author by
IlikePepsi
Updated on September 18, 2022Comments
-
IlikePepsi almost 2 years
is there a way to mount and access a single partition on any mountpoint in my filesystem or must I use disk images and mount with offset?
I made a partiton image with
dd bs=4M if=/dev/sdb1 of=~/part.img
and tried to mount it on /mnt withmount -t vfat ~/part.img /mnt
.The output of mount is an Unknown Error -1
-
goldilocks over 9 yearsThat should work.
-
-
goldilocks over 9 years+1 I've found that using
-o loop
is generally not necessary;man mount
notes "The mount command automatically creates a loop device from a regular file if a filesystem type is not specified or the filesystem is known for libblkid..." -- but the last part is a bit of a qualifier, hopefully using-t vfat
and-o loop
together works. -
IlikePepsi over 9 years@Marcelo I tried the mounting procedure again with
mount -t vfat -o loop ~/part.img /mnt
and it works perfectly today. Now it seems I cannot reproduce the weird error. But many thanks anyway. -
J doe over 9 years@IlikePepsi, do you mean you cannot reproduce the error even when not specifying
-o loop
as you did the first time? That's weird indeed. Well, good that now it works. -
IlikePepsi over 9 years@Marcelo, yes. I thought that maybe the created loop device persists somehow but it doesn't. I tried
losetup -l
and the loop-device was gone afterumount /mnt