Advantages of new ZFS-on-boot features (boot scrub, verify install, etc)

Status
Not open for further replies.

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Is it possible to have a SATA DOM boot device mirrored to a USB stick?

Possible, yes.

Is it something I'd recommend. Not exactly. While I'd expect it to work and be flawless I'm not sure if there would be any side effects to having a relatively fast SATA DOM tied to a relatively slow USB device. There could be unforseen problems.

In any case, if you have the hardware and want to try it I'd say 'go for it'. If it doesn't work then you should be able to use one of the devices individually to keep the system up while you decide how to restore redundancy (if you care about restoring redundancy).
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
This reminds me of the scene in the Hunt for Red October, when they're trying to figure out what the new submarine is from the pictures.

"Could you fire a missile horizontally?"
"Sure. Why would you want to?"
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
Not happened at 35 days! More comment after the 36th dieversary tomorrow. I admire my forbearance in not pressing the beckoning 'scrub now' button for 35 days.

Edit: Meant to quote my previous post. I refer, of course, to the automatic scrub of the boot pool.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Indeed. The next software update will have a scrub-period-in-days field for the boot pool. We'll set that to "1", see if it does anything. Then pick it up from there.
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
Spoke too soon. The automatic scrub operated as planned 35 days and about 18 hours after the last one. I forgot to allow for cron having its own time of day for doing things *after* the specified time lapse - in this case 03.45. So it works! But I think I will set it to something like weekly when the update you mention comes out, if only to reassure myself cron is still working correctly.

Edit - I am surprised that scrubs (either on the boot pool or a data pool) are not logged in /var/log/messages. But of course one can always check manually on zpool status. The GUI reports that the boot pool is 'healthy' and the time the last scrub was run. Would it tell us if there were any errors corrected, it doesn't tell us that they haven't been? Or would this result in an additional email to the one telling us the scrub has started?
 
Last edited:

ethereal

Guru
Joined
Sep 10, 2012
Messages
762
i like the idea of using two usb flash drives mirrored for booting - this may seem a silly question - if i have two identical sandisk flash drives how do i know which one to replace if there is a problem ? i assume they will have the same name in the bios.
if i removed the good one and booted with a bad one would this cause a big problem ?

that's two silly questions
 
Last edited:

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
i like the idea of using two usb flash drives mirrored for booting - this my seem a silly question - if i have two identical sandisk flash drives how do i know which one to replace if there is a problem ? i assume they will have the same name in the bios.
if i removed the good one and booted with a bad one would this cause a big problem ?

that's two silly questions

You know what? That's a very good question. I'm afraid I don't have a solution for you.

If you remove the wrong drive, the worst case is that FreeNAS won't boot. Best case is that it'll boot and zpool status freenas-boot will show errors on the existing drive. In the latter case, it should be possible to just shut down, swap drives, reboot and rebuild.
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
Of course you can still shut down and try the other drive even if it doesn't boot with the first one.
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
Back to regular boot scrubs. Not unexpectedly from the observation with the 35 day interval, whatever figure N you put in the box for scrub interval, the scrub appears N+1 days after the last one; more an endearing eccentricity than a bug.
 

bmcclure937

Contributor
Joined
Jul 13, 2012
Messages
110
Questions about scheduling a scrub for the boot device. I am configuring my scheduled SMART tests and scrubs. I wanted to schedule a scrub of the boot device on the 1 and 16 of each month... but I cannot seem to create a scrub on a schedule for the boot device (from the Web GUI).
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Questions about scheduling a scrub for the boot device. I am configuring my scheduled SMART tests and scrubs. I wanted to schedule a scrub of the boot device on the 1 and 16 of each month... but I cannot seem to create a scrub on a schedule for the boot device (from the Web GUI).
You can't. Boot scrubs can only be set to "every N days", right in the Boot screen. The boot scrub is a totally different part of the FreeNAS system than the datapool scrubs. We have been round and round and round with this with the devs, and this is how they want it for some reason.

Mine is set to 5.

No other fine-grained control is available for boot scrubbing.
 

bmcclure937

Contributor
Joined
Jul 13, 2012
Messages
110
I found another thread and plan to configure a cron task to run the boot scrub on a schedule. Thanks, I will test this out to see how it works.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
I found another thread and plan to configure a cron task to run the boot scrub on a schedule. Thanks, I will test this out to see how it works.
What problem is it that you're trying to solve?

Scrubbing the boot pool takes literally a couple minutes. You can set it for anything from 1 day apart, to monthly, whatever. In what way are you finding this insufficient to your needs, out of academic curiosity?
 

bmcclure937

Contributor
Joined
Jul 13, 2012
Messages
110
What problem is it that you're trying to solve?

Scrubbing the boot pool takes literally a couple minutes. You can set it for anything from 1 day apart, to monthly, whatever. In what way are you finding this insufficient to your needs, out of academic curiosity?

That does meet my practical needs just fine. I am simply trying to follow a schedule for the scrubs of boot device and pool because I sent scheduled emails. Would like to have the scrubs run and then send the scheduled emails.

As you mentioned, I could easily have the scrub of boot media run every single day and only send the email on the schedule I would like. As an alternative I found that I can run the zpool scrub via cron task and it works just as I would like.

Thanks!
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
One comment on mirroring boot devices, is that we should be able to simulate
scrubbing of the boot sector and grub stuff. Assuming 2 identical devices, (USB
or SATA DOM), a simply "dd" read of the appropriate blocks and compare. A bit
clumsy, but pretty straight forward to script.

I ran across a desire to verify my UFS boot blocks on Solaris SPARC, (disk blocks
1 - 15, but not block 0). There are times when you want to confirm it's both present
and valid for your OS update. In the end, I simply ran the "installboot" command,
instead of trying to figure out if my boot blocks were good.

Even without identical boot devices, it should still be possible to have some type
of verification.
 

Bidule0hm

Server Electronics Sorcerer
Joined
Aug 5, 2013
Messages
3,710
I found another thread and plan to configure a cron task to run the boot scrub on a schedule. Thanks, I will test this out to see how it works.

That does meet my practical needs just fine. I am simply trying to follow a schedule for the scrubs of boot device and pool because I sent scheduled emails. Would like to have the scrubs run and then send the scheduled emails.

@DrKK Exactly what I do and why I do it too ;)
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
I'm with you. As became abundantly clear when we cleared up the "mountroot" problem, the booting process actually has at least two important elements:

1) The first part is the pre-operating-system part, where the boot sector of the USB are read, and some amount of bootstrapping of some kind is done so that you can get to GRUB.
2) The second part, of course, is the mounting of the remaining system root as a zpool.

I don't see how having multiple devices helps you for the FIRST part. i.e., if your drive is corrupted in the boot sectors in the pre-operating-system portion of the process, it has no conception of a second (or third, or whatever) device, and so on and forth, so you'd be screwed there. So there's nothing you can do. But that's always been a risk on any boot device.

However, the second part, once the pair (or whatever) of devices mount in the FreeBSD context as a zpool, then you get all the advantages.

So I see:

No increase in the disadvantages/risk, and
Some increase in the advantages/win.

So that's a net win. So I'm a fan.

Do you see anything differently?

I apologise for dragging up such an old thread, but I've been happily running 2 devices (without errors) for at least 6 months, if not a year.
However, am I right in thinking, only one of these 2 devices is even bootable? Does the process of FreeNAS mirroring the key actually get ALL content from USB 1 and put it on to USB 2?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
FreeNAS doesn't mirror the key. ZFS does.

The ZFS bootstrap code is supposed to manage booting from a ZFS pool, even where there might be a device failure. The bigger question is what will the BIOS will do in certain failure situations, If one of the boot devices disappears completely, it seems likely that it'd move on to the second one and try it, so that works. However, if the first one is merely corrupted, and the boot loader can't be loaded, that is a situation where the BIOS might just say "Bad this-or-that, can't load OS" and halts.
 

diskdiddler

Wizard
Joined
Jul 9, 2014
Messages
2,377
Well that seems like semantics to me, be it ZFS or FreeNAS, the FreeNAS OS calls ZFS to perform the task.

My issue is indeed, the bootstrap code, the bootable flag, all the core stuff to making a key bootable. I've never tried to boot my machine with the 'cloned key' in it, without the other. It'd be dandy if it just works, I simply don't know.

Note: I'm not talking about the drive dropping out, what FreeNAS does while in use. I mean a USB key dies, the system is powered off and the bad USB key is removed. Does the other one boot, in full, seamlessly?
 
Status
Not open for further replies.
Top