Cloning boot-pool to SSD, then actually making it bootable?

Paravirtual

Dabbler
Joined
Nov 8, 2020
Messages
13
This question is partly an extension of two other topics but differs from each slightly that I didn't just want to tack it onto the end of either of those.

The first being Patrick Hausen's Guide on How to Install to just a smaller Partition on SSD (instead of using the entire disk) - https://www.ixsystems.com/community...sds-for-boot-pool-and-data.81409/#post-590563
and the second being ClinderW's question as to why this doesn't appear to work anymore (which comes down to mismatched ashift between USB and SSD) - https://www.truenas.com/community/t...-attach-to-mirrors-and-top-level-disks.89276/


So I've done a basic install to USB, but want to transfer this to a mirror vdev on SSDs but I want the ashift to be set to 12 instead of 9. Attaching SSD to the exist boot-pool to create a mirror vdev with the USB device da0p2 works but the ashift will be set to 9 (and maybe this doesn't even matter but I've yet to give up and accept it this way)

So,

I snapshotted the entirety of boot-pool,
Created a partition layout on a pair of 120GB SSDs that matched (for the first two partitions) the layout of the USB disk containing boot-pool
Created a new zpool called "boot-poolA" with mirror vdev of the SSD's 2nd Partitions (using gptid) with ashift=12
Used zfs send / zfs receive to copy the boot-pool snapshot (and all underlying datasets) to boot-poolA
Used dd to copy the da0p1 freebsd-boot partition (512K) to the corresponding 1st partitions on each of the two SSDs

but at this point the boot-pool I want to used has the "wrong name" so I tried (and apparently failed) to fix this by,

Booting the TrueNAS Installer stick, and selecting console
Importing boot-poolA as boot-pool
Exporting it again
Rebooting, removing all USB sticks and ensure SSDs were 1st boot device in BIOS


It didn't work.

I feel I must be close but don't understand quite how to set it to try and boot using this new pool that exists on the SSDs. It has the right label/name, but I'm guessing there's more to it, than that.

FWIW, The system is an HP Microserver N36L and boots BIOS, not UEFI.

I've no data on it yet so no risk of harm by getting something wrong at this stage.



Having rebooted via the USB stick that system is installed to, I can see this;

Code:
Warning: settings changed through the CLI are not written to
the configuration database and will be reset on reboot.

root@alexandria[~]# zpool status
  pool: boot-pool
state: ONLINE
  scan: resilvered 1.19G in 00:01:21 with 0 errors on Tue Dec 29 16:06:56 2020
config:

        NAME                                          STATE     READ WRITE CKSUM
        boot-pool                                     ONLINE       0     0     0
          gptid/03b5202b-70ab-11bd-b287-3cd92b0c2433  ONLINE       0     0     0

errors: No known data errors
root@alexandria[~]# zpool import
   pool: boot-pool
     id: 17078519315175409940
  state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:

        boot-pool                                       ONLINE
          mirror-0                                      ONLINE
            gptid/579a1b25-4843-11eb-8109-3cd92b0c2433  ONLINE
            gptid/4257c2cc-4845-11eb-8109-3cd92b0c2433  ONLINE



Can anyone help me get this other boot-pool as the main bootable system pool?
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
I would re-install a fresh copy of free-nat on the SSD and then restore your backup config file. Likely a lot easier.

Cheers,
 

Paravirtual

Dabbler
Joined
Nov 8, 2020
Messages
13
I would re-install a fresh copy of free-nat on the SSD and then restore your backup config file. Likely a lot easier.
I am specifically not doing that because it will use 100% of the disk. I am installing OS to a 16GB Partition on a 120GB SSD.
 

Scharbag

Guru
Joined
Feb 1, 2012
Messages
620
I am specifically not doing that because it will use 100% of the disk. I am installing OS to a 16GB Partition on a 120GB SSD.
And you are going to do what with the other part of the disk? Using it for other than booting TN seems sketchy.

Cheers,
 

Paravirtual

Dabbler
Joined
Nov 8, 2020
Messages
13
And you are going to do what with the other part of the disk? Using it for other than booting TN seems sketchy.
I didn't really want to re-tread over old ground as this is a topic that's been covered before;
here: https://www.truenas.com/community/t...r-of-larger-ssds-for-boot-pool-and-data.81409
here: https://www.truenas.com/community/t...titioned-single-ssd-with-boot-and-jails.85867
here: https://www.truenas.com/community/threads/boot-disk-usage.83979/post-586111
& also here; https://forums.servethehome.com/index.php?threads/installing-freenas-on-a-partition.27798/
(And possibly elsewhere, but that's a good starting point).

You don't need a large device for boot-pool, you ideally want to use SSD over USB for wear/endurance reasons and ideally want it mirrored for redundancy. While small SSDs are cheap, In many small Home NAS systems the availability of space to install them or free SATA, USB or PCIe slots is limited, and having two 120GB+ SSDs 'wasted' on boot-pool when ~16GB (or even 8?) will do, is undesirable.

By using a vdev made up of partitions, for boot-pool, the remaining space is freed up for such uses as Swap, Data Partition for Jails, L2ARC, SLOG, or Special*
(*see https://www.truenas.com/docs/hub/initial-setup/storage/fusion-pool/)

So that's the "Why". How is covered in some of the above links too but it doesn't work quite the same as it did 12 months ago. Can't attach an SSD to a USB to make a mirror without having the ashift set wrong.




So.... I'm currently trying a method where I copy the entire installation onto a new hand-made pool, but I'm having trouble getting it to boot. That's what I'm asking for help with here.




I'm beginning to think modifying the installation script would have been a better way to go, now. It's a shame these options aren't available in the installer but I can fully imagine it become a support nightmare for iXsystems if everyone was doing this. I think something will change though because continuing to use a 120GB SSD or two for a system that needs less than a 10th of that is immensely wasteful.
 

Paravirtual

Dabbler
Joined
Nov 8, 2020
Messages
13
Solved, sort of, I just did a reinstall using irTwit's method of modifying the installation script (and installed to a 3-way mirror of SSDs but using only a 10GB partition on each)
 
Top