|
|
Subscribe / Log in / New account

Bricking systems using rm

Bricking systems using rm

Posted Feb 11, 2016 23:43 UTC (Thu) by ms_43 (subscriber, #99293)
In reply to: Bricking systems using rm by kjp
Parent article: Bricking systems using rm

Actually it would be nice if --one-file-system were the default: it would prevent the popular "oops, didn't expect that rm -r on that thing deletes the NFS mounts too, recursively" accidents...


to post comments

Bricking systems using rm

Posted Feb 12, 2016 5:15 UTC (Fri) by josh (subscriber, #17465) [Link] (1 responses)

Or "didn't realize that would nuke my bind-mounted home directory", for that matter. (Chrome OS build chroots used to have this problem, but then they switched to using mount namespaces to fix that.)

Bricking systems using rm

Posted Feb 12, 2016 11:31 UTC (Fri) by fishface60 (subscriber, #88700) [Link]

rm --one-file-system probably also needs to be beefed up to do more than just check whether st_dev differs, since if your chroot is on the same filesystem as your home directory, it would fail to notice that check.
You'd probably need something like what systemd has: https://github.com/systemd/systemd/blob/b26fa1a2fbcfee7d0...


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds