Hacker News new | ask | show | jobs
by Ezhik 3644 days ago
`rm` is probably hardcoded to not touch `/` without the flag and that's it, so most likely it's not necessary.
1 comments

I just checked the `rm` source code for the GNU coreutils, and it actually checks for `/` by checking for identical device and inode numbers to `/`. I admittedly don't want to test if the feature works, but in theory if you remount `/` at a different location `rm` will still require the `--no-preserve-root` flag to delete it.

That said, the above only saves you if `/` and `/mnt/c` are the same device mounted at two different places - I haven't used the system to know.