As of Clear Linux version 30950, the kernel configuration
CONFIG_OVERLAY_FS_REDIRECT_DIR has been unset.
CONFIG_OVERLAY_FS_REDIRECT_DIR specifies the default behavior of the overlay
module when renaming lower directories. This was done to resolve GitHub
issues <
https://github.com/clearlinux/distribution/issues/1107> #1107,
<
https://github.com/clearlinux/distribution/issues/1141> #1141 and
<
https://github.com/clearlinux/distribution/issues/1044> #1044, all related
to docker images and builds. This same problem is also described in
<
https://stackoverflow.com/questions/46787983/what-native-overlay-diff-mean-
in-overlay2-storage-driver> a StackOverflow question.
Background:
According to the Linux
<
https://github.com/torvalds/linux/blob/master/fs/overlayfs/Kconfig#L14>
Kconfig documentation and
<
https://www.kernel.org/doc/Documentation/filesystems/overlayfs.txt> kernel
documentation:
If this feature is disabled, then rename(2) on a lower or merged
directory
will fail with EXDEV ("Invalid cross-device link").
Note, that redirects are not backward compatible. That is, mounting
an
overlay which has redirects on a kernel that doesn't support this feature
will have unexpected results.
For more information, see the "renaming directories" section of the
<
https://www.kernel.org/doc/Documentation/filesystems/overlayfs.txt> kernel
documentation on overlayfs.
Impact:
* Overlayfs is used by the Docker storage engine for images. For Docker
users, no action should be required.
* For users with a manually created overlayfs filesystem, renaming
directories in lowerdirs will no longer work. If your usage of overlayfs
requires this functionality, see the instructions below to restore previous
behavior.
Instructions to restore previous behavior:
Although redirect_dir has been disabled by default, it can be manually
enabled on systems that require it by following these steps:
1. Create the directory /etc/modprobe.d with the command:
$ sudo mkdir -p /etc/modprobe.d
2. Create an overlay-redirect-dir.conf file specifying options for the
overlay module with the command:
$ echo "options overlay redirect_dir=on" | sudo tee
/etc/modprobe.d/overlay-redirect-dir.conf
3. Unload and reload the overlay module with the command:
$ sudo modprobe -r overlay && sudo modprobe overlay
Or, reboot the system with the command:
$ sudo reboot