As a longer example showing the problem.
Here's booting the VM to single-user mode.
Showing "mount /" runs without error.
Show the current disklabel duid and fstab match.
Backup the disklabel and show it.
Restore the disklabel (without any edits to it).
Show that "mount /" now reports error.
Show that disklabel duid and fstab no longer match.
This is a simplified demostration to show the issue.
Normally fstab has many entries and "mount -a"
would produce many errors, with few things mounted.
I agree rstoring disklabels is not a common task,
usually only done during recovery or after an oops.
FYI: I was doing it to reorder my partition letter
assignments (which was successful), I just wasn't
expecting the duid to change and hate to admit it
that it took me longer than it should have to realize
out why my mounts were failing. Didn't help that
my OOB (HP iLo textcons) wasn't letting me copy/paste
the duid numbers when I needed to edit fstab.
All is well on my server again, no data lost,
just my downtime window was longer than planned.
Yes I saw earlier posts about disklabel not calculating
numbers correctly (due to be fixed in 7.8), I
hand verified all numbers during my partition
edits and did not have any problems with overlap.
Play it again Puffy...
$ vmctl start -c puffy
Connected to /dev/ttyp1 (speed 115200)
Using drive 0, partition 3.
Loading......
probing: pc0 com0 mem[638K 1022M a20=on]
disk: hd0+
>> OpenBSD/amd64 BOOT 3.67
com0: 115200 baud
switching console to com0
>> OpenBSD/amd64 BOOT 3.67
boot> boot /bsd -s
booting hd0a:/bsd: 22112213+4670480+449712+0+1351680
[1958690+128+1499280+1192779]=0x1fb3b88
entry point at 0xffffffff81001000
[ using 4651912 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
Copyright (c) 1995-2025 OpenBSD. All rights reserved. https://www.OpenBSD.org
OpenBSD 7.7 (GENERIC) #2: Sun Jun 29 09:03:32 MDT 2025
[email protected]:/usr/src/sys/arch/amd64/compile/GENERIC
real mem = 1056940032 (1007MB)
avail mem = 998739968 (952MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xf2760 (10 entries)
bios0: vendor SeaBIOS version "1.16.3p0-OpenBSD-vmm" date 01/01/2011
bios0: OpenBSD VMM
acpi at bios0 not configured
cpu0 at mainbus0: (uniprocessor)
cpu0: Intel(R) Xeon(R) CPU L5640 @ 2.27GHz, 2266.72 MHz, 06-2c-02
cpu0: cpuid 1
edx=78ba97f<FPU,VME,DE,PSE,TSC,MSR,PAE,CX8,SEP,PGE,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2>
ecx=82982203<SSE3,PCLMUL,SSSE3,CX16,SSE4.1,SSE4.2,POPCNT,AES,HV>
cpu0: cpuid 80000001 edx=24100800<NXE,PAGE1GB,LONG> ecx=1<LAHF>
cpu0: cpuid 80000007 edx=100<ITSC>
cpu0: MELTDOWN
cpu0: 32KB 64b/line 8-way D-cache, 32KB 64b/line 4-way I-cache, 256KB 64b/line
8-way L2 cache, 12MB 64b/line 16-way L3 cache
cpu0: smt 0, core 0, package 0
cpu0: using IvyBridge MDS workaround
pvbus0 at mainbus0: OpenBSD
pvclock0 at pvbus0
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "OpenBSD VMM Host" rev 0x00
virtio0 at pci0 dev 1 function 0 "Qumranet Virtio RNG" rev 0x00
viornd0 at virtio0
virtio0: irq 3
virtio1 at pci0 dev 2 function 0 "Qumranet Virtio Network" rev 0x00
vio0 at virtio1: 1 queue, address fe:e1:bb:d1:a3:16
virtio1: irq 5
virtio2 at pci0 dev 3 function 0 "Qumranet Virtio Storage" rev 0x00
vioblk0 at virtio2
virtio2: irq 6
scsibus1 at vioblk0: 1 targets
sd0 at scsibus1 targ 0 lun 0: <VirtIO, Block Device, >
sd0: 2047MB, 512 bytes/sector, 4192256 sectors
virtio3 at pci0 dev 4 function 0 "Qumranet Virtio SCSI" rev 0x00
vioscsi0 at virtio3: qsize 128
virtio3: irq 7
scsibus2 at vioscsi0: 1 targets
cd0 at scsibus2 targ 0 lun 0: <OpenBSD, VMM CD-ROM, 001> removable
virtio4 at pci0 dev 5 function 0 "OpenBSD VMM Control" rev 0x00
vmmci0 at virtio4
virtio4: irq 9
isa0 at mainbus0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns8250, no fifo
com0: console
vscsi0 at root
scsibus3 at vscsi0: 256 targets
softraid0 at root
scsibus4 at softraid0: 256 targets
root on sd0a (56efeb3881f66210.a) swap on sd0b dump on sd0b
Enter pathname of shell or RETURN for sh:
/#
/# cd /tmp
/tmp# mount /
/tmp# disklabel sd0 | grep duid
duid: 56efeb3881f66210
/tmp# cat /etc/fstab
56efeb3881f66210.b none swap sw
56efeb3881f66210.a / ffs rw,noatime,wxallowed 1 1
/tmp# mount /
/tmp#
/tmp# disklabel sd0 > protofile
/tmp# cat protofile
# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: Block Device
duid: 56efeb3881f66210
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 64
sectors/cylinder: 4032
cylinders: 1039
total sectors: 4192256
boundstart: 64
boundend: 4192256
16 partitions:
# size offset fstype [fsize bsize cpg]
a: 4052256 64 4.2BSD 2048 16384 12960 # /
b: 139936 4052320 swap # none
c: 4192256 0 unused
/tmp# disklabel -R sd0 protofile
/tmp#
/tmp# mount /
mount_ffs: 56efeb3881f66210.a on /: No such file or directory
/tmp# disklabel sd0 | grep duid
duid: 140468d54fbe65cb
/tmp# cat /etc/fstab
56efeb3881f66210.b none swap sw
56efeb3881f66210.a / ffs rw,noatime,wxallowed 1 1
/tmp# mount /
mount_ffs: 56efeb3881f66210.a on /: No such file or directory
/tmp#