On Sun, Sep 20, 2020 at 01:19:17AM -0400, Predrag Punosevac wrote: > > Hi Misc, > > For number of years I had a very simple scheme to backup my OpenBSD > infrastructure servers running critical network services for our small > university lab. Namely, I would put a low profile usb flash drive and > use /altroot facility in the daily(8) scripts to backup root partition > to it as described in FAQ > > https://www.openbsd.org/faq/faq14.html#altroot > > I started doing that many years ago, before sysupgrade was available. It > worked like a charm. Once sysupgrade became available I noticed that it > would get confused by an extra disk in the server. My "solution" was to > remove usb drive before running sysupgrade and that worked OK until > Covid 19 when the physical access to my servers became more challenging. > > I had a quick look at the sysupgrade.sh script > > http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/sysupgrade/sysupgrade.sh?rev=1.40&content-type=text/x-cvsweb-markup > > and I have to admit that it is not clear to me how the target disk for > the installation is picked. I completely understand that sysupgrade is > designed not to be configurable in order to be foolproof.
http://cvsweb.openbsd.org/src/distrib/miniroot/install.sub?rev=1.1154&content-type=text/x-cvsweb-markup Specifically check_unattendedupgrade(). The installer tries to guess what a root disk is ( get_dkdevs_root -> is_rootdisk ). Your altroot disk will naturally look like a root disk, that's the whole point of the facility after all. The installer will pick the first disk that looks like a root disk. If there is no auto_upgrade.conf present it will stop. I'm surprised that your usb stick shows up as the first disk in the installer but computers are weird I guess. I have a diff that might improve on this and that might make 6.8. -- I'm not entirely sure you are real.