-1

I have installed the latest version (11 Jan 2021) of Raspbian Buster OS on my Pi 4. I changed the network manager from default to nmcli (network-manager network-manager-gnome are the packages I installed). It worked fine as it stored the WiFi connections to /etc/NetworkManager/system-connections/.

Now I made the system read-only and only allowed /tmp to be read-write plus an external disk to avoid any corruptions.

After switching to read-only the WiFi gets connected but it is not saved. On reboot I have to enter the password and SSID again. It is not getting stored in the /etc/NetworkManager/system-connections/ anymore.

Readonly.sh <- This is the sh file I run to convert the Pi to read-only.

Please help me fix this, I have very little knowledge of Linux.

EDIT: I am using a switch command that remounts the system in read write mode. If you follow the shared link of the link I have shared, you'll find it's making an alias rw to switch to read write mode during runtime. I use this command before adding the new WiFi.

Before using the nmcli, I used the default WiFi network manager that comes with the Raspbian Buster OS. It writes in the wpa_supplicant.conf file which works perfectly when I run rw.

3 Answers 3

1

It has done exactly what you told it to do not allow any writing to the sd card. There is no other result that can be expected, anything entered and accepted is only contained in the memory of the machine not on the read only card. The fix is to not make it read only.

2
  • Hey, I have edited the question to include the details of the system's ability to convert to read write mode. I use this command to first make the system writeable and then try to add the WiFi. Also, the error is not system unable to write due to read-only system, it is that no plugin supported this action. This means that the read-only sh file is removing something that is making the system unable to save new WiFis. I am trying to understand that. Feb 24, 2021 at 6:03
  • Indeed it is doing that, good luck tracking it down. Reading scripts like that and understanding their intent can be just a little difficult at times.
    – user130167
    Feb 24, 2021 at 6:23
1

Run your rw alias, and then create a test file, e.g. touch ~/testfile. Then reboot and check if the test file is still there.

If there is no test file, your rw command is not working as expected, otherwise you have a problem with NetworkManager. In the latter case you could try to purge it (remove the package and the config files), install it again, and configure the network from scratch.

0

I ran into the same issue. I managed to get it working using the following solution:

  1. Mount /var/lib/NetworkManager as a tmpfs
  2. Before using the NetworkManager clients, do: mount -o remount,rw / ; systemctl restart NetworkManager; sleep 0.3; mount -o remount,ro /

After that, it was just a matter of mount -o remount,rw before a change and mount -o remount,ro when done

In my case I needed the root-ro for system longevity reasons (avoiding flash corruption). I could not use overlayfs because of the need to regularly switch to rw mode to store some things persistently. I used the same technique as the originals poster.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.