2

I misspelled a variable name in a makefile and rm -rf srcs/* turned into rm -rf /*. Boom. My home directory is wiped clean, but this isn't a data recovery question. The only personal file I actually lost was the makefile I was working on; all of my documents, pictures, etc were all backed up elsewhere.

I do not, however, have any full system backups, so while I'm not worried about losing personal data, I am concerned about potential damage to my system. Hence two questions:

  1. If I executed rm -rf /* without root privileges, could any directories on my system have possibly been damaged besides /home/me/?

  2. Is there anything I need to do to my home directory before I can begin using it normally again? For example, should I manually add a .bash_history or something to /home/me?

I'm using Arch Linux by the way, and LXDE desktop.

1
  • If you did this with root privilege then the results are pretty bad -- you effectively brick your system by corrupting the efivars variable store. I imagine you have an Arch-Linux forum account. Check out a related thread here where someone did just that.
    – sherrellbc
    Commented Oct 3, 2016 at 19:30

2 Answers 2

1

There isn't anything you actually need to do, things will work for the user that did run the rm -rf. A user cannot delete his own directory in /home (unless you have some very strange permissions for /home that is).

And everything in your home is optional. Yes, your editor will need to be configured again. Yes, LXDE will need to be configured again. Yes, several other things will need to be configured again, but they will all work.

The only extra thing that you probably deleted (if you use it, that is) are your emails in /var/spool/mail/.


Extra notes

By default, the only things that Arch has in /etc/skel are:

$ find /etc/skel/
/etc/skel/
/etc/skel/.bash_profile
/etc/skel/.bashrc
/etc/skel/.bash_logout
/etc/skel/.screenrc

If you do not have ones of your own, it is wise to copy them to your home.

It is also wise to reboot to recreate session authority, DBUS and pulseaudio cookies (most installations of LXDE will be using those). In theory, logging off to the display manager and then logging in back should be enough, but I saw display mangers that did not destroy all user processes upon logoff (XDM), therefore reboot to be safer.

0

Probably not. I don't know for sure on Arch, but for Fedora/RHEL I would re-run useradd and force the UID/GID to match. Or just copy over /etc/skel to /home/me and fix permissions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .