Mirroring the boot drive

Status
Not open for further replies.

Chris Dawalt

Explorer
Joined
Nov 26, 2014
Messages
93
In the manual section: 5.3.1. Mirroring the Boot Device, there is discussion about adding a second boot drive.

  • Once created, is this an identical, independent copy of the original (USB) boot drive?
  • Can it be removed without negatively affecting the original FreeNAS system?
  • And finally, can the new copy be used to create a new FreeNAS system on another computer?
I suppose what I am asking is if you can use the boot drive mirroring feature to create fresh FreeNAS boot drives for back up.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
I believe you can.
 

Knowltey

Patron
Joined
Jul 21, 2013
Messages
430
I haven't personally attempted it, but theoretically if have a main server with a pair of mirrored boot drives and a second server with none, and you remove one of the mirrored boot drives from the main server and booted the secondary server from it you would then end up with a pair of degraded ZFS Mirror pools. You could then theoretically add a new USB to each of the servers and have it initiate a resilver to recover both of the raids to a working mirror RAID.
 

Chris Dawalt

Explorer
Joined
Nov 26, 2014
Messages
93
Ok - thanks. I put another flash drive (same brand and size) in and it had the FreeNAS 9.3 installer on it. The console recognized the drive, but the GUI did not. So I wiped and reformatted the secondary flash drive and then the GUI was able to see the secondary drive and I was able to attach it. It took a little while for the mirror to complete, but it was successful. I may pop it (the newly mirrored drive) into another computer just to see what happens.

As a side note question, I recall that 4GB is the minimum for boot drive size - is there any benefit to using a larger capacity boot drive? Mine are both 8GB.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
Yes. On 9.3 larger boot devices means you can have more installs of FreeNAS on your boot device before you'll need to remove them.
 
L

L

Guest
Yes, yes and yes. I have tried it and it worked perfectly. But, I went the command line and did a #zpool split of the freenas-boot pool before taking the second drive to another host.
 

Chris Dawalt

Explorer
Joined
Nov 26, 2014
Messages
93
Yes, yes and yes. I have tried it and it worked perfectly. But, I went the command line and did a #zpool split of the freenas-boot pool before taking the second drive to another host.

I see - that is certainly good to know. So that command lets the system know you are removing one drive from the boot pool. I'll make a note of it.
 
L

L

Guest
The split command tells zfs not to use the drive for the mirror anymore
 

pclausen

Patron
Joined
Apr 19, 2015
Messages
267
How exactly do you use the split command to break the mirror?

I had a 16G USB from which I was booting. I added a 32G SATA DOM, created a mirror, and then removed the USB so that I'm booting from the SATA DOM.

If I do "zpool split freenas-boot" I'm getting an error that I need to supply a new pool name.

I don't want a new pool, I just want to not have a boot mirror and boot only from the SATA DOM.

Thanks!
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
See the man ;)
Code:
zpool split [-n] [-R altroot] [-o mntopts] [-o property=value] pool newpool [device ...]

     Splits    off one    disk from each mirrored    top-level vdev in a pool and
     creates a new pool from the split-off disks. The original pool    must
     be made up of one or more mirrors and must not    be in the process of
     resilvering. The split    subcommand chooses the last device in each
     mirror    vdev unless overridden by a device specification on the    com-
     mand line.

     When using a device argument, split includes the specified device(s)
     in a new pool and, should any devices remain unspecified, assigns the
     last device in    each mirror vdev to that pool, as it does normally. If
     you are uncertain about the outcome of    a split    command, use the -n
     ("dry-run") option to ensure your command will    have the effect    you
     intend.

     -R altroot
         Automatically import the newly    created    pool after splitting,
         using the specified altroot parameter for the new pool's
         alternate root. See the altroot description in    the
         "Properties" section, above.

     -n     Displays the configuration that would be created without
         actually splitting the    pool. The actual pool split could
         still fail due    to insufficient    privileges or device status.

     -o mntopts
         Comma-separated list of mount options to use when mounting
         datasets within the pool. See zfs(8) for a description    of
         dataset properties and    mount options. Valid only in conjunc-
         tion with the -R option.

     -o property=value
         Sets the specified property on    the new    pool. See the
         "Properties" section, above, for more information on the
         available pool    properties.
 

pclausen

Patron
Joined
Apr 19, 2015
Messages
267
I did look at the man page, but I'm still not sure how to pull it off.

Here's the status of the boot pool:

Code:
NAME  STATE  READ WRITE CKSUM
  freenas-boot  DEGRADED  0  0  0
  mirror-0  DEGRADED  0  0  0
  4146010136292113266  REMOVED  0  0  0  was /dev/gptid/51b7b94e-ef61-11e4-9d24-0cc47a3311b4
  ada0p2  ONLINE  0  0  0


I have tried:

zpool split freenas-boot freenas-bootd 4146010136292113266

And:

zpool split freenas-boot freenas-bootd 51b7b94e-ef61-11e4-9d24-0cc47a3311b4

Both give me this error:

cannot open '##': no such GEOM provider (## being 414601#### or 51b7b94####)

So I guess since I already removed the USB device, I can no longer split the boot pool?
 
Last edited:

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
Yep, exactly that. As ZFS splits the pool in two it needs the two drives to be ok.
 

pclausen

Patron
Joined
Apr 19, 2015
Messages
267
Ok, so I guess my best option is to just backup my config and do a fresh install onto the SATA DOM and then restore?

So going to a mirror boot is a one way street with no way to go back to a single boot setup again?
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
Ok, so I guess my best option is to just backup my config and do a fresh install onto the SATA DOM and then restore?

So going to a mirror boot is a one way street with no way to go back to a single boot setup again?

Or add a usb drive back in, resilver and then do a split and remove the usb drive.
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
Yep, a fresh install is always the best option and is pretty fast if you've already the ISO somewhere ;)

Not one way: you can always re-plug the USB stick to split the pool; but I don't know if FreeNAS will like that (using the shell to do ZFS commands that are not read-only is usually a bad idea unless you know exactly what you're doing).
 

pclausen

Patron
Joined
Apr 19, 2015
Messages
267
Thanks, I'll probably go the fresh install route. It will be good practice anyway. If I screw it up, I still have the USB I can boot from.

Backing up the config from the GUI will preserve EVERYTHING right, including all configurations within Jails? EXCEPT it will not preserve the boot mirror, right?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
It will preserve anything you modified using field and boxes in the GUI. Modifications made to jails via cli will not be saved in configuration. Those files live in your pool so they don't get backed up unless you backup your pool. If you aren't destroying your pool then those will be fine.
 

pclausen

Patron
Joined
Apr 19, 2015
Messages
267
Ah that makes sense. I made quite a few changes, especially to my Emby plugin from the CLI to make it run as a different user and a slew of permission changes to my Transmission and SickRage jails. But since I'm not destroying my pool, all those should be preserved from what you're saying.

Ok, so even though I currently have a boot mirror configured (done via the GUI), this is the one part that is NOT restored, right? It would be a shame if I go through this exercise only to discover that once I do the restore, I get a critical alert that my boot mirror is degraded. :)
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
Ah that makes sense. I made quite a few changes, especially to my Emby plugin from the CLI to make it run as a different user and a slew of permission changes to my Transmission and SickRage jails. But since I'm not destroying my pool, all those should be preserved from what you're saying.

Ok, so even though I currently have a boot mirror configured (done via the GUI), this is the one part that is NOT restored, right? It would be a shame if I go through this exercise only to discover that once I do the restore, I get a critical alert that my boot mirror is degraded. :)
You can install it directly to two devices as a mirror, as part of the install process. But if you install to one device it will have no information about the previous mirror.
 

pclausen

Patron
Joined
Apr 19, 2015
Messages
267
Thanks. But what I'm trying to get to is to just have a single SATA DOM in the system and boot from it.

Here's a summary of how I got to where I am:

1. Initial install onto single 16G USB
2. Add SATA DOM 32GB
3. Mirror USB to DOM
4. Remove USB

So now I get a warning about degraded boot mirror.

My end goal is to only boot from the single SATA DOM and NOT have a mirror any longer.

If I save my current config (which still has a boot mirror), my concern is that after doing a fresh install onto the DOM and then restoring from my backup, that mirror boot will become part of the config again, and I'm back where I started.
 
Status
Not open for further replies.
Top