[SOLVED] How to recover deleted files from a fat32 volume in Linux?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
How to recover deleted files from a fat32 volume in Linux?
I accidentally deleted some precious files from an external disk formatted as fat32. I immediately unmounted the volume. Is there a way in linux (I've not a windows system at hand now) to recover the deleted files?
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe8900690
Device Boot Start End Blocks Id System
/dev/sdb1 1 121601 976760001 c W95 FAT32 (LBA)
If they're really precious, the first thing I'd do is mount /dev/sdb1 as read-only.
Then image it dd if=/dev/sdb1 of=myimage
Then unmount /dev/sdb1 and unplug it.
Now mount myimage with the loop option, and then you can safely use photorec and all the other utilities to your heart's content, happy in the knowledge that if you mess up, you still have your original disk, untouched.
I didn't do anything with the disk, I immediately unmounted it. Now the estimated time left is 12h25m. I'm checking the recovered files and it looks like it's doing a good job. Since I'm not in a hurry, I prefer to leave it running (it's 16:00 now in Italy, tomorrow early in the morning it should have finished). Thank you, anyway.
Let it be known that photorec = testdisk ... they are one and the same, and I wish they would just stick with one name.
TestDisk and PhotoRec are in one package, are both free and Open Source software and are licensed under the terms of the GNU Public License.
TestDisk is data recovery software which is designed to help recover lost partitions and make non-booting disks bootable again when these symptoms are caused by faulty software, certain types of viruses or human error.
PhotoRec is file data recovery software designed to recover lost files including video, documents and archives from Hard Disks and CDRom and lost pictures from digital camera memory.
Fix partition table, recover deleted partition
Recover FAT32 boot sector from its backup
Rebuild FAT12/FAT16/FAT32 boot sector
Fix FAT tables
Rebuild NTFS boot sector
Recover NTFS boot sector from its backup
Fix MFT using MFT mirror
Locate ext2/ext3 Backup SuperBlock
Undelete files from FAT, NTFS and ext2 file system
Copy files from deleted FAT, NTFS and ext2/ext3 partitions.
PhotoRec is a companion program to TestDisk.
For more safety, PhotoRec uses read-only access to handle the drive or memory support you are about to recover lost data from.
PhotoRec works with HardDisks, Cdrom, memory card (Compact Flash, Memory Stick, SecureDigital/SD, SmartMedia, Microdrive, MMC…), USB Memory Drives, DD raw image, EnCase E01 image… PhotoRec has been successfully tested with various portable media players including iPod and Digital Camera.
Hi. Photorec finished the job and the result is excellent! About 95% of the lost files has been recovered. You saved my day!
@alan_ri and H_TeXMeX_H: thank you for the clarification about testdisk and photorec. Indeed the two packages are strictly related: I installed photorec using Yast in Opensuse and it installed testdisk as a requirement.