3

I'm trying to mount -o remount an overlayfs in order to change to an updated lowerdir:

$ mount -t overlay ovl /mnt -oworkdir=/.work -oupperdir=/upper -olowerdir=/lower
$ mount -t overlay ovl /mnt -oworkdir=/.work -oupperdir=/upper -olowerdir=/lower-new -o remount

The remount seems to work, but no change happens. mount still shows the old upperdir:

$ mount
...
ovl on /mnt type overlay (rw,relatime,lowerdir=/lower,upperdir=/upper,workdir=/.work)

I would have expected for the mount parameter to change and for the files coming from lowerdir to be updated accordingly, or for the remount to give an error (with strong preference for the update ;-)

2
  • 1
    Unfortunately not a solution, but github.com/torvalds/linux/blob/… confirms that what you’re seeing is not a bug or misuse, but rather overlayfs only picks up read-only changes when remounting :(
    – Michael
    Sep 9, 2018 at 16:58
  • I can see how changing parameters could lead to bad situations. For instance - remounting / (root) with a different set of lower and upper dirs, you could brick your system, requiring a reboot. However, if you know what you're doing, remounting different uppers could allow you to significantly change the behavior of your os, without having to reboot.
    – MishaP
    Sep 7, 2022 at 10:02

0

You must log in to answer this question.

Browse other questions tagged .