[systemd-devel] mount unit with special requirements

Michael Hirmke mh at mike.franken.de
Mon Sep 10 20:28:00 UTC 2018


Hi,

>On Sa, 08.09.18 19:10, Michael Hirmke (mh at mike.franken.de) wrote:

[...]
>> For the backup "master" I have the following requirements:
>>
>> - The partition has to be mounted on boot.
>> - It has to be unmounted before the nightly copy job, so that an fsck
>>   can be performed.
>> - After that it has to be mounted read only, so that during the copy
>>   job no other machine can write to it.
>> - After finishing the copy job, the partition has to be remounted read
>>   write again.

>I am not sure I fully grok the requirements here, but I'd probably
>turn this around, and make the mount an .automount unit with a short
>TimeoutIdleSec=, so that the partition is available always under its
>file system path, but mounted only on access, and so that fsck is
>pulled in by the first access, but not repeated after that (except
>when the disk appears).

>You could then plug a service between the .autmount unit and the
>.mount unit that only has ExecStop= and does the rsync operation. This
>way you run rsync right after each access, automatically, and you know
>the mount is currently not in effect.

this seems to be a really interesting approach. Thx for it.
This is exactly the kind of advice, I had hoped for :)

I'm going on vacation tomorrow, so I can't test it for now.
But after returning, I definitely will try that. Probably I'll have a
few more question then ;)

>Lennart

Thx again.

Bye.
Michael.
-- 
Michael Hirmke


More information about the systemd-devel mailing list