5

We are running Ubuntu server on VPS. Some files were removed accidentally by placing unnecessary space this command:

rm -r /usr/local <directory to be deleted>

I know, that in most cases this directory is used by packages to place some part of their content.

Is there any where to recover deleted files and directories?

I suppose, that theoretically it should be possible. Some software can look through the list of installed packages, check presence of files in file system and recover or reinstall corrupted packages if their files are missing in /usr/local.

chmeee
  • 7,370
  • 3
  • 30
  • 43
ilya
  • 213
  • 3
  • 6

2 Answers2

1

Check out ext3grep. It's not as easy as MS-DOS undelete used to be in the old days, but it has helped me out once.

wzzrd
  • 10,409
  • 2
  • 35
  • 47
1

Per Debian (and therefore Ubuntu) policy packages should never use /usr/local/ for anything.

If a package did use it you could find out by using debsums -s to find missing files.

If you don't want to install debsums you could simply do:

grep '/usr/local/' /var/lib/dpkg/info/*.list

On my Debian laptop (with plenty of stuff installed) this shows no results, exactly as you'd expect.

/usr/local is used for locally installed binaries and scripts, and for those you should have backups.

LapTop006
  • 6,496
  • 20
  • 26
  • Thanks for encouraging answer! There were no any errors since then. So I should say that nothing important was deleted. And as for you advise. Yes, *.list files don`t contain records about files in /usr/local. Your reply answered my question: packages do not use /usr/local, so there is no way to recover anything using package management utilities if something was deleted in this folder. Make backups! – ilya Apr 02 '10 at 10:39