Skip to content

Instantly share code, notes, and snippets.


Enrique Bautista Barahona ebautistabar

View GitHub Profile

Recovering deleted files in Ubuntu with ext4 filesystem

Recently, I deleted some files by mistake in a Ubuntu machine with an ext4 fs. These notes document the steps I took to get them back.


  • this procedure assumes that the partition that contained the deleted files is different from the root partition, as that was the scenario with which I had to deal (deleted files were in my home dir). The procedure needs that the partition that contained the files is unmounted, so if the deleted files were in the root partition, the process would be a bit different (e.g. storing the fs journal in a USB stick, using a live CD/USB to boot and issue the commands, etc.)
  • if something is not clear, you need more information, etc. check the sources below

With that out the way, let's begin.

ebautistabar /
Last active Aug 17, 2017
Troubleshooting of systemd and fsck on boot

Troubleshooting of systemd and fsck on boot

I investigated some problems with fsck and systemd recently. In the process, I learned quite a few things. And when I finished, I wrote these notes for future reference. Hope somebody finds them useful.


Open grub config file with:

sudo vi /etc/default/grub

In order to see the system log on boot, remove quiet and splash from the kernel command line. Also, we want as much information as possible about systemd, so add the following params to the kernel command line: