accidentally dumped a FAT32 usb to my Linux drive

Using TestDisk to repair the filesystem
Post Reply
Message
Author
ajnabi
Posts: 3
Joined: 25 Apr 2012, 01:45

accidentally dumped a FAT32 usb to my Linux drive

#1 Post by ajnabi » 25 Apr 2012, 01:56

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

Sponsored links

User avatar
remy
Posts: 457
Joined: 25 Mar 2012, 10:21
Location: Strasbourg, France.
Contact:

Re: accidentally dumped a FAT32 usb to my Linux drive

#2 Post by remy » 26 Apr 2012, 00:25

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.
J'ai pour habitude d'aller au bout de l'aide que j'apporte. Si vous pensez que je vous ai abandonné, et que je ne l'ai pas fait explicitement, c'est que votre message est enfoui avec d'autres. Relancez-moi (modérément) par mail.

ajnabi
Posts: 3
Joined: 25 Apr 2012, 01:45

Re: accidentally dumped a FAT32 usb to my Linux drive

#3 Post by ajnabi » 10 May 2012, 00:46

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!

User avatar
remy
Posts: 457
Joined: 25 Mar 2012, 10:21
Location: Strasbourg, France.
Contact:

Re: accidentally dumped a FAT32 usb to my Linux drive

#4 Post by remy » 10 May 2012, 00:53

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)
J'ai pour habitude d'aller au bout de l'aide que j'apporte. Si vous pensez que je vous ai abandonné, et que je ne l'ai pas fait explicitement, c'est que votre message est enfoui avec d'autres. Relancez-moi (modérément) par mail.

ajnabi
Posts: 3
Joined: 25 Apr 2012, 01:45

Re: accidentally dumped a FAT32 usb to my Linux drive

#5 Post by ajnabi » 11 May 2012, 03:24

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests