In my case it was several minutes until it returned back to the menu. The screen will begin to show logs and may seem to hang, but just be patient. This enables networking and mounts all filesystems defined in /etc/fstab. In the recovery mode menu, quickly select "Enable networking". In my case, I tried doing all that without rebooting, but systemd or something else wasn't too happy about it, so in the end I had to shutdown by just pressing the power button, as I was kind of locked out of the box.Īnyway, if you reboot too, when the grub screen shows up choose "Advanced options", and then pick the one for "recovery mode". The goal now is logging in as root, dropping to run-level 3 and unmounting the partition that we have to process.
HOW TO RESTORE DELETED FILES IN LINUX INSTALL
Then, install ext4magic, a disk utility to recover files from ext3 or ext4 partitions. If possible, try to close all the programs that may be writing on the same partition. We want to minimize the amount of interactions with the system, so the blocks which contained the deleted files don't get overwritten. Also, don't store the copy of the journal in /tmp, in case it gets cleaned up. dev/sda6 should be the appropriate path to your device, so change it accordingly. Right after deleting the files, open a terminal and make a copy of the filesystem journal: sudo debugfs -R "dump /opt/sda6.journal" /dev/sda6 if something is not clear, you need more information, etc.storing the fs journal in a USB stick, using a live CD/USB to boot and issue the commands, etc.) 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. 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).These notes document the steps I took to get them back. Recently, I deleted some files by mistake in a Ubuntu machine with an ext4 fs. Recovering deleted files in Ubuntu with ext4 filesystem