Most of the commands you need to repair a system in single-user mode have rescue equivalents. If that fails, try the rescue version of the ed editor: /rescue/ed /etc/rc.conf As another example, if the single-user mode shell cannot open the vi command and you need to edit rc.conf, try this: /rescue/vi /etc/rc.conf This means that if a system in single-user mode is too damaged to enter the Bourne shell, you can type: /rescue/sh Since it is possible that the base utilities themselves (such as sh, mount, or vi) could become corrupt, FreeBSD provides a /rescue directory containing statically linked versions of these utilities. If your changes were successful, the system will continue to boot into normal operation. You should now be able to make any configuration file edits as well as use any other utilities needed to investigate and fix the problem. Rerunning the mount command should show that all of the filesystems–including zroot/var, zroot/tmp, and zroot/usr–are mounted as read-write. Then, mount all of the filesystems: # zfs mount -a To remedy this, unset the read-only property on the specified pool: # zfs set read-only=off zroot This means if I try a command such as vi /etc/rc.conf, I’ll receive “read-only file system” errors. In this example, only the root dataset of the zroot pool is mounted, and it is mounted as read-only. Zroot/ROOT/default on / (zfs, local, noatime, read-only, nfsv4acls) ![]() ![]() Next, see if your OpenZFS pools are mounted: # mount If you get a # prompt, you’re now in the Bourne ( /bin/sh) shell. While that sounds rather dire, this mode provides the tools needed to repair whatever is preventing the system from completing the booting process. In this mode, there is only one user (the superuser) and no authentication, no networking or running daemons, and most filesystems are unmounted. If a system starts to boot normally but stops with this prompt after probing the disks, you’re in single-user mode: Enter full pathname of shell or RETURN for /bin/sh: Let’s take a look at some common recovery scenarios. ![]() And if you’re using OpenZFS, you can rest assured that your data is intact. Barring a truly catastrophic hardware failure, it is possible to quickly recover from most scenarios that prevent a system from booting into normal operation. But there you are, staring at single-user mode, or worse, the boot loader prompt thinking “what now?”.įortunately, FreeBSD and its built-in rescue mechanisms have you covered. Maybe you’re wondering if you fumble-fingered a typo when you made that last change to nf. Perhaps there was a glitch with an upgrade. We’ve all been there: that moment of panic when a system fails to boot back up.
0 Comments
Leave a Reply. |