Skip to content

Instantly share code, notes, and snippets.

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.

Important

  • 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.

@shanness
shanness / jira-search
Created November 5, 2023 03:44
jira CLI search with fzf and caching
@shanness
shanness / tmsu
Last active June 26, 2021 15:21
Bash type ahead completion for tmsu
# This belongs to /etc/bash_completion.d/tmsu or ~/.bash_completion
# Original from tomassedovic (https://github.com/oniony/TMSU/issues/78) and Master-jim
# TODO: handle spaces in values.
# Use this to control if values are displayed or just summarized, they will be expanded after the = is typed/selected
#VALUES="display"
VALUES="summarize"
COMP_WORDBREAKS="${COMP_WORDBREAKS}="
have tmsu &&