Index | Thread | Search

From:
Marc Espie <marc.espie.openbsd@gmail.com>
Subject:
Re: sysupgrade vs NFS
To:
Klemens Nanni <kn@openbsd.org>
Cc:
Miod Vallat <miod@online.fr>, tech@openbsd.org
Date:
Sat, 14 Jun 2025 20:41:09 +0200

Download raw body.

Thread
On Sat, Jun 14, 2025 at 06:28:24PM +0000, Klemens Nanni wrote:
> 14.06.2025 19:24, Miod Vallat пишет:
> > NFS mounts are not available during upgrade, therefore if you
> > don't use the -b option to select something different than
> > /home/_sysupgrade and /home is mounted on NFS, the upgrade fails.
>  
> Aha, here the installer skips NFS completely wrt. DNS concerns.
> 
> Two experiments for more insights:
> 
> 	100.64.73.1:/vm /home nfs rw,nodev,nosuid,soft,intr 0 0
> 
> @@ -2712,7 +2715,6 @@ munge_fstab() {
>  	while read _dev _mp _fstype _opt _rest; do
>  		# Drop irrelevant lines and filesystems.
>  		[[ $_dev == @(/dev/vnd*|\#*) ||
> -			$_fstype == nfs ||
>  			! -f /sbin/mount_$_fstype ||
>  			$_opt == *noauto* ||
>  			$_opt == *xx* ]] && continue
> 
> The function does "mount non-ffs filesystems read only":
> 
> Installing base77.tgz     8% |**                        | 43520 KB    00:42 ETA
> tar: Unable to set file uid/gid of ./home: Read-only file system
> tar: Could not set permissions on ./home: Read-only file system
> tar: Could not set permissions on ./home: Read-only file system
> Installing base77.tgz   100% |**************************|   496 MB    00:39    
> tar: Access/modification time set failed on: /mnt/home: Read-only file system
> Installation of base77.tgz failed. Continue anyway? [no] no
> ^C
> 
> If it weren't for the chmod'ing the directory itself, it'd work
> (at least without DNS);  adding "continue anyway" and "are you *sure*"
> to /auto_upgrade.conf and restarting (A)utoinstall makes it through.
> 
> 
> 
> >From there, I tried these answers interjected between sysupgrade and reboot:
> 
> 	Location of sets = nfs
> 	Server IP address or hostname = 100.64.73.1
> 	Filesystem on server to mount = /vm
> 	Pathname to the sets = /_sysupgrade
> 	Directory does not contain SHA256.sig. Continue without verification = yes
> 
> That did the trick even with read-write mounting the sets dir:
> 
> Location of sets? (disk http nfs or 'done') [http] nfs
> Server IP address or hostname? 100.64.73.1
> Filesystem on server to mount? /vm
> Use TCP transport? (requires TCP-capable NFS server) [no] no
> NFS Portmap: RPC: Port mapper failure - RPC: Unable to send
> Pathname to the sets? (or 'done') [7.7/amd64] /_sysupgrade
> 
> Select sets by entering a set name, a file name pattern or 'all'. De-select
> sets by prepending a '-', e.g.: '-game*'. Selected sets are labelled '[X]'.
>     [X] bsd           [X] comp77.tgz    [X] xbase77.tgz   [X] xserv77.tgz
>     [X] bsd.rd        [X] man77.tgz     [X] xshare77.tgz
>     [X] base77.tgz    [X] game77.tgz    [X] xfont77.tgz
> Set name(s)? (or 'abort' or 'done') [done] done
> Directory does not contain SHA256.sig. Continue without verification? [no] yes
> Installing bsd          100% |**************************| 31312 KB    00:01    
> Installing bsd.rd       100% |**************************|  4685 KB    00:00    
> Installing base77.tgz   100% |**************************|   496 MB    00:37    
> Installing comp77.tgz   100% |**************************| 87512 KB    00:15    
> Installing man77.tgz    100% |**************************|  8272 KB    00:04    
> Installing game77.tgz   100% |**************************|  2752 KB    00:00    
> Installing xbase77.tgz  100% |**************************| 72981 KB    00:07    
> Installing xshare77.tgz 100% |**************************|  4556 KB    00:06    
> Installing xfont77.tgz  100% |**************************| 23021 KB    00:04    
> Installing xserv77.tgz  100% |**************************| 11775 KB    00:01    
> Installing BUILDINFO    100% |**************************|    54       00:00    
> Location of sets? (disk http nfs or 'done') [done] done
> Making all device nodes... done.
> fw_update: add none; update none; keep intel
> Relinking to create unique kernel...uid 0 on /mnt/usr: file system full
> 
> 
> (3G vm.img was to small, hence relink failure, but that's unrelated.)
> 
> 
> Mark, perhaps you want to improve munge_fstab() to allow NFS in certain
> situations?  Or have sysupgrade produce respective answers when the dir
> is on NFS?  Or just roll with a custom file?
> 
> Hope this helps.
> 
> 
1/ My first name is "Marc". Surely you can remember that.
2/ This is quickly turning into a "garage shed" issue. I've been looking
at making it run with NFS, which has its own challenges. We can work on
that together if you choose.

-> in the meantime, preventing sysupgrade from wasting our time seems like
a good idea. Several people seem to agree.

(BTW, detecting nfs efficiently and helping sysupgrade creating a proper
auto update response file will be needed anyway, so why not try to help
in the first step already ? unless you got a full patch to making it work
over nfs already ?...)