Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
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.
Recently, I deleted my /home files [I used the "rm -rf" command, but Ilinked it wrong to the file and it deleted and the all the files of /home/thorrn4 instead of the folder ], not the whole partition, but the files on it - Music, Photos, etc.
I was wondering: is there a way to recovery some, if not all, my lost data
Distribution: Lots of distros in the past, now Linux Mint
Posts: 746
Rep:
As far as I know, there isn't a way, as ext3 zeros out the inodes to prevent getting tripped up by false data when rebooting after a bad shutdown. As a result, unlike other filesystems (including ext2), that removes hooks to the deleted data, making recovery nearly impossible. (It can still be done, but it now becomes an art, done by someone with a lot of experience and skill, not something an automated tool is capable of. To give you an idea of the work involved, the following command is a good starting point:
grep /dev/hda1
As you can imagine, you're basically taking all the data off the partition, and hand sorting it, hoping to recover your information. Not really worth it, unless you're extremely adept with a number of complex, low-level forensics tools, or the information is somehow so irreplaceable that you you have no other option. The best you can hope for at this point is that you didn't learn a costly lesson in backups and using the root account as cautiously and rarely as possible.
If you do decide to attempt recovery of the folder, remember that the more you use that partition, the more likely the data will be overwritten an scrambled even more, so the best bet would be to boot into another linux partition, or better, to use knoppix (or a knoppix forensics cd) and run completely off the cdrom, so you don't disturb the partition with the data on it.
Sorry about the bad news, and I hope you didn't lose anything too irreplaceable. At some point we all cross this path, and I know how terrible it can be. To prevent a problem like this in the future, you may want to look into writing a bash-script that prevents you from deleting entire folders in the home, boot, and other important directories, without jumping through a lot of hoops and warnings. It's worth the time and hassle to learn how to do this.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.