I know that many of you are curious about what happens when ones recursively delete all files on a running Linux based operating system. In an effort to save you time (reinstalling and recovering from backups) I decided to do a video that shows what happens when rm-Rf / * is executed by root.

As you can see the consequences are visible as soon as we run this command and if you paid closed attention you can see that there are directories and files that were not deleted.

Directories like /proc are mounted in memory and can not be deleted while others like /var also have subdirectories under the same condition.



Aftermath after a rm -Rf /

Since I have been asked several times and many have speculated without really testing I decided to find out in what state was the operating system and which files and directories survived.

To answer this simply mounted the old hard drive to on another installation of Linux and run find /mnt/oldhdd, here is the output of previous command:

/mnt/oldhdd/
/mnt/oldhdd/sys
/mnt/oldhdd/dev
/mnt/oldhdd/var
/mnt/oldhdd/var/tmp
/mnt/oldhdd/run
/mnt/oldhdd/run/libgpod
/mnt/oldhdd/run/faillock
/mnt/oldhdd/run/setroubleshoot
/mnt/oldhdd/run/openvpn
/mnt/oldhdd/run/plymouth
/mnt/oldhdd/run/wpa_supplicant
/mnt/oldhdd/run/netreport
/mnt/oldhdd/run/mdadm
/mnt/oldhdd/run/cups
/mnt/oldhdd/run/cups/certs
/mnt/oldhdd/run/spice-vdagentd
/mnt/oldhdd/run/sepermit
/mnt/oldhdd/run/abrt
/mnt/oldhdd/run/console
/mnt/oldhdd/run/vpnc
/mnt/oldhdd/run/ppp
/mnt/oldhdd/run/blkid
/mnt/oldhdd/run/setrans
/mnt/oldhdd/run/utmp
/mnt/oldhdd/run/net-snmp
/mnt/oldhdd/run/lock
/mnt/oldhdd/run/lock/dmraid
/mnt/oldhdd/run/lock/lockdev
/mnt/oldhdd/run/lock/ppp
/mnt/oldhdd/run/NetworkManager
/mnt/oldhdd/run/saslauthd
/mnt/oldhdd/run/gdm
/mnt/oldhdd/run/gdm/greeter
/mnt/oldhdd/run/pptp
/mnt/oldhdd/proc
/mnt/oldhdd/boot
/mnt/oldhdd/media
/mnt/oldhdd/tmp

As you can see except for /mnt/oldhdd/run/utmp all of them are directories.



Comments

comments powered by Disqus