Great! here I will help you know how to recover deleted files in Ubuntu – linux.
A few days back, while moving my photos from android phone to an external hard drive, my system messed up and to my disappointment, I was no longer able to find a folder having photos from a recent solo trip to Rishikesh, Uttrakhand – India (blog coming soon). And we all know how important those pictures are for all of us.
What leads to data loss ?
There can be multiple reasons leading to data loss – accidentally deleted files, formatted disk, system crash, etc. No matter what’s the reason, it would be quite frustrating to lose them because of the machine’s hiccup.
Hold on, don’t lose hope yet – I’m here to save your day. By the end of the blog, you will have your cherished moments’ pictures back, safe with you.
Tool used – Testdisk
To recover deleted files in Ubuntu we will use the free command-line tool named Testdisk.
Install Testdisk
sudo apt-get install testdisk
Step-by-Step Guide to recover deleted files in Ubuntu (linux)
- Start testdisk
sudo testdisk
- Use arrow keys to select [ No Log ], then press Enter key
Select no log - Then select a media
Select media - Then select partition table type – take clue from suggestion at the bottom of the terminal
Select partition table type - Then select analyse
Select analyse - Then select quick search 🔍
Select quick search - Then select partition
Select partition - Then select deeper search
Select deeper search - Now you will see, test-disk will begin its analysis – it will take its time based on disk size. Wait till it completes.
Testdisk analysis in progress - Once analysis completes, “Press P” to list files on the disk
Press p to list files - Navigate to deleted files
Navigate to deleted files - Use following keyboard keys to perform select, copy operations
- “:” – to select the current file
- “a” – to select all files in the current folder
- “c” – to copy the current file
- “C” – to copy the selected files
Select, copy deleted files
- Navigate to target directory and press “C” to copy selected deleted files to selected destination folder
Copy selected deleted files to destination folder - Once all the files are copied, press “q” and onwards quit/exit on screen instruction.
Post copy, exit the testdisk command line
Congratulations! you just recovered your important deleted files successfully. Relax now and sip your favourite drink 🥂 (cheers).
Reference Link: https://askubuntu.com/questions/443376/recovering-very-important-lost-data-from-external-hard-drive-when-copying-it
You might also wanna read – How to use external hard drive with Mac
If you find this article helpful, don’t forget to leave your feedback, any query or simply Hi 🙋🏽♂️ in comments. Share this with your friends as this might save their day!
You can reach out to me on Instagram, Twitter, Facebook – find links below.