The actual message is “/usr/sbin/rsysrc: cannot create /etc/rc.conf: Read-only file system”
I worked quite a bit yesterday discovering the different programs that I use on Linux that I wanted to work on BSD. My reasoning is that if these are there then there’s little keeping me from switching to BSD on at least one of my main desktop computers.
The program that I wanted to install was tuptime. This program will keep an eye on how long the computer has been up along with various statistics involved, such as the longest interval up, longest interval down, etc.
I did the install of the package which is part of the BSD repository. At the end of the install it generated a message indicating that I needed to add a couple of entries to the /etc/rc.conf file.
I added them exactly as the message stated. The problem was that when I exited the editor the remaining message was no longer visible. So, I uninstalled tuptime and then reinstalled it hoping that the installer would display the full message again. It did. So, I made the changes. The change was to add an entry to the crontab file. I edited this no problem.
This morning I was looking at something and decided to remotely reboot the BSD computer.
When I arrived at work this morning I found that “read-only” message spamming across the console.
The job then was, because I am unfamiliar with BSD, to figure out why this happened. My first thought was to reboot yet again (by repeatedly pressing alt+ctl+del). After about 3 times it rebooted. When the menu came up I pressed the ESC key thinking this would stop it. It brought me to a prompt that basically is like the grub prompt in Linux. I couldn’t do anything and didn’t have the patients to jump in and learn the new commands so I rebooted again. I remembered that if I press 2 on the menu it would put me in single user mode.
This worked and I was asked to provide the path to the /bin/sh file. I accepted the default.
I changed into the /etc folder and used nano to edit the rc.conf file. At the bottom of the screen in red nano indicated that the file was read-only. My first thought was how do I remount this as read-write (RW). I did a quick search and found how to do it. I used the defaults when I installed BSD so it uses the ZFS file system. Someone provided the command to get this to mount as RW. I took a snapshot of it with my camera and then typed the command in at the command line.
zfs readonly=off zroot/ROOT/default
As you are the root user in single user mode and because I didn’t change the defaults when I chose to install BSD that above command worked.
At this point I tried real hard to remember which program it was that I had last worked on and I guessed that the issue was with the /etc/rc.conf. I thought for a while and realized that it was the tuptime command that I’d installed the night before.
I edited the /etc/rc.conf file and commented two lines out.
#sysrc tuptime_enable=YES
#service tuptime start
I then rebooted.
The computer began to boot and showed me the normal startup process and finally presented me with the SDDM greeter login prompt. I logged in and was at the desktop again.
This was the solution. I don’t know why having either of those two commands in the /etc/rc.conf file would cause BSD to fail to load completely spamming me with the message about the read-only file system.
I know how to resolve it so I will experiment some to see if I can overcome this and make tuptime work. Bear in mind that this should never happen to any operating system. No edits of a config file should stop it from booting in some way. The idea that a couple of entries in a config file that do not execute anything would cause the whole computer to fail to boot and instead drop to a read-only mode and spam the console is ludicrous.