I can't mount the image file I made with dd

Asked by Ralemy

Hello All,
I use dd to create an image from my root partition, as such
dd if=/dev/sdb1 of=/myotherdrive/myimage.img conv=noerrors,sync,notrunc bs=4096

but then I can't mount it with
mount -o loop /myotherdrive/myimage.img /mymountpoint

gives an error of bad file system.

mount: wrong fs type, bad option, bad superblock on /dev/loop1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail or so

So if I do an
fsck -fy /myotherdrive/myimage

and try the mount again, this time it does mount, and it has all my files, but the folder structure is destroyed and everything is in weird directories under
 /mymountpoint/lost+found

has anyone actually done this before?
Thanks,
Rex
------------
Vancouver LoCo

Question information

Language:
French Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Ralemy
Solved:
Last query:
Last reply:
Revision history for this message
Ralemy (reza.alemy) said :
#1

Machine info: AMD Athlon 64 X2 4200
fdisk -l
Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf9b5d149

   Device Boot Start End Blocks Id System
/dev/sdb1 * 1 1912 15358108+ 83 Linux
/dev/sdb2 13996 14593 4803435 5 Extended
/dev/sdb3 1913 13995 97056697+ 83 Linux
/dev/sdb5 13996 14593 4803403+ 82 Linux swap / Solaris

sdb1 is / and sdb3 is /myotherpartition
Running 9.10 Karmic Koala Server 64 bit

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#2

sudo mount -t udf -o loop /home/name/file.img /mymountpoint

the folder /mymountpoint MUST exist or the mount will fail.

Revision history for this message
Ralemy (reza.alemy) said :
#3

Thanks Actionparsnip,
while I was waiting, I made a new image with

dd if=/dev/sdb1 bs=4096 of=/Backup/bub.02 conv=sync,noerror

this time it mounts with

mount -o loop /Backup/bub.02 /mymountpoint

you are of course very right, both commands MUST be run in sudo context, and the mount point MUST exist, and the backup drive MUST have enough room for the image file.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

Glad you got the gold
=D