3

I've come across one of those aufs to overlayfs migration headaches. With aufs you could specify multiple RO-layers and updating some files in them was refreshed with remount.

fstab with aufs:

aufs    /etc                       aufs    noauto,br:/rw-root/etc=rw:/ro-root/etc=ro:/etc=rr  0 0

Same functionality with overlayfs:

none    /.tmp-root/etc              overlayfs  noauto,upperdir=/ro-root/etc,lowerdir=/etc      0 0 
none    /etc                       overlayfs  noauto,upperdir=/rw-root/etc,lowerdir=/.tmp-root/etc  0 0 

Mounting the system in order is fine and everything works. The problem arises when I need to update something on the ro-root partition. Running remount on that sees /etc as the already mounted overlayfs and not the original ro-root. (Solved the striked-out problem with mount --bind)

Apparently the problem is with inode numbers of the files. So editing of a file works fine, but if I copy a new file over the old one on the lower level, the change is not propagated. So this could be a real overlayfs problem.

I'd really like this setup to continue working (restructuring everything is quite a lot of work and testing that I'd rather avoid, because this affects +50 virtualmachines). That being said, I will also accept answers that would accomplish moving readonly-root after initrd-stage safely to go around this problem and if that's not possible then suggestion most minimalistic way of changing/modifying/creating initrd to accomplish this move.

There's another related question, but it's the simpler form of just two layers. Simple overlayfs reload question

Manwe
  • 755

1 Answers1

1

have you tried running remount on /.tmp-reoot/etc first and then remount on /etc

e.g.:

 mount -o remount /.tmp-reoot/etc

 mount -o remount /etc
badgerhill
  • 56
  • 1
  • Yes, I've tried. Either something is failing in overlayfs (which I doubt in this case) or the problem is caused by circular mount reference. (In one mount /etc is the lowest dir and in the other the mount target => circular) – Manwe May 29 '12 at 11:46
  • Okay.. the problem is not the circular reference, but changes inode. I'll edit the question. – Manwe May 30 '12 at 07:52
  • see here. this worked for me https://superuser.com/questions/421663/how-to-force-upperdir-overlayfs-to-reread-reload-lowerdir – wuppi Apr 18 '19 at 12:07