Protect files which are bind-mounted
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Safe-rm |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
From an anonymous blog commenter:
"I have a feature request for safe-rm. I accidentally deleted my
/home/user, even though I had safe-rm installed.
How did I do that? Well, basically it is because I had a bind mount of
my /home into a chroot: I wanted to make my user files accessible in
the chroot, which was not possible with a symbolic link (since it
would have pointed outside the chroot, an unaccessible location to the
chroot by definition).
I stopped using that chroot and forgot about the bind mount. Later, I
wanted to free some space and deleted the chroot recursively. The bind
mount had the effect that all my files where first deleted, then the
rm failed because it was trying to delete a mounted directory.
So, I have a feature request for safe-rm: Could you prevent the
deletion of a directory through a bind mount?
Say you were protecting /path/to/foo and /path/to is mounted to /bar
(you can see that by running mount without argument), then /bar/foo
could be protected from deletion as well."
Also see bug #724107.
description: | updated |