Recover single file in the $HOME directory

I accidentally run rm -r /home/xralf and quickly killed it with Ctrl+C.

It seemed that everything is OK, but I noticed that my .vimrc, which is importent for me, is missing.

I tried the command:

$ extundelete /dev/sda5 --restore-file /home/xralf/.vimrc
extundelete: failed to read-only open device "/dev/sda5": Error code 13

To recover the file, but there seems to be a problem, I need to unmount the device.

It’s mounted here: /dev/sda5 on /home type ext4 (rw)

  • Is there some possibility to recover the file .vimrc?
  • How would you remount it? There is a problem I need $HOME

I can’t use LiveCD, because it’s missing on my laptop now. Booting from USB is not supported on my laptop as well.

Running the command with sudo:

sudo extundelete /dev/sda5 --restore-file /home/xralf/.vimrc
WARNING: Extended attributes are not restored.
The partition should be unmounted to undelete any files without further data loss.
If the partition is not currently mounted, this message indicates 
it was improperly unmounted, and you should run fsck before continuing.
If you decide to continue, extundelete may overwrite some of the deleted
files and make recovering those files impossible.  You should unmount the
file system and check it with fsck before using extundelete.
Would you like to continue? (y/n) 
Asked By: xralf


Error code 13 is EACCES – an access violation.

You don’t have permission to read from the device. Run the command as the superuser, i.e. use sudo extundelete ....

Answered By: Kyle Jones

that error it is because your sda is ext4 and you are trying in ext3

Answered By: RichiGarza
Categories: Answers Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.