Unable to run grub-install on 11.2-U7

Turribeach

Cadet
Joined
Jan 23, 2019
Messages
4
I have attached another SSD to my boot pool so they are now mirrored. However from reading different posts (see here and here) it seems that the attached new disk is not bootable unless grub-install is run on it to make it bootable. This post shows this working on 9.10.2-U4 but when I tried on 11.2-U7 it seems this command/script is not available on 11.x. Any ideas how to run grub-install on 11.2-U7? As one of the posts suggests I could reinstall Freenas on the second drive and restore my config, which will make it bootable but this seems like a very cumbersome way of doing this. I found this post that suggests how to do it from a bootable live CD but again it seems a little bit over the top.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
Surely you noticed FreeNAS stop using GRUB as its bootloader in 11.2-U7 and now uses the native FreeBSD boot loader?

Method is described in 6.3.1. Mirroring the Operating System Device of the 11.2-U7 FreeNAS guide.
 
Last edited:

Turribeach

Cadet
Joined
Jan 23, 2019
Messages
4
Hi, thanks for the reply. I wasn't aware of that, thanks for pointing it out. I have followed the documentation you point out but it doesn't really state if the mirrored disk will be made bootable or not.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
That ought to be part of the background process when you "attach" the second drive to create mirrored boot set-up ( I don't use that myself). You can check in the shell with gpart show to see if the mirrored boot disks both have a "freebsd-boot" partition.
 

Turribeach

Cadet
Joined
Jan 23, 2019
Messages
4
Was just trying that. These are my two boot drives, both have two partitions so I guess this looks good?

Code:
=>       40  250069600  ada6  GPT  (119G)
         40     532480     1  efi  (260M)
     532520  249537120     2  freebsd-zfs  (119G)

=>       40  250069600  ada4  GPT  (119G)
         40     532480     1  efi  (260M)
     532520  249537120     2  freebsd-zfs  (119G)
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
OK, I was still thinking of BIOS boot and not EFI which you must be using.
 

Turribeach

Cadet
Joined
Jan 23, 2019
Messages
4
Hi, thanks for the info. I have been doing some reading and learnt that in UEFI BIOS systems the boot code is stored in the EFI partition. I mounted EFI the partition from the mirrored disk and I can indeed see the bootcode as expected. I can also see the time stamps match the exact time I did the disk mirror attachment. I got into a rabbit hole really, all good here, nothing to see. ;)

Code:
root:/>mount -t msdosfs /dev/ada4p1 /mnt_test
root:/>df -h /mnt_test
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ada4p1    260M    160K    260M     0%    /mnt_test
root:/>ll /mnt_test/efi/boot
total 128
drwxr-xr-x  1 root  wheel  16384 Jan  1 13:41 .
drwxr-xr-x  1 root  wheel  16384 Jan  1 13:41 ..
-rwxr-xr-x  1 root  wheel  96768 Jan  1 13:41 BOOTx64.efi
root:/>umount /mnt_test
root:/>
 
Top