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

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@gmail.com>
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 

Thread Tools




All times are GMT. The time now is 01:41 PM.

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