LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Desperately need to mount broken VFAT fs (https://www.linuxquestions.org/questions/linux-hardware-18/desperately-need-to-mount-broken-vfat-fs-20223/)

Gaidal 05-05-2002 05:14 AM

Desperately need to mount broken VFAT fs
 
As stated in the topic, I need to mount a VFAT fs to rescue some data before it collapses. It is a 60gb IBM disk with a bad superblock, unrepairable bad blocks, and perhaps worst of all: FAT32. The bad blocks are spreading rapidly, but they should not be able to go outside the disc they are on, so at least two thirds of the disk drive should be fine. Or am I completely wrong?

What I need to do is: Mount the drive in some way without using a correct partition table, while ignoring all errors. Then I have to access as many files as possible, and then run before the drive explodes. This is the final stage. You've got three extra lives and one neutron bomb. Good luck.

Anyway, I have to admit that I haven't even used Linux enough to call myself a good newbie yet. I installed Slackware on a cheap 2gb drive when the crash occurred, and I have been playing around with mount, dd, debugfs and such tools for a couple of days. But since I'm an almost-newbie, I have no clue on how to do this. I've read about similar problems on the net, however, those people were not using VFAT filesystems, for some odd reason. And if this succeeds, neither will I...

All I know is that I somehow need to find a backup superblock (I think I have 32k bytes/sector), but mount does not seem to support "-t vfat" together with "sb=n".

Well then, suggestions? Saving the hdd contents is like saving my life, so please give it a try.

Mara 05-05-2002 05:57 AM

Do you have a disk big enough to keep all this Windows partition? If yes:
dd if=/dev/hda1 of=/mnt/extra/file
This copies the whole hda1 partition to /mnt/extra/file. Remember thet the file will be BIG.
After this you have all data, so you can try to extract as much as you can later.
Mount does not support "sb=n" option with FAT, sorry. You can also try with fdisks (both Linux and DOS versions), but after you have a copy of your data.

Gaidal 05-05-2002 07:35 AM

Yes, I have another disk with alot of space. I tried to dd, but got errors no matter how I mounted the file, might be superblock related. And even if I was able to do this, how could I possibly extract the data? In what way would fdisk help me? And one more thing, is it OK if I use skip=xx and dd from the middle of the partition, because the first two partitions are empty, but I don't know exactly where they end...

Thanks.

Mara 05-05-2002 11:24 AM

To use dd you don't need to mount anything.
hda1 is first partition on your first hd. hda2 is the second partition and so on.
use cat /proc/partitions to look which partitions is which. If you think about 3rd partition, it can be hda6. It's true is you have one partition for Windows and 2 (or more) extra for data. As Windows don't like more than one primary partitions (hda1, hda2, hda3, hda4), those extra are likely to be logical (hda5, hda6 etc).
Skip should be ok.
It'll be rather easy to get text (just search the big file and copy your data), much bigger problem with programs...

Gaidal 05-05-2002 12:54 PM

No mounting required to use dd, but to use the file I create. The really important files are not text files, unfortunately... So what can I do to find them? I can save the data with dd, and I know the filesystem, but where is file name information stored?

If I extract a whole partition, is it possible to mount it? I always get an error that goes like "wrong fs type, bad loop-something, or too many filesytems mounted".

Well, I know what partition it is since I originally made the partition table in fdisk (Linux version).

Sorry for asking too many questions, I'm starting to panic. Which I shouldn't.

Mara 05-05-2002 03:00 PM

You can mount a file, no problem. The thing will be to fix it before mounting... I suggest a good guide to FAT filesystem ( I think I have something like this at home, but it needs some digging). After fixing it (with a backup copy, of course) you'll be able to mount it. The thing is to fix it. Note down the error you get while mounting it. It'll help much (tell use what's wrong and what to fix).

Mara 05-05-2002 03:26 PM

Look at www.cgsecutity.org/testdisk.html
Looks quite promising... I'm searching for more.

Gaidal 05-07-2002 10:11 AM

As far as I know, the FAT file system keeps two copies of the File Allocation Table on the drive, and both of these seem to be destroyed. Testdisk could not find anything such, even after searching for ten hours with different methods. Partition Magic failed as well. And if the FAT is gone, how could I possibly mount the file? This is, most likely, the error that prevents me from mounting my copy.

If I had made a copy at once, I would probably have been able to recover some data, but now it really seems impossible.

If you still think it is possible to extract even one file, except text data, please tell me. Otherwise I will low-level format the drive, or send it to IBM if necessary. After thinking about this for nearly a week, I think I am prepared to forget about all data, and Start Over... Wisdom through suffering.

Thanks alot for helping me!

unSpawn 05-07-2002 07:00 PM

There's a toolkit called TCT (The Coroner’s
Toolkit). It's not for the weak, takes a lot of time to image your disks, and even then the outcome ain't guaranteed, but if there is data you would really like to recover, trade time for result I'd say.

zmedico 05-07-2002 08:06 PM

Here is another program for imaging a damaged disk:
ftp://ftp.atnf.csiro.au/pub/people/r...ls-current.tgz
http://www.atnf.csiro.au/people/rgooch/linux/


All times are GMT -5. The time now is 03:28 PM.