[Bug 1499853] [NEW] overlayroot should support multiple lowerdir mounts

Ryan Harper 1499853 at bugs.launchpad.net
Fri Sep 25 19:30:31 UTC 2015


Public bug reported:

As of 3.19+, overlayfs supports multiple lowerdir mount points to enable
merging multiple read-only layers together which is useful for composing
multiple layers together and then imposing an specific upper layer (say
tmpfs).

>From the kernel documentation[1]

|  Multiple lower layers
|  ---------------------
|
|  Multiple lower layers can now be given using the the colon (":") as a
|  separator character between the directory names.  For example:
|
|    mount -t overlay overlay -olowerdir=/lower1:/lower2:/lower3 /merged
|
|  As the example shows, "upperdir=" and "workdir=" may be omitted.  In
|  that case the overlay will be read-only.
|
|  The specified lower directories will be stacked beginning from the
|  rightmost one and going left.  In the above example lower1 will be the
|  top, lower2 the middle and lower3 the bottom layer.


To enable this in overlayroot, we'd extend the the overlayroot parameter to take multiple lower= parameters:

Take for example a current command line used to boot a cloudimg and use
a tmpfs backed rw layer:

root=LABEL=cloudimg-rootfs overlayroot=tmpfs

If we had a second device/partition that we wanted to stack on top of
the root fs, we'd pass this on the command line

root=LABEL=cloudimg-rootfs overlayroot=tmpfs,lower=LABEL=myoverlay

which would:

1. ensure that we mounted LABEL=myoverlay on the root filesystem (say /media/lower1-ro)
2. then run the following overlay mount

mount -t overlay -o lowerdir=/media/lower1:/media/root-
ro,upperdir=/media/root-rw/overlay,workdir=/media/root-rw/overlay-work

Giving us a final stack of:

[tmpfs]
[LABEL=myoverlay]
[LABEL=cloudimg-rootfs

We also may want to stack more than one extra lower, specifying top-most
layer first, on to the lower layers.

root=LABEL=cloudimg-rootfs
overlayroot=tmpfs,lower=LABEL=myoverlay,lower=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0,lower=/dev/vdc

resulting in:

[tmpfs]
[LABEL=myoverlay]
[iscsi]
[vdc]
[LABEL=cloudimg-rootfs]


1. https://www.kernel.org/doc/Documentation/filesystems/overlayfs.txt

** Affects: cloud-initramfs-tools (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to cloud-initramfs-tools in Ubuntu.
https://bugs.launchpad.net/bugs/1499853

Title:
  overlayroot should support multiple lowerdir mounts

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-initramfs-tools/+bug/1499853/+subscriptions



More information about the Ubuntu-server-bugs mailing list