具有大量目录的overlayfs

具有大量目录的overlayfs

假设我有任意数量的目录,并用数字标记。

我也有目录merge

我可以

mount -t overlay -olowerdir=1:2:50 overlay merge

获取12、 和50中的内容merge

将更多目录“添加”到覆盖层的最佳方法是什么,比如说,,,23就像81457已经执行了命令一样

mount -t overlay -olowerdir=1:2:50:23:81:457 overlay merge

首先?

如果我想“取消覆盖”某个目录,比如说23,我可以在不卸载整个目录的情况下做到这一点吗?

从概念上讲,我想您可能会说我想要在同一覆盖“级别”上有任意数量的目录。

答案1

(我有完全相同的问题。)唯一的我可以找到有关它的信息,是这样的:

https://lkml.org/lkml/2014/11/10/129:

Maybe it wasn't clear, but the number of lower layers isn't limited by
FILESYSTEM_MAX_STACK_DEPTH, only by the max size of the mount option buffer in
the kernel (1 page, usually 4096bytes).  So you could have a hundred read-only
layers stacked in a single overlayfs mount.

As for changing the stacking while the overlayfs is mounted: currently this is
not supported, the layers specified at the mount time remain there until the
overlay is unmounted.  Currently there's no possibility to add or remove layers
in a dynamic way, and it is definitely more tricky to implement than the static 
configuration.

-- Miklos Szeredi Mon, 10 Nov 2014

相关内容