SOLVED FreeNAS Upgrade for Backup USB Drive

Status
Not open for further replies.

Faluzure

Explorer
Joined
Oct 9, 2014
Messages
67
I'm running 9.2.1.8 and since the 9.3 is almost upon us, I have a questions on what to do with the backup USB drive.

From the download page, you have the option of a fresh install (iso), upgrade, or FreeNAS USB Image.

I originally used the 9.2.1.8 FreeNAS USB Image for my current setup. But because I like to be prepared, I have an identical USB drive with the same image on it and I've been backing up my config via a cron job daily to another server.

When 9.3 is released, obviously I'm going to use the Upgrade option to upgrade my version to the latest.

However, once it's up and running, would I just burn the "9.3 USB image" on the backup USB drive and expect it to work the same as a replacement? Or is there a different procedure for getting my backup drive up to boot like the main/current USB drive post-9.3 upgrade? I know the versions will be the same, just didn't know if there were obvious issues of a fresh USB stick vs an upgraded FreeNAS USB stick.

Thanks for your help.
 
D

dlavigne

Guest
Is your end goal to have a mirrored boot device? If so, either do a fresh install of 9.3 and select both devices, or, after an upgrade to 9.3, attach the second device in System -> Boot -> Status.
 

Faluzure

Explorer
Joined
Oct 9, 2014
Messages
67
Is your end goal to have a mirrored boot device? If so, either do a fresh install of 9.3 and select both devices, or, after an upgrade to 9.3, attach the second device in System -> Boot -> Status.

Not necessarily a mirror (connected at the same time), but just one as a backup to use when the original fails. I've read horror stories of how people have had failed USB drives and didn't have another USB device (with a backup config) to obtain their data.

Basically, when upgrading, I'm going by "2.6.3 - Using the GUI to Upgrade" in the manual. It's my understanding that the new image is uncompressed/written to the USB drive during the upgrade process. So the existing USB drive is taken care of in regards to the 9.3 version.

But for the 2nd USB drive, I was just curious if just "burning" the 9.3 USB Image to the second/spare USB drive is sufficient enough to get the system back up & running in the event the 1st USB drive fails. I understand that I need to have a backup configuration (which I backup daily to another server) and an auto-import volume to get it back to the same state.

I was just wanting clarification that my procedure is correct. Sorry for overcomplicating things.
 
D

dlavigne

Guest
You don't need another USB device to prevent horror stories. Just make it a habit to backup your config whenever you make config changes.

Note that section 2.6.3 applies AFTER one is on 9.3. The upgrade procedure to 9.3 from 9.2.x is the old manual update procedure and the update will automatically format the boot device with ZFS.

Having a second boot (non-mirrored boot) device will be more interesting going forward, especially as one applies updates since their original upgrade/installation. I'm guessing that one could do an install of whatever the latest stable version is at the point of failure, but one would lose all of their saved boot environments as BEs are separate from the config database.
 

Faluzure

Explorer
Joined
Oct 9, 2014
Messages
67
You don't need another USB device to prevent horror stories. Just make it a habit to backup your config whenever you make config changes.

Note that section 2.6.3 applies AFTER one is on 9.3. The upgrade procedure to 9.3 from 9.2.x is the old manual update procedure and the update will automatically format the boot device with ZFS.

Having a second boot (non-mirrored boot) device will be more interesting going forward, especially as one applies updates since their original upgrade/installation. I'm guessing that one could do an install of whatever the latest stable version is at the point of failure, but one would lose all of their saved boot environments as BEs are separate from the config database.

Got it. I am backing up the config daily via a cron job to a dataset. Then I have another server on my network use the Windows Task Schedule to grab that file from the dataset and copy it locally to a drive on that server. That ensures that I at least have a daily backup of the config.

Going back to your original post, you mentioned mirrored boot devices. I didn't even know that was possible.
"Is your end goal to have a mirrored boot device? If so, either do a fresh install of 9.3 and select both devices, or, after an upgrade to 9.3, attach the second device in System -> Boot -> Status."​

I looked at System (under 9.2.1.8) and didn't see anything about "Boot", but you mentioned to do it after I upgrade to 9.3. After searching the forums for "mirrored boot", I saw several posts under the 9.3 Testing section, so I'm assuming it's a new feature in 9.3.

EDIT: I finally found the 9.3 documentation as a banner on doc.freenas.org. I kept scrolling and selecting the one in the middle of the page (9.2.1 Users Guide). *facepalm* o_O

Ok... now I know that that's available. I'm reading it and what you said makes a LOT more sense now. So it's as simple as:

1. Upgrade to 9.3 / Verify the status/name of the current boot device.
2. Add the 2nd USB drive to the server.
3. Select the original boot device. Then select "Clone" to copy the existing.

Is it really that simple?
 
Last edited:
D

dlavigne

Guest
Ok... now I know that that's available. I'm reading it and what you said makes a LOT more sense now. So it's as simple as:

1. Upgrade to 9.3
2. Verify the status/name of the current boot device.
2. Add the 2nd USB drive to the server.
3. Select the original boot device. Then select "Clone" to copy the existing.

Is it really that simple?

Yup :smile:

But step 3 is like this:

Go to System -> Boot and click the Status button. This will show all available devices. Select the new USB device and click Attach to create a mirrored boot device.

I'll be adding that bit to the 9.3 docs tomorrow.
 

Faluzure

Explorer
Joined
Oct 9, 2014
Messages
67
Yup :)

But step 3 is like this:

Go to System -> Boot and click the Status button. This will show all available devices. Select the new USB device and click Attach to create a mirrored boot device.

I'll be adding that bit to the 9.3 docs tomorrow.

Awesome. Thanks dlavgine!
 

gnemez

Cadet
Joined
Dec 12, 2014
Messages
1
Hello Guys,
in order to have a second working boot device, I created a mirrored USB Jumper Key, following the procedure above described.
The point is: I am willong to have a second USB ready to use BUT not pluged in all the time, like a mirrored would be.
Then I detached one of the two USB devices, BUT I', getting a security report every night, worning that the the pool freenas.boot is DEGRADED.
Is there a work around?
Thanks.
 

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
I don't know if this is any use to you, but what I did was to boot up using the FreeNAS iso after installation onto a USB drive, then setting up 9.3 in the GUI how I want it etc, downloaded some updates, then backed my configuration.

After that I installed FreeNAS 9.3 on another USB stick, and after shutting the working system down, I removed the fiorst USB stick, then inserted the 2nd one and booted up again with that drive. Then once into the GUI, I uploaded the previously saved config file, let the system reboot a couple of times, then check for any updates and install as required.
That's it, so I now have a backup USB drive of my working system should anything go wrong. I don't expect it to, but it might.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Hello Guys,
in order to have a second working boot device, I created a mirrored USB Jumper Key, following the procedure above described.
The point is: I am willong to have a second USB ready to use BUT not pluged in all the time, like a mirrored would be.
Then I detached one of the two USB devices, BUT I', getting a security report every night, worning that the the pool freenas.boot is DEGRADED.
Is there a work around?
Thanks.

The workaround is to use it as a mirror. The expectation was that if you wanted an immediately available USb device you'd go with mirrors, or you'd be doing a fresh install of FreeNAS to a new USB stick when needed along with a config restore from backups that you make regularly.
 

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
Yup :)

But step 3 is like this:

Go to System -> Boot and click the Status button. This will show all available devices. Select the new USB device and click Attach to create a mirrored boot device.

I'll be adding that bit to the 9.3 docs tomorrow.

Out of interest, does the new USB stick have to be in as or when the existing FreeNAS is booting up into the GUI, or, can it be added/ inserted into a USB slot after it has booted up.
I ask because I have just inserted a blank USB stick in to a spare slot on my NAS box, and after following the above menu, the blank USB stick is not shown or listed.

I then clicked the 'Attach' button, and the new blank USB stick was listed or shown, and after waiting a few minutes it was then added to the list in boot status.

Then I get this from FreeNAS
The boot volume state is ONLINE: One or more devices is currently being resilvered. The pool will continue to function, possibly in a degraded state.

So what happens or would happen if I just removed the blank USB stick, as when I click on it a button appears with 'Replace' on it
 

peterh

Patron
Joined
Oct 19, 2011
Messages
315
Now the mirror is complete. But i do not want the second USB-stick to remain as a mirror, i want to remove it and have
it saved in case of problems with the first one. The only way to keep it protected from software/admin errors is to
remove it and have it available as bootmedia in case of trouble.

syslog shows this :
Jan 30 11:37:11 segotl501 umass1:12:1:-1: Attached to scbus12
Jan 30 11:37:11 segotl501 da16 at umass-sim1 bus 1 scbus12 target 0 lun 0
Jan 30 11:37:11 segotl501 da16: <Kingston DataTraveler 3.0 PMAP> Removable Direct Access SCSI-6 device
Jan 30 11:37:11 segotl501 da16: Serial Number 08606E6D418ABEA14717F4DE
Jan 30 11:37:11 segotl501 da16: 40.000MB/s transfers
Jan 30 11:37:11 segotl501 da16: 30008MB (61457664 512 byte sectors: 255H 63S/T 3825C)
Jan 30 11:37:11 segotl501 da16: quirks=0x2<NO_6_BYTE>
Jan 30 11:37:11 segotl501 GEOM: da16: the secondary GPT table is corrupt or invalid.
Jan 30 11:37:11 segotl501 GEOM: da16: using the primary only -- recovery suggested.
Jan 30 11:52:03 segotl501 notifier: 1+0 records in
Jan 30 11:52:03 segotl501 notifier: 1+0 records out
Jan 30 11:52:03 segotl501 notifier: 1048576 bytes transferred in 0.060144 secs (17434370 bytes/sec)
Jan 30 11:52:04 segotl501 notifier: dd: /dev/da16: short write on character device
Jan 30 11:52:04 segotl501 notifier: dd: /dev/da16: end of device
Jan 30 11:52:04 segotl501 notifier: 5+0 records in
Jan 30 11:52:04 segotl501 notifier: 4+1 records out
Jan 30 11:52:04 segotl501 notifier: 4849664 bytes transferred in 0.495298 secs (9791408 bytes/sec)
Jan 30 11:52:21 segotl501 notifier: Installing for i386-pc platform.
Jan 30 11:52:48 segotl501 notifier: Installation finished. No error reported.


"zpool detatch" is what i would expect at this point, but is correct ? Or can i simply pull the second usb-stick
and save it in a drawer ?
Another issue : is the boot-code added by the above steps ? Reading the handbook
https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/zfs-zpool.html
i see :
<quote>
When attaching additional devices to a boot pool, remember to update the bootcode.

Attach a second mirror group (ada2p3 and ada3p3) to the existing mirror:

# zpool status
pool: mypool
state: ONLINE
scan: resilvered 781M in 0h0m with 0 errors on Fri May 30 08:19:35 2014
config:

NAME STATE READ WRITE CKSUM
mypool ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
ada0p3 ONLINE 0 0 0
ada1p3 ONLINE 0 0 0

errors: No known data errors
# zpool add mypool mirror ada2p3 ada3p3
# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada2
bootcode written to ada2
# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada3
bootcode written to ada3
</quote>

My intention is to create a copy of the running usb-stick.
 
Last edited:

peterh

Patron
Joined
Oct 19, 2011
Messages
315
As no answer was received i'll report my experimental findings :
I powered down the server, removed both usb-sticks, , remounted the "mirror" inside the box and powered up.
Boot was successful and in addition a mail reported :

The boot volume state is DEGRADED: One or more devices could not be opened.
Sufficient replicas exist for the pool to continue functioning in a degraded state.

zpool status also reported that the freenas-boot pool was missing a disk.
Remounting the original usb-stick ( but in an external usb port) and "zpool online freenas-boot < name of missing disk>
restored the mirror. This is how we leave this machine, i think we get the best solution this way.
 

jms703

Dabbler
Joined
Jun 20, 2012
Messages
18
FWIW, I was looking to replace my current 4GB flash drive with a 16GB flash drive and couldn't find instructions to do so.

I followed the directions in the manual that said to create a mirrored boot device. However, I didn't want to maintain a mirror, especially with only a 4GB flash drive.

Once the silvering was complete, I detached the old usb drive from the system by running:

# zpool detach freenas-boot da6p2

Then I shutdown the system, removed the old usb flash drive, moved the new usb flash drive to the usb port on the motherboard, and booted the system.

Everything worked fine. I now have a 16GB boot drive (14.5 GiB actually) with 3.3 GiB (22%) used.

(I had to do this because upgrades were failing because my 4GB boot drive was running out of space. Deleting old snapshots is not automatic, and even with 2 snapshots, I was using 88% of the 4GB flash drive.)
 

ikonspirasi

Cadet
Joined
Apr 3, 2015
Messages
9
FWIW, I was looking to replace my current 4GB flash drive with a 16GB flash drive and couldn't find instructions to do so.

I followed the directions in the manual that said to create a mirrored boot device. However, I didn't want to maintain a mirror, especially with only a 4GB flash drive.

Once the silvering was complete, I detached the old usb drive from the system by running:

# zpool detach freenas-boot da6p2

Then I shutdown the system, removed the old usb flash drive, moved the new usb flash drive to the usb port on the motherboard, and booted the system.

Everything worked fine. I now have a 16GB boot drive (14.5 GiB actually) with 3.3 GiB (22%) used.

(I had to do this because upgrades were failing because my 4GB boot drive was running out of space. Deleting old snapshots is not automatic, and even with 2 snapshots, I was using 88% of the 4GB flash drive.)

Same with me here, i just got my 8GB flash drive to 82% despite having only 3 boot snapshot (default, initial install and FreeNAS...), and after each upgrade (FreeNAS updates are fast! thank you) i keep getting alert, so i decided to add 2nd flash drive (16GB) and doing what jms703 done and everything works fine.
Yeah i'm so lazy to delete the boot snapshots :)
 
Joined
Apr 21, 2012
Messages
25
I must be missing something here. In the GUI for FreeNAS-9.3-STABLE-201511280648:

I attached a second USB to my server, then requested a STATUS on the boot drive (in my case zpool freenas-boot). I had one drive listed; ada0p2. After verifying that the drive assignment (ada0p1) showing in the "Attach" window was different from the one seen in boot status, I selected "Atttach" and got a "Please Wait.' After a few seconds, the drop box disappeared, but I did not end up with and more drives in the GUI display. I then opened a shell and commanded: zpool status. the zpool named freenas-boot still contained only the first mentioned drive.

So how do I force the atttached (USB) drive to join the pool and then mirror?
 
Joined
Apr 21, 2012
Messages
25
I solved my own problem.

I opened shell and attached the drive manually (zpool attach freenas-boot da0p2 da1p2). The command line returned with:
cannot attach da1p2 to da0p2: device is too small. Even though both USB drives are 16GB, they are from different manufacturers, so there could be some small size difference, enough to make it so the new drive cannot attach. Guess I'll have to buy a reliable 32GB drive as the original boot drive was made some 4 years ago unless someone can reply with another solution that would save me from the hassle of moving my server so I can attach a monitor, mouse, and keyboard and start over with a fresh install.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
  1. backup your configuration
  2. clean install to the smaller device (you can do this on any machine)
  3. add the larger device as a mirror, preferably using the GUI
  4. restore your configuration
 
Status
Not open for further replies.
Top