Ubuntu – Recover data from image file (USB DISK)

cd-imagedata-recovery

I have 8GB USB flash drive(PEN DRIVE). I used it and un-mount safely. But after next insertion it shows "No partition available". I tried it in windows too. I did not format it. I used disk utility(Ubuntu) and create a 8GB disk image. It saved in *img format. Now how can i read it? I tried mount command but it shows

sudo mount -o iocharset=iso8859-1  disk.img penR/
mount: you must specify the filesystem type

fdisk -l :

Disk /dev/sdb: 8053 MB, 8053063680 bytes
248 heads, 62 sectors/track, 1022 cylinders, total 15728640 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xffffffff

Disk /dev/sdb doesn't contain a valid partition table

MY PEN DRIVE WAS FAT32

Gparted shows unallocated disk. Disk utility asked for format. I have so much important data saved in disk. Please help. I am helpless. I believe linux is so powerful so that it can recover my data.
thanks in advance.

Best Answer

(Before doing anything with the disk.img, I would back it up.)

If the disk image is of the whole disk (eg, /dev/sdb), rather than just one partition (/dev/sdb1) you cannot mount the image directly (since the file will start with the disk partition table rather than the data partition). You can check if the image contains recogniseable partition headers with:

fdisk -lu disk.img

Which should indicate the presence of probably a single FAT32 partition, and tell you the offset in the img file (the number in the Start column). Then you can try and mount that partition using:

mount -o loop,offset=START disk.img MOUNTPOINT

Where START is the offset in bytes found with fdisk and MOUNTPOINT is somewhere to put it.

If the disk image does not contain any recogniseable partitions there may still be readable bits of data. Tools like photorec can be used to search the disk image for anything that looks like a recognisable file and try and extract it. See DataRecovery for more information on tools like this.

Related Question