The reason that I bring this up, is that this is something that can bring a system down quite easy... and what it even worse, is that you may start out with a mirror like I did... then if one of your drives fail and you replace it, you will not find out that your system is unable to boot... until you reboot of cause...@beardmann
I haven't tried this on TrueNAS yet, but making a guess based on generic Debian/Red Hat experience, it sounds like you do not have the BIOS boot and/or the EFI system partition on the new disk?
My TrueNAS OS disk has three partitions on it.
They have partition types:
The first is needed for a BIOS (meaning non EFI) boot from a GPT partitioned disk.
- ef02 BIOS boot partition
- ef00 EFI system partition
- bf01 Solaris /usr & Mac ZFS
The second is needed to boot using EFI and is a vfat file system. This cannot be RAIDed. It is usually (in Red Hat/Debian) mounted at /boot/efi, but isn't on TrueNAS Scale for some reason. You can just mount it and copy the contents over to the new disk once it is partitioned and has a filesystem.
The 3rd is for the boot-pool pool/vdev and is the rest of the disk.
I have notes somewhere on how to fo all of this for a vanilla Debian/Red Hat system if needed.
The system does create three partitions on both disks:
root@truenas[/]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 512M 0 part
└─sda3 8:3 0 19.5G 0 part
sdb 8:16 0 20G 0 disk
├─sdb1 8:17 0 1M 0 part
├─sdb2 8:18 0 512M 0 part
└─sdb3 8:19 0 19.5G 0 part
and the boot pool is ok:
NAME STATE READ WRITE CKSUM
boot-pool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
sda3 ONLINE 0 0 0
sdb3 ONLINE 0 0 0
I can see that / and /boot/grub is mounted from the boot-pool... which is mirrored..
root@truenas[/]# mount | grep boot
boot-pool/ROOT/22.02.RELEASE on / type zfs (rw,relatime,xattr,posixacl)
boot-pool/grub on /boot/grub type zfs (rw,relatime,xattr,posixacl)
boot-pool/.system on /var/db/system type zfs (rw,relatime,xattr,posixacl)
boot-pool/.system/cores on /var/db/system/cores type zfs (rw,relatime,xattr,posixacl)
boot-pool/.system/samba4 on /var/db/system/samba4 type zfs (rw,relatime,xattr,posixacl)
boot-pool/.system/syslog-782595d4363048b99e75310cc20adc4f on /var/db/system/syslog-782595d4363048b99e75310cc20adc4f type zfs (rw,relatime,xattr,posixacl)
boot-pool/.system/rrd-782595d4363048b99e75310cc20adc4f on /var/db/system/rrd-782595d4363048b99e75310cc20adc4f type zfs (rw,relatime,xattr,posixacl)
boot-pool/.system/configs-782595d4363048b99e75310cc20adc4f on /var/db/system/configs-782595d4363048b99e75310cc20adc4f type zfs (rw,relatime,xattr,posixacl)
boot-pool/.system/webui on /var/db/system/webui type zfs (rw,relatime,xattr,posixacl)
boot-pool/.system/services on /var/db/system/services type zfs (rw,relatime,xattr,posixacl)
boot-pool/.system/glusterd on /var/db/system/glusterd type zfs (rw,relatime,xattr,posixacl)
boot-pool/.system/ctdb_shared_vol on /var/db/system/ctdb_shared_vol type zfs (rw,relatime,xattr,posixacl)
boot-pool/.system/cores on /var/lib/systemd/coredump type zfs (rw,relatime,xattr,posixacl)
So my guess it that the boot-block/signature/whatever is not written to the replaced disk, which leaves the system unbootable.
As mentioned, this can be replicated by just creating a VM with two disks, installing TrueNAS Scale onto the two disks, and then simulate a disk failure of the first disk (sda). With the disk gone, the VM can boot from sdb, but as you do a replacement with a new virtual disk and do a replace on the boot-pool... it resilvers OK, (it then fails with the error described in my first post).. but even if I re-run the grub-install manually (which completed OK)... it is now unable to boot of sda.
Is it just a grub command that needs to be executed on the replaced disk in order to make it bootable?
Would be very nice if this just worked out of the box... is that too much to ask? Is it hard or complicated?
Might just end up mirroring the boot disks with a server RAID card if this doesn't work
/B