the system doesn't boot.
this other problem of the system not booting.
FreeBSD bug 255318 – handbook: Document how to update the bootloader – there's a moderated how-to.
the system doesn't boot.
this other problem of the system not booting.
That's good advice. smartd(8) is a must for any system you care about. It's going to tell you about all sorts of developing disk problems, and is dead easy to configure. One line is usually enough in /usr/local/etc/smart.conf. Here's mine:zfs won't notify you until something (a device) actually breaks, you can however use smartd to monitor disk status using like netdata (I like it becasue its easy to setup) or another system monitoring software.
DEVICESCAN -a -o on -S on -n standby,q -s (S/../.././02|L/../../6/03) -W 4,50,55 -m alerts@mailhost
Our posts crossed.
My ZFS zroots are all small, and on mirrors, with boot blocks on each disk. So I have no direct experience of your situation.
Knowing the status of the zroot pool is important. You need to know if it's seriously damaged.
You also need to verify that your service provider actually replaced ada0.
I'd boot from the rescue media. Have a look atzpool status zroot
.
Is ada0 "OFFLINE"? Are all the other disks "ONLINE"? If not, stop, and re-consider.
Assuming ada0 has been replaced, you are going to need to put a gpt label on it. Assuming that they all disks all the same:Code:gpart show # check the partitions, especially the freebsd-boot partition number -- assuming 1 below) gpart destroy -F ada0 gpart backup ada1 | gpart restore -F ada0 gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
If it still won't boot from ada0, try switching to ada1 in the BIOS (ada1 might need bootcode installed).
If you do manage to boot, pause and prepare a plan for the re-silvering.
There's plenty of expertise on this list. They just need a chance to respond.
Good stuff. I was trying to avoid too much complication. And I did say:Perhaps the server is using UEFI-boot? Then a different bootblock should be used...
I've written a shell script that checks (and optionally reinstalls) the bootblocks that you might find useful:
gpart show # check the partitions, especially the freebsd-boot partition number -- assuming 1 below
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i $P "$DEV"
… To update old ESP partitions, users should stop using the gpart(8) utility. Instead, …
zpool import -R /mnt zroot
[root@rescue ~]# zfs list
NAME USED AVAIL REFER MOUNTPOINT
zroot 14.5T 750G 128K none
zroot/ROOT 215G 750G 128K none
zroot/ROOT/default 215G 750G 215G /mnt
zroot/files 14.2T 750G 14.2T /mnt/files
zroot/tmp 12.7G 750G 12.7G /mnt/tmp
zroot/usr 13.1G 750G 151K /mnt/usr
zroot/usr/home 10.7G 750G 10.7G /mnt/usr/home
zroot/usr/ports 2.36G 750G 2.36G /mnt/usr/ports
zroot/usr/src 128K 750G 128K /mnt/usr/src
zroot/var 34.2G 750G 128K /mnt/var
zroot/var/audit 10.1G 750G 10.1G /mnt/var/audit
zroot/var/crash 21.0G 750G 21.0G /mnt/var/crash
zroot/var/log 1.57G 750G 1.57G /mnt/var/log
zroot/var/mail 1.53G 750G 1.53G /mnt/var/mail
zroot/var/tmp 15.3M 750G 15.3M /mnt/var/tmp
[root@rescue ~]# gpart show
=> 40 11721045088 ada0 GPT (5.5T)
40 1024 1 freebsd-boot (512K)
1064 984 - free - (492K)
2048 83886080 2 freebsd-swap (40G)
83888128 11637155840 3 freebsd-zfs (5.4T)
11721043968 1160 - free - (580K)
=> 40 11721045088 diskid/DISK-Y7QOK01AFTTB GPT (5.5T)
40 1024 1 freebsd-boot (512K)
1064 984 - free - (492K)
2048 83886080 2 freebsd-swap (40G)
83888128 11637155840 3 freebsd-zfs (5.4T)
11721043968 1160 - free - (580K)
=> 40 11721045088 ada1 GPT (5.5T)
40 1024 1 freebsd-boot (512K)
1064 984 - free - (492K)
2048 83886080 2 freebsd-swap (40G)
83888128 11637155840 3 freebsd-zfs (5.4T)
11721043968 1160 - free - (580K)
=> 40 11721045088 ada2 GPT (5.5T)
40 1024 1 freebsd-boot (512K)
1064 984 - free - (492K)
2048 83886080 2 freebsd-swap (40G)
83888128 11637155840 3 freebsd-zfs (5.4T)
11721043968 1160 - free - (580K)
=> 40 11721045088 ada3 GPT (5.5T)
40 1024 1 freebsd-boot (512K)
1064 984 - free - (492K)
2048 83886080 2 freebsd-swap (40G)
83888128 11637155840 3 freebsd-zfs (5.4T)
11721043968 1160 - free - (580K)
[root@rescue ~]#
zpool status
say? Also ls -lad /dev/ada? /dev/diskid/DISK-Y7QOK01AFTTB
.for disk in 0 1 2 3
do
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 /dev/ada${disk}
done
[root@rescue ~]# zpool status
pool: zroot
state: DEGRADED
status: One or more devices has been taken offline by the administrator.
Sufficient replicas exist for the pool to continue functioning in a
degraded state.
action: Online the device using 'zpool online' or replace the device with
'zpool replace'.
scan: scrub repaired 0B in 1 days 11:34:35 with 0 errors on Wed Feb 16 22:24:04 2022
config:
NAME STATE READ WRITE CKSUM
zroot DEGRADED 0 0 0
raidz1-0 DEGRADED 0 0 0
ada0p3 OFFLINE 0 0 0
ada1p3 ONLINE 0 0 0
ada2p3 ONLINE 0 0 0
ada3p3 ONLINE 0 0 0
errors: No known data errors
[root@rescue ~]#
[root@rescue ~]# dmesg | grep Y7QOK01
ada0: Serial Number Y7QOK01AFTTB
ada0: Serial Number Y7QOK01AFTTB
[root@rescue ~]# ls -lad /dev/ada? /dev/diskid/DISK-Y7QOK01AFTTB
crw-r----- 1 root operator 0x70 Feb 17 16:47 /dev/ada0
crw-r----- 1 root operator 0x7a Feb 17 16:47 /dev/ada1
crw-r----- 1 root operator 0x7c Feb 17 16:47 /dev/ada2
crw-r----- 1 root operator 0x7e Feb 17 16:47 /dev/ada3
crw-r----- 1 root operator 0x78 Feb 17 16:47 /dev/diskid/DISK-Y7QOK01AFTTB
[root@rescue ~]#
zfs-stats -E
will give relevant data about a.o. the hit & miss ratio of the MFU & MRU lists. I suspect that when you go with the default setting ("all RAM less 1 GB") you'll see the relevant ratio's deterioating. This might give some enlightening info about the functioning of ZFS under your workload when changing tunables.Understand how the ARC behaves before you start fiddling with it, however.
I cannot imagine where that setting (="the arc size was set to 0") …
vfs.zfs.arc.max: 0
(the default, if I'm not mistaken).% sysctl vfs.zfs.arc.
vfs.zfs.arc.prune_task_threads: 1
vfs.zfs.arc.evict_batch_limit: 10
vfs.zfs.arc.eviction_pct: 200
vfs.zfs.arc.dnode_reduce_percent: 10
vfs.zfs.arc.dnode_limit_percent: 10
vfs.zfs.arc.dnode_limit: 0
vfs.zfs.arc.sys_free: 0
vfs.zfs.arc.lotsfree_percent: 10
vfs.zfs.arc.min_prescient_prefetch_ms: 0
vfs.zfs.arc.min_prefetch_ms: 0
vfs.zfs.arc.average_blocksize: 8192
vfs.zfs.arc.p_min_shift: 0
vfs.zfs.arc.pc_percent: 0
vfs.zfs.arc.shrink_shift: 0
vfs.zfs.arc.p_dampener_disable: 1
vfs.zfs.arc.grow_retry: 0
vfs.zfs.arc.meta_strategy: 1
vfs.zfs.arc.meta_adjust_restarts: 4096
vfs.zfs.arc.meta_prune: 10000
vfs.zfs.arc.meta_min: 0
vfs.zfs.arc.meta_limit_percent: 75
vfs.zfs.arc.meta_limit: 0
vfs.zfs.arc.max: 0
vfs.zfs.arc.min: 0
%
So, no change in ARC size (min and max = 0).
I read it colloquially, as meaningvfs.zfs.arc.max: 0
(the default, if I'm not mistaken).
vfs.zfs.arc_max=”0”
vfs.zfs.arc_min=”0”
That "default" baffles me.Yes, arc_max = arc_min = 0 was the default in vfs.zfs.arc.*.
vfs.zfs.arc_max
:An example mentioned* for a 32GB system (Advanced ZFS, Restricting the ARC size, p. 129):vfs.zfs.arc_max - Upper size of the ARC. The default is all RAM but 1 GB, or 5/8 of all RAM, whichever is more. Use a lower value if the system runs any other daemons or processes that may require memory. Adjust this value at runtime with sysctl(8) and set it in /boot/loader.conf or /etc/sysctl.conf.
Here we set an upper limit of 20 GB in /boot/loader.conf
vfs.zfs.arc_max=”21474836480”
If I read this correctly, my imagination has failed me.Code:% sysctl vfs.zfs.arc. <snip> vfs.zfs.arc.max: 0 vfs.zfs.arc.min: 0
vfs.zfs.arc.max=”0”
vfs.zfs.arc.min=”0”
vfs.zfs.arc_max
or vfs.zfs.arc.max
; making tuning for that a higly specific niche.According to Matt Ahrens, one of the main architects of ZFS, over 50% of the original OpenSolaris ZFS code has been replaced in OpenZFS with community contributions as of 2019, making “Oracle ZFS” and “OpenZFS” politically and technologically incompatible.
… I think OpenZFS now uses a connecting "dot" instead of a connecting underscore: …
% sysctl vfs.zfs.arc_max
vfs.zfs.arc_max: 0
% sysctl vfs.zfs.arc.max
vfs.zfs.arc.max: 0
%
I found "0" to be documented as being the default in Linux and Oracle documentations == 50% or 75% or 1 GB less than RAM.
… Under Linux, half of system memory will be used as the limit. …
zfs_arc_max=0B (ulong)
not very clear.zfs_arc_max=0B (ulong)
(with combining underscores) is the source code setting which you can only set when compiling. That could be different from the tunable:% sysctl vfs.zfs.arc.max
vfs.zfs.arc.max=
vfs.zfs.arc.min=
# sysctl vfs.zfs.arc.
zfs_arc_max
Maximum size of ARC in bytes. If set to 0 then the maximum ARC size is set to 1/2 of system RAM.
zfs_arc_max=0B (ulong)
Max size of ARC in bytes. If 0, then the max size of ARC is determined by the amount of system memory installed. Under Linux, half of system memory will be used as the limit. Under FreeBSD, the larger of all_system_memory - 1GB and 5/8 × all_system_memory will be used as the limit. This value must be at least 67108864B (64MB).
… after commenting out any entries: …