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
#1044, all related
to docker images and builds. This same problem is also described in
in-overlay2-storage-driver> a StackOverflow question.
According to the Linux
Kconfig documentation and
If this feature is disabled, then rename(2) on a lower or merged
will fail with EXDEV ("Invalid cross-device link").
Note, that redirects are not backward compatible. That is, mounting
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
documentation on overlayfs.
* 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
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
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