Is it possible to mount root as OverlayFS?

Is it possible to mount root as OverlayFS?

The challenge of mounting root as overlayfs has been solved. Briefly, the ‘lower’, ‘work’ and ‘upper’ directories should be moved to the ‘merge’ dir. However, you should consider: 1) There is no need to do something if the ‘lower’ directory is present as a disk image.

Is it possible to use rootfs as a mount point?

I am trying to use rootfs as a lower point of new overlay mount point. Then I chroot to a new mount point and use it for test some packages and selflearning without harming real system. This was worked for me a couple month ago but now it didn’t.

How to prevent overlayroot from mounting all filesystems?

By default, overlayroot will mount all filesystems under / in the specified mode. This can be prevented by adding another option to the configuration: Note that swap=1 and recurse=0 are separated by a comma, not a colon. (The default value for recurse is 1).

Is there a way to mount the root filesystem?

Running mount, we should see something like: Note how the root filesystem is of type overlayfs with specified upper and lower filesystems that correspond to the read-write tmpfs and read-only mounts listed. Once overlayroot is enabled, it is no longer possible to make changes to the root filesystem.

Where are files stored in the overlay filesystem?

When the NFS export feature is enabled, every copied up directory is indexed by the file handle of the lower inode and a file handle of the upper directory is stored in a “trusted.overlay.upper” extended attribute on the index entry.

When to use metadata only copy up in OverlayFS?

When metadata only copy up feature is enabled, overlayfs will only copy up metadata (as opposed to whole file), when a metadata specific operation like chown/chmod is performed. Full file will be copied up later when file is opened for WRITE operation.

When to use overlayfs to rename a directory?

When renaming a directory that is on the lower layer or merged (i.e. the directory was not created on the upper layer to start with) overlayfs can handle it in two different ways: return EXDEV error: this error is returned by rename (2) when trying to move a file or directory across filesystem boundaries.