overlayroot should support multiple lowerdir mounts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-initramfs-tools (Ubuntu) |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
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=
|
| 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=
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=
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=
Giving us a final stack of:
[tmpfs]
[LABEL=myoverlay]
[LABEL=
We also may want to stack more than one extra lower, specifying top-most layer first, on to the lower layers.
root=LABEL=
resulting in:
[tmpfs]
[LABEL=myoverlay]
[iscsi]
[vdc]
[LABEL=
1. https:/
Changed in cloud-initramfs-tools (Ubuntu): | |
status: | New → Confirmed |
importance: | Undecided → Low |
Changed in cloud-initramfs-tools (Ubuntu): | |
importance: | Low → Wishlist |