I was trying to recover some data from a faulty USB stick (NTFS) but before i tested on another USB stick. the Virtualbox VM detected the USB stick which was unmounted in order to make a ddrescue image.
I managed to do this once but now it doesn't seem to work anymore as fdisk thinks that there are several partitions when there's only one in the USB stick???
Anyone has any ideas/suggestions?
Steps:
- Check file system of usb stick to assign the right FS when mounting the img
- dd the usb stick
- check img partition properties. This is to mount the partition with the appropriate offset value (starting block).
- mount img with mount FAILED
- mount img with kpartx (not familiar with this tool) FAILED
Rosa recover_disk # fdisk -l /dev/sdb
Disk /dev/sdb: 1014 MB, 1014497280 bytes 17 heads, 32 sectors/track, 3642 cylinders, total 1981440 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: 0xc3072e18
Device Boot Start End Blocks Id System /dev/sdb1 * 32 1981439 990704 7 HPFS/NTFS/exFAT
Rosa recover_disk # ddrescue /dev/sdb1 dd_resc.img
GNU ddrescue 1.17 Press Ctrl-C to interrupt rescued: 1014 MB, errsize: 0 B, current rate: 704 kB/s ipos: 1014 MB, errors: 0, average rate: 14492 kB/s opos: 1014 MB, time since last successful read: 0 s Finished
Rosa recover_disk # fdisk -l dd_resc.img
Disk dd_resc.img: 1014 MB, 1014480896 bytes 255 heads, 63 sectors/track, 123 cylinders, total 1981408 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: 0x4d544f4f
This doesn't look like a partition table Probably you selected the wrong device.
Device Boot Start End Blocks Id System
dd_resc.img1 ? 218137203 2138359164 960110981 70 DiskSecure Multi-Boot dd_resc.img2 ? 544370800 2464669663 960149432 74 Unknown dd_resc.img3 ? 225600882 769746299 272072709 82 Linux swap / Solaris dd_resc.img4 ? 2760638474 2760690110 25818+ 61 SpeedStor
Partition table entries are not in disk order
Rosa recover_disk # mkdir /media/ddmount Rosa recover_disk # echo $(( 32*512 ))
16384
Rosa recover_disk # mount dd_resc.img /media/ddmount -o loop,offset=16384 -t ntfs
NTFS signature is missing. Failed to mount '/dev/loop0': Invalid argument The device '/dev/loop0' doesn't seem to have a valid NTFS. Maybe the wrong device is used? Or the whole disk instead of a partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
Rosa recover_disk # kpartx -a -v dd_resc.img
device-mapper: resume ioctl on loop0p1 failed: Invalid argument create/reload failed on loop0p1 add map loop0p1 (0:0): 0 1920221962 linear /dev/loop0 218137203 device-mapper: resume ioctl on loop0p2 failed: Invalid argument create/reload failed on loop0p2 add map loop0p2 (0:0): 0 1920298864 linear /dev/loop0 544370800 device-mapper: resume ioctl on loop0p3 failed: Invalid argument create/reload failed on loop0p3 add map loop0p3 (0:0): 0 544145418 linear /dev/loop0 225600882 device-mapper: resume ioctl on loop0p4 failed: Invalid argument create/reload failed on loop0p4 add map loop0p4 (0:0): 0 51637 linear /dev/loop0 2760638474
---- 2017-03-01 UPDATE -------
The mystery remains but i manage to mount with no offset options which is a relief but not satisfying as i don't understand why which will be helpful for future reference.