Is single user mode still required when installing world?

Hello again,

The official handbook does not mention single user mode (anymore?), however `/usr/src/UPDATING` contains below steps.

Code:
    <make sure you have good level 0 dumps>
    make buildworld
    make buildkernel KERNCONF=YOUR_KERNEL_HERE
    make installkernel KERNCONF=YOUR_KERNEL_HERE
                            [1]
    <reboot in single user>                [3]
    mergemaster -Fp                    [5]
    make installworld
    mergemaster -Fi                    [4]
    make delete-old                    [6]
    <reboot>

Also, according to Michael W. Lucas we should use single user mode.

Which source to trust? I did install a few times now in multi user mode, but this doesn't help too much. I tried install world in single mode and it failed for me (I ran only `zfs mount -a`).

Handbook: https://www.freebsd.org/doc/en/books/handbook/makeworld.html

Thank you in advance.
 
I can only share my (failed) experience. I have been building the kernel successfully in normal mode, but then when trying to build world in normal mode it always failed.
To be honest, I never dug into it and tried single user mode. I just switched to binary packages and freebsd-update because building the ports took forever even on my 16 core Threadripper. Since then I build only kernel and the rest I update binarily, it's fast and works great.
 
Single-user mode makes sure nobody uses the machine, so that's the "safest" option. Of course you still need to make sure your system filesystem is writable, which isn't the default in single-user mode -- on ZFS, do zfs set readonly=false zroot (assuming your root pool is named zroot) for that.

That said, I never used single-user mode for updates. The risk is pretty small -- it's very unlikely to affect running processes. It could affect the sessions of users that are logged in, temporarily behaving erroneously. Of course, if you have a busy system with many users, you should opt for booting to single-user, after sending out notice about maintenance downtime :)
 
I can only share my (failed) experience. I have been building the kernel successfully in normal mode, but then when trying to build world in normal mode it always failed.
To be honest, I never dug into it and tried single user mode. I just switched to binary packages and freebsd-update because building the ports took forever even on my 16 core Threadripper. Since then I build only kernel and the rest I update binarily, it's fast and works great.
Building ports? I don't think building world rebuilds the ports too. In any case, I tried yesterday and it took ~35min. That said, I do upgrade packages through pkg upgrade with latest instead of quarterly, although I am trying to keep the host with minimal installed packages and use jails for anything extra (e.g. a samba machine). Thanks for sharing.

Single-user mode makes sure nobody uses the machine, so that's the "safest" option. Of course you still need to make sure your system filesystem is writable, which isn't the default in single-user mode -- on ZFS, do zfs set readonly=false zroot (assuming your root pool is named zroot) for that.

That said, I never used single-user mode for updates. The risk is pretty small -- it's very unlikely to affect running processes. It could affect the sessions of users that are logged in, temporarily behaving erroneously. Of course, if you have a busy system with many users, you should opt for booting to single-user, after sending out notice about maintenance downtime :)
I thought I am missing something. I found that later ( readonly=false), but was not sure if it's enough. I will try next time. Thanks.

Btw, according to the Absolute FreeBSD book, single-user is a must
You can have conflicts where vital programs won’t run when installed in multiuser mode. This is rare, but if it happens with /bin/sh, you’re in a world of hurt.
...
Running in multiuser mode can cause other upgrade problems, such as subtle races, symbol issues, and innumerable other headaches.
...
It’s perfectly safe to build your new world in multiuser mode. You can even build and install your new kernel in multiuser mode. Once you start installing the userland, however, you must be in single-user mode and running on your upgraded kernel.
...
 
There's only been one upgrade when you really needed to boot the new kernel first before installing world. This was when FreeBSD 5.0 was released and FreeBSD switched to UFS2. That's the only time when it was absolutely necessary or you ended up with a completely broken system. Since then I never reboot, only when I was completely done at the end of the upgrade/update procedure. Never had any problems with that. The handbook just gives you the absolute safest way to do it.
 
There's only been one upgrade when you really needed to boot the new kernel first before installing world. This was when FreeBSD 5.0 was released and FreeBSD switched to UFS2. That's the only time when it was absolutely necessary or you ended up with a completely broken system. Since then I never reboot, only when I was completely done at the end of the upgrade/update procedure. Never had any problems with that. The handbook just gives you the absolute safest way to do it.

So you are saying I could just do cd /usr/src && make update && make buildworld && make kernel && make installworld && mergemaster -Fi ? :)
 
We've been running FreeBSD since version 2.8. Our standard procedure over the years has been to install world in single user mode when doing major version upgrades (11.3->12.1) and stay in multi-user mode on minor version upgrades (11.2->11.3). The only exception to this procedure, as SirDice noted above, was the 5.x release cycle.
 
So you are saying I could just do cd /usr/src && make update && make buildworld && make kernel && make installworld && mergemaster -Fi ?
I normally use mergemaster -U, but yes, that's what I do and have been doing since I started with FreeBSD (around the 3.0 era). This only bit me once, during the aformentioned upgrade to FreeBSD 5.0. I screwed that one up because I read /usr/src/UPDATING after the upgrade utterly failed on me. So, make sure to read /usr/src/UPDATING before you attempt to upgrade.
 
Back
Top