FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.

» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

LinkBack Thread Tools
Old 09-10-2011, 01:35 PM
Thomas Moschny
Default stop rm at same-dev bind mounts


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
% rm -rf --one-file-system a
rm: cannot remove `a/b': Device or resource busy
% find a

`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@gmail.com>
devel mailing list

Thread Tools

All times are GMT. The time now is 04:14 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org