overlayroot
overlayroot copied to clipboard
on an read-only root
My pi boot by nfs from a piserver, and I want to use overlayroot to set root writable. I succeed on the os from piserver (kernel version: 4.19.97-v7+), but failed on the latest raspberry pi os (kernel version: 5.4.51-v7l+). I set debug option on cmdline.txt to see the initramfs debug, and found the error occurred on init-bottom-overlay script from line 64: mount -t overlay overlay -olowerdir=/overlay/lower,upperdir=/overlay/upper,workdir=/overlay/work ${rootmnt} mount: mount overlay on /root failed: No such device. cp: can't stat '/root/etc/fstab': No such file or directory. /script/init-bottom/init-bottom-overlay: line 71: can't create /root/etc/fstab: nonexistent directory. /script/init-bottom/init-bottom-overlay: line 72: can't create /root/etc/fstab: nonexistent directory.
It drops you into a busybox shell? The only thing I can suggest is to look around and find where the read-only nfs root is mounted, if it's mounted, maybe it's not mounted yet?
It is mounted on ${rootmnt} already. It seems the script want to move the mount point to another directory (/overlay/lower), but failed.
oh, because it's read-only. You'll need to comment out lines 70, 71 and 72. They are trying to write to ${rootmnt}
edit: no, that's not it. I guess you'll have to look into why moving the mount point doesn't work, or maybe you can modify the script so it doesn't need to move it.
I think the problem was line 64: mount -t overlay overlay -olowerdir=/overlay/lower,upperdir=/overlay/upper,workdir=/overlay/work ${rootmnt} error msg: mount: mounting overlay on /root failed: no such device.
mount -o move worked, and mount -t overlay overlay ..... failed.
If you want help you need to give move information. xxx failed isn't enough. what is the exact command you ran and what is the exact error message.