Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on an read-only root #13

Open
chengjianwen opened this issue Nov 12, 2020 · 6 comments
Open

on an read-only root #13

chengjianwen opened this issue Nov 12, 2020 · 6 comments

Comments

@chengjianwen
Copy link

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.

@chesty
Copy link
Owner

chesty commented Nov 14, 2020

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?

@chengjianwen
Copy link
Author

It is mounted on ${rootmnt} already.
It seems the script want to move the mount point to another directory (/overlay/lower), but failed.

@chesty
Copy link
Owner

chesty commented Nov 16, 2020

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.

@chengjianwen
Copy link
Author

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.

@chengjianwen
Copy link
Author

mount -o move worked, and mount -t overlay overlay ..... failed.

@chesty
Copy link
Owner

chesty commented Nov 16, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants