Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Unix has a long tradition of doing a `rm -rf /` before reinstalling a system. I don't agree with the people saying "don't do that". It worked safely before, it should still be safe to do.

(yes I know about --no-preserve-root)



> Unix has a long tradition of doing a `rm -rf /` before reinstalling a system.

Uh, what? Somebody was trolling you if they gave you that advice. In the days of NFS or AFS (God, I'm old) that could get you into serious trouble if it wandered into somewhere unprotected.

dd if=/dev/zero of=/dev/<somedisk>? Sure. Bog standard guaranteed erase of the disk. Doing that even once means that you're now in NSA territory to recover it.

rm -rf /? Never heard of that, ever.


`rm -rf /` was never safe, even if reinstalling the system. If it worked for you then you were just lucky. In the context doing a reinstall you need to specify --one-file-system, but really you should just reformat the partition, it'll likely be much faster anyways.


On one episode of BSD Now[1], Bryan Cantrill tells how they made 'rm -rf /' not work on Solaris. It seems like a good idea in that they managed to stay compliant to POSIX while disarming that particular foot seeking-missile.

Or, in other words: I agree completely, in fifteen years I have never used 'rm -rf /', I always used mkfs to create fresh filesystem.

[1] http://www.bsdnow.tv/episodes/2015_08_19-ubuntu_slaughters_k...


What's that supposed to be good for?

It certainly doesn't remove any file contents and to get a clean state, surely reformatting would be both easier and quicker?


Experimentation, learning, having fun, curiosity, and all the thing that make for a proficient sysadmin.


So cargo-cult? Doing things out of "tradition" without understanding what they are for?


Uh no. Not tradition: experimentation, learning, having fun, curiosity, and all the things that make for a proficient sysadmin.


To quote the original post:

> Unix has a long tradition of doing a `rm -rf /` before reinstalling a system. I don't agree with the people saying "don't do that".

So, yes, "tradition".


Actually, no. You might want to experiment on a test system to see what "tradition" actually does. Then you, you know, learn the consequences because you are, you know, curious to understand the result of the operation. And many people find this, well, fun. Normally people who do this sort of thing exhibit the traits that make them a good sysadmin because they are verifying Unix-lore to ensure that they aren't just following some sort of cargo cult methodology.

Hope that helps.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: