Ever found yourself making mistakes/changes in rc.conf or other configuration files then only to find the server boots up and the file system is read-only with the following message:
Enter full pathname of shell or RETURN for /bin/sh:
Depending of the reason or situation which caused the system to boot up in (s)ingle user mode, a set of simple steps and procedures can aid in the recovery.
- At the prompt, press Enter and run fsck -y to check the file system. The -y option causes fsck to answer yes to all operator questions.
- mount -urw / to remount the root file system in read/write mode.
- mount -a -t ufs to mount the file system where your favorite editor is located
- swapon -a adds the swap device to the system
At this point with the file system checked and mounted, use your editor and correct any problems with configuration files then reboot the server.
For more information on fsck, mount, and swapon, please visit the man page documentation at www.freebsd.org.
What to do if ZFS Boot Environments are used?
If not already in the Single User Mode, please reboot and Enter into the Single User Mode in the Boot Menu, then:
- # adjkerntz -i
- # mount -u /
- # zfs mount -a