←back to thread

279 points the_why_of_y | 7 comments | | HN request time: 0.532s | source | bottom
1. smaili ◴[] No.11154331[source]
I've never actually seen or had the courage to attempt "rm -rf /". Does anyone know what would happen if it were run?
replies(3): >>11154530 #>>11154781 #>>11154818 #
2. TazeTSchnitzel ◴[] No.11154530[source]
You wipe your mounted disks.
replies(1): >>11155155 #
3. floatboth ◴[] No.11154781[source]
You wouldn't be able to run any programs from the hard drive, and when you reboot, you'll end up with no operating system.

Unless you're running FreeBSD (or Illumos) with ZFS and Boot Environments, in which case you'd just select a backup boot environment and continue working :-) Probably without your home directory though, as that is usually excluded from boot environments. But you can set them up however you want.

But if you're running Linux (before this update) on a laptop with terrible piece of shit firmware, you'd end up with a brick.

P.S. found a cool post about rm -rf / in my bookmarks: https://lambdaops.com/rm-rf-remains/ – you can recover a running rm'd Linux machine by using a running shell and /dev/tcp :D

replies(2): >>11155184 #>>11158428 #
4. Symbiote ◴[] No.11154818[source]
You get an error along of you're sure.

You should try

  rm --no-preserve-root -rf /
5. qb45 ◴[] No.11155155[source]
... and remote filesystems.
6. qb45 ◴[] No.11155184[source]
> P.S. found a cool post about rm -rf / in my bookmarks: https://lambdaops.com/rm-rf-remains/ – you can recover a running rm'd Linux machine by using a running shell and /dev/tcp :D

Awesome. This dynamic loading of bash plugins is mad.

7. dingo_bat ◴[] No.11158428[source]
I wanna try it out but I'm not brave enough to do it directly in my OS. WHat would happen if I did it in Ubuntu inside a VM? What if VirtualBox has mounted some directory on my system to the guest? I'm afraid to try this too :/

I once tried 'format C:' on a Windows 10 laptop I didn't care about and I just got a boring error message.