Undelete

Today I deleted some files from my external hard drive, which is formatted in ext4, and realized that I had selected the wrong files. But luckily, I know a few things about file recovery and managed to recover everything in 5 minutes. The process can be seen below:
I immediately closed all applications with access to that disk and unmounted the partition so that the
inodeswould not be overwritten:julio@julio-acer ~> sudo umount /dev/sdb3I installed a program available in the Arch Linux repository called extundelete, which uses the information recorded in the ext3 and ext4 partition journals for recovering deleted files:
julio@julio-acer ~> sudo pacman -S extundeleteI read the program’s help (
extundelete --help) and the instructions available on the website http://extundelete.sourceforge.net.I switched to my home directory (which is on the internal hard drive) and ran the following command, which recovers all deleted files in the specified directory:
julio@julio-acer ~ $ sudo extundelete /dev/sdb3 --restore-directory "Documentos/Música/recorder" WARNING: Extended attributes are not restored. Loading filesystem metadata … 14145 groups loaded. Loading journal descriptors … 25337 descriptors loaded. Searching for recoverable inodes in directory Documentos/Música/recorder … 149 recoverable inodes found. Looking through the directory structure for deleted files … Restored inode 100928610 to file RECOVERED_FILES/Documentos/Música/recorder/Metodo per Flauto Dolce (1^ parte).pdf Restored inode 100928611 to file RECOVERED_FILES/Documentos/Música/recorder/Metodo Per Flauto Dolce (2^Parte).pdf Block 404247082 is allocated. Failed to restore inode 100928612 to file RECOVERED_FILES/Documentos/Música/recorder/Metodo per Flauto dolce (adatto per scuola media).zip:Some blocks were allocated. Failed to restore inode 101040146 to file RECOVERED_FILES/Documentos/Música/recorder/metodo:Inode does not correspond to a regular file. 145 recoverable inodes still lost.
There you go! The files I had deleted were the two PDFs, which the program successfully recovered
and placed in a folder called RECOVERED_FILES.

I’m a Brazilian computer engineer based in Germany, passionate about tech, science, photography, and languages.
I’ve been programming for about two decades already, exploring everything from mobile apps and web development to machine learning. These days I focus on cloud SRE and data engineering.
I volunteer in the open source and Python communities, helping organize PyCon DE and PyData Berlin, mentoring, and contributing with code and translations.
On my blog, I share Linux tips, setup guides, and personal notes I’ve written for future reference. I hope others find them helpful as well. The content is available in multiple languages.
Browse my gallery for some of my photography.
Away from the keyboard, you’ll find me at concerts, playing clarinet, cycling, scuba diving, or exploring new places, cultures, and cuisines.
Always happy to connect! 🙂