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

Lennart Poettering lennart at poettering.net
Mon Apr 27 06:44:49 PDT 2015


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

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list