[Rear-users] stopping rear ends with empty usb disk

upen upendra.gandhi at gmail.com
Thu Jul 14 15:40:59 CEST 2011

On Thu, Jul 14, 2011 at 5:58 AM, Jeroen Hoekx <jeroen.hoekx at hamok.be> wrote:
> Hi all,
> On 13 July 2011 10:59, Schlomo Schapiro <schlomo at schapiro.org> wrote:
>>> I think, under such conditions, never a rm -rf should run. This is an
>>> absolute nogo.
>> I guess we should check for active mounts before removing, just as a
>> safety precaution.
> I have attached a patch that's safer in the long run, as far as I can tell.
> There are a lot of places in Rear where BUILD_DIR is used instead of
> TMP_DIR. The patch fixes that. As a result, only usbfs/, netfs/, tmp/
> and root/ are created in BUILD_DIR. I did also change the rm -rf to a
> rmdir and the usbfs and netfs stages rmdir their own directory. The
> tmp/ and root/ folders can be safely rm -rf'ed because nothing gets
> mounted in there.
> With the patch, if unmounting fails, the worst thing to happen is that
> some directories remain in tmp/.
> Is this approach OK for everyone?
> Please take a look to see if nothing breaks. If you don't see any
> problems, I'll commit the patch tomorrow. It worked fine in my test
> VM's and my own machine.

Hello  Jeroen,

Idea sounds really good to me, if I get time, I will try to test the
patch, but this is definitely needed.

More information about the rear-users mailing list