Skip to contentSkip to conversation

How to specify the mount points for multiple lower layers?

DISCUSSION Alkis Georgopoulos 2 participants 3 messages Aug 6, 2015 – Aug 12, 2015

lore
Share & tools
lore
#0 lore raw

From https://www.kernel.org/doc/Documentation/filesystems/overlayfs.txt:
mount -t overlay overlay -olowerdir=/lower1:/lower2:/lower3 /merged

How can I specify that I want e.g. lower2 to be mounted at merged/home?

If all lower* layers can only be mounted at /merged, then I don't see any way at all that overlayfs would allow me to combine e.g. Partition MountDir MergedDir
------------------------------

/dev/sda1  /root-fs  /merged
/dev/sda2  /home-fs  /merged/home

I even tried to create a fake directory structure like this:
/dev/sda2 /fakedir/home /merged
...so that I would mount /dev/sda2 to /fakedir/home, and then try to use lower2=/fakedir, but then I got a different issue, that overlayfs doesn't include submounts, so sda2 wasn't visible at all then.

So I was unable to combine the root and home partitions to the correct paths using overlayfs (I'm planning to use a tmpfs as the upper dir later on).

Any help? Thank you!

#1 lore raw
Quoted 18 lines · Alkis Georgopoulos

From https://www.kernel.org/doc/Documentation/filesystems/overlayfs.txt:
mount -t overlay overlay -olowerdir=/lower1:/lower2:/lower3 /merged

How can I specify that I want e.g. lower2 to be mounted at merged/home?

If all lower* layers can only be mounted at /merged, then I don't see any way at all that overlayfs would allow me to combine e.g. Partition MountDir MergedDir
------------------------------

/dev/sda1  /root-fs  /merged
/dev/sda2  /home-fs  /merged/home

I even tried to create a fake directory structure like this:
/dev/sda2 /fakedir/home /merged
...so that I would mount /dev/sda2 to /fakedir/home, and then try to use lower2=/fakedir, but then I got a different issue, that overlayfs doesn't include submounts, so sda2 wasn't visible at all then.

Quoted 4 lines

So I was unable to combine the root and home partitions to the correct paths using overlayfs (I'm planning to use a tmpfs as the upper dir later on).

Any help? Thank you!

Create two overlays: one for root and one for home (which includes the additional home-fs).

Does that work for you?

Thanks,
Miklos

#2 lore raw
Quoted 5 lines · Miklos Szeredi

Create two overlays: one for root and one for home (which includes the additional home-fs).

Does that work for you?

Yes, thank you, I wasn't able to do it with the multiple lower layers syntax, but I was able to do it with multiple overlayfs mounts.

Thanks!