5

OpenWrt uses overlayfs

# mount | grep overlay
/dev/ubi0_2 on /overlay type ubifs (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)

Somehow real lowerdir is /rom

# mount | grep rom
mtd:ubi_rootfs on /rom type squashfs (ro,relatime)

How to restore file to make it the as in /rom? Remove records from overlays: whiteouts and opaque dirs.

Workaround

cp /rom/path/to/file /overlay/upper/path/to/file
kyb
  • 7,233
  • 5
  • 52
  • 105
  • Similar question but about AUFS https://unix.stackexchange.com/questions/92287/aufs-whiteout-removal. – kyb Sep 10 '19 at 10:33

1 Answers1

9

Remove file from /overlay/upper, and then remount rootfs.

rm /overlay/upper/my/file
mount -o remount /
kyb
  • 7,233
  • 5
  • 52
  • 105