I have no idea when I wrote this. It got saved but never published, until today.
I recently had the boot drive at one of my servers change. It’s really a VM on a box, but at least it’s running FreeBSD. To fix it, I got a VNC session going to their server, and was greeted by the prompt:
mountroot> ? List of GEMO managed disk devices: ufsid/48ee594bdcbf83e3 ufsid/48dd594bad4c1d6f ufsif/48ee594b514a21e1 ufsid/48ee594b75a0ff85 acd0 ad1s1f ad1s1e ad1s1d ad1s1c ad1s1b ad1s1a ad1s1 ad1 Manual root filesystem specification: <fstype>:<device> Mount <device> using filesystem <fstype> eg. ufs:da0s1a ? List valid disk boot devices <empty line> Abort manual input mountroot> ufs:ad1s1a Trying to mount root from ufs:ad1s1a Enter full pathname of shell or RETURN for /bin/sh:
As you can see, I entered ufs:ad1s1a. The system had been booting off ad0, as you will see below. It now needed to boot off ad1. I needed to update /etc/fstab, but that takes a little while to get to.
/ was mounted read-only so I mounted it with write access:
mount -w /dev/ad1s1a /
Fail. Still readonly.
I tried:
mount -fuo rw /
Still readonly.
Next I tried:
fsck /
Then this worked:
mount -fuo rw /
To get vi (at /usr/bin/vi) I needed this mounted:
mount /dev/ad1s1f /usr
I did this so vi has a tmp directory:
mount /dev/ad1s1e /tmp
When starting vi, you should ignore messages about vi.recover.
Then I ran this command and changed ad1 to ad0 everywhere:
vi /etc/fstab
Then I issued a reboot and everything was great.