[systemd-devel] systemd-nspawn -- bind multiple directories

arnaud gaboury arnaud.gaboury at gmail.com
Mon Apr 27 07:14:32 PDT 2015


On Mon, Apr 27, 2015 at 3:44 PM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Mon, 27.04.15 10:19, arnaud gaboury (arnaud.gaboury at gmail.com) wrote:
>
>> To install a Fedora container from the raw image in my host Archlinux,
>> I can do this:
>>
>> # systemd-nspawn -M Fedora-Cloud-Base-22_Beta-20150415.x86_64.raw --
>> bind=/var/lib/machines/enl:/mnt
>>
>> Now for the use of two btrfs subvol, I would like to bind
>> /var/lib/machines/enl/{etc,var}
>>
>> Does the systemd bind options accept multi directories to bind?
>>  Soemthing like this :
>>
>> # systemd-nspawn -M Fedora-Cloud-Base-22_Beta-20150415.x86_64.raw --
>> bind=/var/lib/machines/enl:/mnt /var/lib/machines/enl/etc:/mnt/etc
>> /var/lib/machines/enl/var:/mnt/var
>
> You can specify --bind= multiple times in one command line to bind
> mount multiple directories. I have updated the man page now to
> explicit mention this.
>
> The command line you are using for is hence:
>
> # systemd-nspawn -M Fedora-Cloud-Base-22_Beta-20150415.x86_64.raw --bind=/var/lib/machines/enl:/mnt --bind=/var/lib/machines/enl/etc:/mnt/etc --bind=/var/lib/machines/enl/var:/mnt/var

This features solved my issue regarding my Btrfs setting of three non
nested volumes : rootvol, etc and var.
Boot first the raw Fedora image, # mkdir -p /mnt/{etc,var}, log out
then boot again when binding  all three subvol.


>
> Lennart
>
> --
> Lennart Poettering, Red Hat



-- 

google.com/+arnaudgabourygabx


More information about the systemd-devel mailing list