Upon booting my BSD system, I encountered repeated error messages indicating that the file system is read-only. The specific message displayed was: “/usr/sbin/rsysrc: cannot create /etc/rc.conf: Read-only file system.”
Yesterday, I spent considerable time exploring programs I use on Linux to see if they could function on BSD. My goal was to determine if BSD could replace Linux on at least one of my main desktop computers, provided the necessary tools were available. One such program I wanted to install was tuptime, which tracks system uptime and provides statistics like the longest uptime, longest downtime, and other related metrics.
I installed tuptime from the BSD repository. At the end of the installation, a message instructed me to add a couple of entries to the /etc/rc.conf
file. I followed the instructions precisely, but after exiting the editor, the full message was no longer visible. To retrieve it, I uninstalled and reinstalled tuptime, hoping the installer would display the instructions again. It did, and I made the required changes, which also included adding an entry to the crontab file. Editing the crontab posed no issues.
This morning, I remotely rebooted the BSD computer. Upon arriving at work, I noticed the “read-only” error message repeatedly appearing on the console. Unfamiliar with BSD, I set out to understand why this occurred. My initial approach was to reboot again by pressing Alt+Ctrl+Del multiple times. After about three attempts, it rebooted. When the boot menu appeared, I pressed the ESC key, expecting it to halt the process. Instead, it brought me to a prompt similar to the GRUB prompt in Linux. Lacking the patience to learn new commands at that moment, I rebooted again. I then recalled that selecting option 2 from the menu would boot into single-user mode.
This worked, and I was prompted to provide the path to the /bin/sh
file, accepting the default. I navigated to the /etc
directory and used nano
to edit the rc.conf
file. However, nano
displayed a red message at the bottom indicating the file was read-only. My first thought was to remount the file system as read-write (RW). After a quick search, I found a solution. Since I used the default settings during BSD installation, my system uses the ZFS file system. A helpful resource provided the command to remount as RW. I took a snapshot of it with my camera and entered the following command at the prompt:
zfs readonly=off zroot/ROOT/default
As I was in single-user mode (with root privileges) and hadn’t altered the default installation settings, the command executed successfully. I then tried to recall which program I had last worked on that might have caused this issue. I suspected it was related to the /etc/rc.conf
file and eventually remembered that it was the tuptime installation from the previous night.
I edited the /etc/rc.conf
file again and commented out the following two lines:
#sysrc tuptime_enable=YES
#service tuptime start
After saving the changes, I rebooted the system. The computer started normally, displaying the usual startup process, and eventually presented the SDDM greeter login screen. I logged in and reached the desktop successfully.
This resolved the issue, though I remain puzzled as to why those two entries in /etc/rc.conf
caused BSD to fail to boot properly, instead spamming the console with read-only file system errors. I know how to address this now and plan to experiment further to see if I can make tuptime work correctly. However, I find it concerning that this happened at all. No operating system should fail to boot due to simple edits in a configuration file, especially when those entries do not execute any commands. The notion that a couple of lines in a config file could cause the entire system to drop into a read-only state and spam error messages on the console is, frankly, absurd.
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.