How can I disable overlayroot via ssh?

I have a remote computer protected with overlayroot. Currently, I write "overlayroot=disabled" in grub boot to disable it until it is rebooted, but sometimes I want to make changes using SSH. Is there a way to disable overlayroot remotely?

2

2 Answers

You can run overlayroot-chroot to remount the root as rw, or bind-mount the lowerdir elsewhere as rw with something like mount --bind <lowerdir> /mnt/rootrw and modify on /mnt/rootrw (potentially chrooting to it if needed).

Check the link @Melebius gave, it (at least partially) answers the question.

4

My solution to this is as follows. It involves several reboots to bring the system up rw then back to ro once again.

  1. SSH into the system and enter a rw chroot via the following command:sudo overlayroot-chroot
  2. Modify the /etc/overlayroot.local.conf (docs mention that you should create a .local. rather than the default overlayroot.conf file to avoid conflict if overlayroot package ever gets updated.) overlayroot=""
  3. Reboot, system is now mounted rw, make changes to system. edit /etc/overlayroot.local.conf overlayroot= line back to the enabled value (in my case: overlayroot="tmpfs:swap=1,recurse=0").
  4. Reboot again, system is once again read-only.
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like