Page 1 of 1

accidentally dumped a FAT32 usb to my Linux drive

Posted: 25 Apr 2012, 01:56
by ajnabi
I just used dd to copy an ISO to a USB drive. Unfortunately I mistakenly dumped to my backup hard drive. OOPS!!!

fdisk still sees it as one large disk with a Linux partition, but the USB ISO file was a 366M fat32 file.

running:
$ testdisk /dev/sdc

Choosing Intel --> Advanced
leaves me with the following:
1 P Linux 0 1 1 121600 254 63 1953520002


running:
$ testdisk /dev/sdc1

Choosing Intel --> Advanced
leaves me with the following:
1 * hid. HPFS/NTFS 0 0 1 46 167 57 749568

I'm not sure what the next step should be. Most tutorials and problems deal with recovering files from the same file system. I tried changing the type to Linux 83 but got nowhere.

Any help appreciated.
Thanks

Re: accidentally dumped a FAT32 usb to my Linux drive

Posted: 26 Apr 2012, 00:25
by remy
Please give feedback of testdisk scans (Quicksearch and deepersearch) on the full disk (/dev/sdc) not only the partition (/dev/sdc1).

Steps : You will probably recover your partition, try to list the files with testdisk ("P" key). Your filesystem will probabely be corrupt. Try to simulate recover with

Code: Select all

e2fsck /dev/sdc1 -n
to see if it can found info on superblocs. Try to mount using alternate superbloc. If you want to try to repair, you should first do a copy with dd, ddrescue or similar tools, then e2fsck -y /dev/sdc1... If you loose root info, your files (less the ones overwritten) will be in "Lost+Found" folder.

Re: accidentally dumped a FAT32 usb to my Linux drive

Posted: 10 May 2012, 00:46
by ajnabi
Hi Remy, Thanks for the response and sorry for not answering. I was expecting an email notification but I see I didn't check the button to "Notify me when a reply is posted" so I thought nobody answered.
Please give feedback of testdisk scans (Quicksearch and deepersearch) on the full disk (/dev/sdc) not only the partition (/dev/sdc1).


I'm not sure what you mean here. I don't see those options. I assume you mean the Analyse option (Analyse current partition structure and search for lost partitions). I will run that and get back with the results.

I tried:

Code: Select all

# e2fsck /dev/sdd1 -n
e2fsck 1.40.8 (13-Mar-2008)
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/sdd1

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
Thanks!

Re: accidentally dumped a FAT32 usb to my Linux drive

Posted: 10 May 2012, 00:53
by remy
I'm not sure if you did it because your disk changed, but first time it was sdc and you worked there with sdd...

For testdisk :

choose sdc (whole disk, not only the first partition), table intel, analyse, quickserach (give feedback) and then deepersearch (give feedback). If your ext partition wasn't aligned on cylinder, you'll perhaps have to do another scan with options "cylinder boundary : no" (or "align : no" depending on testdisk version)

Re: accidentally dumped a FAT32 usb to my Linux drive

Posted: 11 May 2012, 03:24
by ajnabi
Ah, thanks... I see why I didn't get it. I didn't have those options in my version--TestDisk 6.8. I have upgraded to 6.13 and am running the tests and will post results.