stop rm at same-dev bind mounts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

having a rm command accidentally removing 3/4 of my system yesterday,
I am starting to wonder whether it is possible to have rm reliably
stop at bind mounts. I know there is a --one-file-system option, but
it is not working when the bind mount points to the same device:

% cd /tmp
% mkdir -p a/b c/d ; touch c/d/file ; mount --bind c a/b
% find a
a
a/b
a/b/d
a/b/d/file
% rm -rf --one-file-system a
rm: cannot remove `a/b': Device or resource busy
% find a
a
a/b

`file' has been removed. Imho the name of the --one-file-system option
is misleading as it only compares st_dev fields. Besides filing a
bug/enhancement ticket for coreutils, does someone know a reliable way
to stop rm in such cases?


-- 
Thomas Moschny <thomas.moschny@xxxxxxxxx>
-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux