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.
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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've moved a 5G file from one drive to another. After it's moved, turned out the destination drive has some hardware problem and the file is corrupted and the file on the original drive was deleted since the mv is completed. I should be able to recover it from the original drive since it is unmounted once the mv is done. I've tried extundelete but it only works on ext3 and ext4. I've tried testdisk but it doesn't see it. After some research, I am able to see it with debugfs (file attached). To recover the file, I can either reset the inode, block and dtime flags, or copy those blocks to another drive with dd. The problem is there are quite a lot of them and not all of them are continuous and I'm not good in scripting to do it. Is there any utility can do the recovery? Or any guru can help me with a script to recover the file?
I've only ever used PhotoRec, but it does work somewhat on deleted files. The case you cite seems to be ideal, you have the drive unmounted and haven't tried to write anything else to it as yet. A thing to check is whether or not PhotoRec can work on a limited directory on the drive it is searching, because it takes a long time and since it does not try to resurrect the directory structure, it will put together all file fragments it can and put them into many numbered sub-directories, so you'll get a lot of formerly deleted files back that you may not care about.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.