Migrate from usb installation

infoboy

Cadet
Joined
Feb 22, 2023
Messages
4
Hi friends.

Hope everyone's doing well.

I got this surprise today, a very inconvenient one. During a meeting i heard something which disturbed me a lot.
(I hope i will not have nightmares this night about some usb stick running in fire around the server room.)

On another site i'm not responsible for there is our archives infrastructure.
Freenas has been choosen to do the job at this time (2019 i think). That was a perfect choice.

I work on another site mostly on gnu/linux stuff and unfortunately the previous sysadmin quit and didn't leave any decent documentation.
Now the person in charge on the site is a little shy with BSD (as i am) and discovered recently that the entire production server is installed ... on a usb stick.

as you can see :

Code:
freenas-boot                                                     9.94G  45.3G       64K  none
freenas-boot/ROOT                                                9.91G  45.3G       29K  none
freenas-boot/ROOT/11.2-U2.1                                       195K  45.3G      756M  /
freenas-boot/ROOT/11.2-U8                                         355K  45.3G      759M  /
freenas-boot/ROOT/11.3-U1                                         261K  45.3G     1.00G  /
freenas-boot/ROOT/11.3-U3.2                                       230K  45.3G     1.01G  /
freenas-boot/ROOT/11.3-U4.1                                       250K  45.3G     1.01G  /
freenas-boot/ROOT/11.3-U5                                         242K  45.3G     1.02G  /
freenas-boot/ROOT/12.0-U4.1                                       172K  45.3G     1.19G  /
freenas-boot/ROOT/13.0-U3.1                                      9.90G  45.3G     1.30G  /
freenas-boot/ROOT/FreeNAS-12.0-U3.1                               174K  45.3G     1.17G  /
freenas-boot/ROOT/Initial-Install                                   1K  45.3G      760M  legacy
freenas-boot/ROOT/default                                         190K  45.3G      760M  legacy


Code:
freenas-boot      57G  9.94G  47.1G        -         -      -    17%  1.00x    ONLINE  -


I feel really uncomfortable with this and wish to plan a migration to some SSD (zfs mirror) asap.

We got other large zfs pool divided into dataset like :

Code:
NAME             SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
JUNGLE_ZFSpool   217T   145T  72.4T        -         -     4%    66%  1.00x    ONLINE  /mnt


The idea as you can imagine is to leave untouched those datasets.

I got very poor skills with BSD, zfs and more specifically truenas as for example i have no idea how the bootloader works.

Can some of the wizards here drive me to some documentations/directions to plan a safe migration please ?

I can provide other details, logs of course an would be glad to learn and read you.

Thank you very much .
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
I can't walk you through the process but I do want to help you in a few points:
  1. Backup your configuration, (if you have not already done so)
  2. Backup any encryption keys, (or verify you don't use encryption)
  3. Document where your configuration backups are located
  4. Figure out if your FreeNAS server has 1 or 2 unused SATA or SAS ports
  5. If you don't have enough unused SATA or SAS ports, some people use SATA or NVMe drives attached via an USB adapter. That seems to be more reliable than cheap USB flash drives.
  6. Check and make sure you are on the FreeNAS notification E-Mail list, (so you can be notified of any problems). If not, add yourself or group and repeat step 1.
  7. Use the command zpool status freenas-pool and copy the results here in code tags.
In theory, you can connect your new SATA, SAS or NVMe boot pool and tell FreeNAS to mirror the boot pool live. But I don't use that version so I can't find those steps for you.

Note that their ARE high quality USB flash drives. It is just that they are rare today, with the bulk being cheap, (and unreliable garbage).


FreeNAS and the later TrueNAS are designed to have the entire configuration in either the configuration backup, or as ZFS attributes to the pool or datasets. This means worst case, if you have your FreeNAS configuration backup, you can re-install the same FreeNAS version, and restore the configuration. A couple of reboots, and you are back in business.

If you can't figure out how to mirror your existing USB flash drive to a newer device, then backup configuration, re-install and restore configuration.


Feel free to spin up a Virtual Machine on your desktop, (or non-prod server), and play with the options.
 
Joined
Oct 22, 2019
Messages
3,641
But I don't use that version so I can't find those steps for you.
If you can't figure out how to mirror your existing USB flash drive to a newer device, then backup configuration, re-install and restore configuration.

Unfortunately, the ability to "Attach" (that is, add an additional drive to the boot-pool's vdev) is not possible with the GUI if a two-drive mirror vdev already exists.

If one wishes to stick with the GUI (and not have to drop down to the command-line), it's possible to do this "shuffle dance" in the GUI.

System -> Boot -> Actions -> Boot Pool Status
  1. First, Detach one of the existing USB drives from the boot-pool's mirror vdev
  2. Now Replace this drive with one of your SSDs.
  3. At this stage, your boot-pool is now comprised of a mirror vdev (USB + SSD)
  4. Next, Detach the other existing USB drive from the boot-pool's mirror vdev
  5. Finally, Replace this drive with the other SSD.
  6. Your boot-pool is now comprised of two SSDs in a mirror vdev
  7. (Optionally) Expand the boot-pool to grow into the larger capacity
I think step 7 might be automatic?

More important than anything in this process is what @Arwen wrote above:
  1. Backup your configuration, (if you have not already done so)
  2. Backup any encryption keys, (or verify you don't use encryption)
  3. Document where your configuration backups are located
 

infoboy

Cadet
Joined
Feb 22, 2023
Messages
4
Thank you very much for those recommendations.

I feel reassured now.

I'll transmit this and prepare a procedure with the person over there to plan the migration.

That's quite comforting the process is clear.

Personally i'm more comfortable with cli than gui. I never expect a gui to do exactly what i want.

For the pool status it doesn't have a freenas-pool but only freenas-boot . Here it is :

Code:
  pool: freenas-boot
 state: ONLINE
status: Some supported and requested features are not enabled on the pool.
        The pool can still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
        the pool may no longer be accessible by software that does not support
        the features. See zpool-features(7) for details.
  scan: scrub repaired 0B in 00:06:20 with 0 errors on Sun Feb 19 03:51:20 2023
config:

        NAME          STATE     READ WRITE CKSUM
        freenas-boot  ONLINE       0     0     0
          da24p2      ONLINE       0     0     0

errors: No known data errors
 
Last edited:
Joined
Oct 22, 2019
Messages
3,641
For the pool status it doesn't have a freenas-pool but only freenas-boot .
Old versions used the name "freenas-boot", while newer versions use the name "boot-pool".


NAME STATE READ WRITE CKSUM
freenas-boot ONLINE 0 0 0
da24p2 ONLINE 0 0 0
It appears there is only one drive in a "stripe", i.e, single drive vdev.

This means you can skip steps #1 and #2, and instead use the "Attach" option to add one of your SSDs. This will take you into step #3.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
Thank you very much for those recommendations.

I feel reassured now.
...
You are welcome.

...
For the pool status it doesn't have a freenas-pool but only freenas-boot . Here it is :

pool: freenas-boot
...
A typo on my part, glad you figured it out.
 

infoboy

Cadet
Joined
Feb 22, 2023
Messages
4
It's getting easier. Excellent !

Thank you very much.

it will certainly take some time for the person there to go for it.

Can i update this post at this moment if necessary ?
 
Joined
Oct 22, 2019
Messages
3,641
Sure, I do not see why not.
@Arwen, such crucial decisions must be voted on by the Board of Directors™.

EDIT: The Board has voted, and it was a 5-4 decision of "yes" to "no". The motion has passed. @infoboy, you are allowed to update this thread as needed.
 
Top