[systemd-devel] systemd-fstab-generator and multiple mounts to same mount point

John Lane systemd at jelmail.com
Wed Jan 2 04:44:10 PST 2013


On 02/01/13 12:15, Andrey Borzenkov wrote:
> В Wed, 02 Jan 2013 12:01:41 +0000
> John Lane <systemd at jelmail.com> пишет:
>
>> Hello,
>>
>> I have a configuration where a filesystem is mounted on /images.
>>
>> Then a subdirectory of that filesystem, say /images/1, is bind mounted
>> on top as /images.
>>
>> Prior to moving to systemd, this kind of thing has always worked fine
>> with /etc/fstab containing something like this:
>>
>> # images uuid 8847d358-c4f6-4405-a65c-e0c514151f8e is on /dev/sda1
>> UUID=8847d358-c4f6-4405-a65c-e0c514151f8e /images ext3 defaults 0 1
>>
>> # Bind mount current images on /images
>> #/images/1354 /images none rw,bind 0 0
>>
>> With systemd, systemd-fstab-generator complains about the second use of
>> the /images mount point:
>>
>> Jan 02 08:31:58 neon systemd-fstab-generator[79]: Failed to create unit
>> file /run/systemd/generator/images.mount: File exists
>> Jan 02 08:31:58 neon systemd[1]:
>> /usr/lib/systemd/system-generators/systemd-fstab-generator exited with
>> exit status 1.
>>
>> How should this situation be handled with systemd ?
>>
> Mount first time somewhere else? Like /image_archive? And bind
> mount /image_archive/1354 to /images?
>
I realise I can work around the problem (that's what I am doing right 
now) but I want the mounts to be done in that way (one over the other).

As such an /etc/fstab worked fine before systemd it would be good if it 
continued to work with systemd.

I think the problem is how systemd names the generated mount units. If 
there is a clash, could it not
use a modified name for the unit (e.g if 
/run/systemd/generator/images.mount exists it would create 
/run/systemd/generator/images-1.mount or something like that) ?




More information about the systemd-devel mailing list