7

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

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.
WARNING: EXT3_FEATURE_INCOMPAT_RECOVER is set.
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) 
polym
  • 10,852
xralf
  • 15,415
  • I am not sure if this helps. http://www.cyberciti.biz/tips/linuxunix-recover-deleted-files.html – Ramesh Jul 09 '14 at 23:42
  • Have you checked for a ~/.vimrc~ file? Also, I know this is locking the barn after the horse's been stolen but there's a very nice article on our blog on how to set up your system to avoid this type of thing. – terdon Jul 10 '14 at 00:13
  • @terdon Yes, I checked it. There is no .vimrc~ or .vimrc.swp – xralf Jul 10 '14 at 06:44

2 Answers2

6

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

polym
  • 10,852
Kyle Jones
  • 15,015
  • OK, I run it with sudo, but the problem with mounting still remains. – xralf Jul 10 '14 at 06:49
  • Finally I entered the system as a root but hit another problem. I will ask another question to keep it simple. – xralf Jul 10 '14 at 07:59
0

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