mount overlayFS como FS de Leitura-Escrita

3

Eu quero montar meu sistema de arquivos RO usando overlayFS - para usar duas camadas FS (Lowerdir e Upperdir).

Eu tentei o seguinte comando de montagem -

mount -t overlayfs -o lowerdir=/,upperdir=/overlay "overlayfs:/overlay" /mnt && root=/mnt

Isso montou / mnt como overlayFS, mas configurou como RO.

Eu tentei o seguinte para montá-lo como RW (significando que o Upperdir é RW) -

mount -t overlayfs -o rw,lowerdir=/,upperdir=/overlay "overlayfs:/overlay" /mnt && root=/mnt

Ainda não é bom.

Algumas informações gerais -

Eu gostaria de montar o R / W FS como UBIFS, meu RO FS é o SquashFS Estou trabalhando em openWRT Obrigado a todos!

    
por dear_tzvi 29.12.2015 / 11:38

1 resposta

3

Você está com falta de workdir= :

Directories

Overlaying mainly involves directories. If a given name appears in both upper and lower filesystems and refers to a non-directory in either, then the lower object is hidden - the name refers only to the upper object.

Where both upper and lower objects are directories, a merged directory is formed.

At mount time, the two directories given as mount options lowerdir and upperdir are combined into a merged directory:

mount -t overlay overlay -olowerdir=/lower,upperdir=/upper, workdir=/work /merged

The workdir needs to be an empty directory on the same filesystem as upperdir.

Then whenever a lookup is requested in such a merged directory, the lookup is performed in each actual directory and the combined result is cached in the dentry belonging to the overlay filesystem. If both actual lookups find directories, both are stored and a merged directory is created, otherwise only one is stored: the upper if it exists, else the lower.

Only the lists of names from directories are merged. Other content such as metadata and extended attributes are reported for the upper directory only. These attributes of the lower directory are hidden.

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.

    
por 29.12.2015 / 13:26