# make installworld and single-user mode



## getopt (Nov 8, 2014)

When it comes to `make installworld` this should be done in single-user mode. In Absolute FreeBSD 2nd Ed. (M.W.Lucas 2008, p. 395f.) can be read


> some lowlevel changes in the system require the install in the single-user mode.


I’d like to ask what these lowlevel changes might be and when they occur. Can one know about such changes before upgrading?

There are situations, when a system should be upgraded with the help of an NFS server providing sources and builds. Can installworld then be done in single-user mode too?

And what about remote upgrades? How to do that regarding single-user mode?


----------



## Deever (Nov 8, 2014)

I'd be interested in this, too. From what I have heard so far, this is because in multi-user mode (or network mode), you would overwrite things already running and then would have to reboot again for the sake of proper function. So you sa_v_e one reboot with it. `make installworld` in multi-user mode, if you really insist on it, is probably better done after `make installkernel` and right before the reboot.


----------



## scottro (Nov 8, 2014)

Have you ever seen wblock@'s page on building world?  He comments that it usually isn't necessary.  I've been following his method from 9.2 (I think) and up, and haven't run into a problem.  Keep in mind that Mike Lucas' book is a few years old now, and things have probably changed. 

http://www.wonkity.com/~wblock/docs/html/buildworld.html


----------



## wblock@ (Nov 8, 2014)

It surely varies depending on the situation.  I can't remember the last time I used single-user for installworld, though.


----------



## kpa (Nov 8, 2014)

One very obvious case is when you're running the system in a non-default securelevel(7), it's not possible to overwrite system binaries that have the schg flag turned on in such a case. I would say that when doing a minor upgrade to a newer minor version you can pretty safely do `make installworld` without using single user mode. Major version upgrades might be a different story though. Installing new binaries of a higher major version while you're still on the earlier kernel may prevent a clean shutdown after the installation and something might go wrong.

I have done single user mode updates/upgrades using the sources and objects (/usr/src and /usr/obj) on an NFS server. You just need to start the bare essential services on the client and mount the NFS shares and away you go. Something like (starting from the point when the single user mode starts):


```
/sbin/adjkerntz -i
/sbin/mount -a -t ufs

/usr/sbin/service syscons start
/usr/sbin/service netif start rl0
/usr/sbin/service nfsclient start

/sbin/mount /usr/src
/sbin/mount /usr/obj
```

Those were extracted from a script I use, hence the full paths to everything. The last two commands need /etc/fstab entries for the NFS shares to exist.


----------



## gkontos (Nov 8, 2014)

I think that the last time I used single user mode for `make installworld` was back during FreeBSD 6.X.


----------



## xtaz (Nov 8, 2014)

Ever since I started using FreeBSD back on version 4.1 I have always done minor version upgrades in full multi-user mode whilst the server is still working with a quick two-minute reboot and never had a single issue with this. The only time I do the official single-user mode upgrade is when I do a major version upgrade just to be on the safe side. Though now there are much smaller differences between major versions than there used to be in the older days even this might not be completely necessary.


----------



## grahamperrin@ (Jan 14, 2022)

rigoletto@ said:


> … advised to reboot in single user (or at least drop to it) before installing world.





jbodenmann said:


> Can you provide a bit more information on this subject? What's the reasoning behind this?



In addition to what's above: 

From System updates/upgrades: single user mode, and chroot approaches … org.freebsd.freebsd-questions - MarkMail (2021-03-01), quoting Garance A Drosehn: 



> It may happen to work for you many times in a row, until the day it does not work and then you're screwed.  The official instructions state that you should always reboot into single-user mode before doing `make installworld`.
> 
> The instructions are what they are based on a lot of experience. …
> 
> ...



I don't doubt that things have been trouble-free for the vast majority of people who have intentionally, or unintentionally, *skipped* the single user mode aspect (for _major_ upgrades in particular) 


For what it's worth, I err on the side of caution. 

The few steps in single user mode don't make things unreasonably complex. Since I learnt to habitually include these steps for every (minor) update from source: on the very rare occasion when a major upgrade will be required, I'll be in the swing of things. 

HTH


----------



## SirDice (Jan 14, 2022)

grahamperrin Can you please stop necroposting really old threads?


----------



## grahamperrin@ (Jan 14, 2022)

OK, please spin it off to a new topic with the same subject. Thanks.


----------

