FreeBSD: So you've messed up your /etc/rc.conf
If you’ve messed up your /etc/rc.conf
then there’s a good chance you’re
unable to boot your system and by extension are unable to fix your mistake.
To remedy this the first thing you’ll want to do is boot the system into
‘Single-User’ mode. When you boot in this mode you’re rc.conf
isn’t
evaluated [citation needed].
OK so I can just edit the file now, perfect, done!
Nope.
If you try and edit rc.conf
you’ll be faced with the following error:
$ vi /etc/rc.conf
...
ex/vi Error: /etc/rc.conf: Read-only file system
...
The issue here is that the root file system has been mounted as read-only. You
can see this by running mount
.
$ mount
zroot/ROOT/default on / (..., read-only, ...)
To fix this you’ll need to run the following command:
mount -u /
This mounts root as read / write. You can now edit rc.conf
and fix your mistake.
Once you’ve finished simple run exit
and you’ll start the normal boot process, hurray!