pfSense Support Subscription

Author Topic: [ER] ZFS Root & Swap system disk  (Read 4151 times)

0 Members and 1 Guest are viewing this topic.

Offline daplumber

  • Jr. Member
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
[ER] ZFS Root & Swap system disk
« on: May 28, 2012, 04:51:26 pm »
I am a ZFS fanboi ever since I met it.  ::)  ;D  With that out of the way is there any chance of the ER? ZFS makes things like adding mirrored system disks, backup, snapshots, replication, etc. etc.all so easy and simple and does a darn good job on data protection even with a single disk. It might be a little heavy for embedded systems, but I doubt it. Someone with more embedded experience chime in? In any case that would probably best make it a selectable option on install?

I know pfsense is not a NAS, but ZFS does make NAS functionality ridiculously easy to implement, so why not? ZFS makes divorcing whatever you're implementing from low-level devices a breeze, at least as far a "disk" type devices go.
----------
This user has been carbon dated to the 8-bit era...

Offline rcfa

  • Sr. Member
  • ****
  • Posts: 565
  • Karma: +0/-0
    • View Profile
Re: [ER] ZFS Root & Swap system disk
« Reply #1 on: May 28, 2012, 05:23:50 pm »
How does native BSD 8.3 or 9 support for ZFS look like? i.e. can regular BSD boot from ZFS? What is the licensing?

I would think if BSD can do it, and it's "just" a matter of configuring pfSense to use it, it's one thing, but if it means putting proper ZFS support into BSD in the first place, it's likely a bit out there...

In general, I do agree though about the merits of ZFS, even on single-disk devices, and even modern embedded systems are so powerful that it shouldn't be an issue, RAM shortage is probably more of an issue than CPU power, but my little Lanner Atom-D510 based box can hold 4GB RAM, so it doesn't take a high-end system for that to be feasible, particularly since we're not talking about an environment with heave write loads.

Offline daplumber

  • Jr. Member
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Re: [ER] ZFS Root & Swap system disk
« Reply #2 on: May 28, 2012, 05:55:42 pm »
The kernel used by 2.1 already has the ZFS code and you can create non-root ZFS pools "out of the box". ZFS was in FreeBSD from 8.0 onwards (I think.)

ZFS boot/root support is quite good, and install appears to be a create-zfs-pool-and-root-and-swap-and-then-install-to-them process. The documentation in the wiki is pretty clear:

http://wiki.freebsd.org/RootOnZFS

I'd suggest GPT, just because MBR is evil and why would you be installing other OS' onto your pfsense disk? :

http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot

ZFS is no longer even trademarked by Oracle (as of September 2011), and is Open Source under CDDL (MPL-alike) which is FreeBSD-compatible as far as I know, unlike those GPL fanatics over in penguin-world.

If I knew a bit more about the pfSense and FreeBSD install process and/or had some time to dig into it I'd have a try at it myself, zfs is usually that easy, but alas...

Mirrored USB boot sticks would appear to be a good fit for pfSense as well?
----------
This user has been carbon dated to the 8-bit era...

Offline Feadin

  • Jr. Member
  • **
  • Posts: 68
  • Karma: +0/-0
    • View Profile
Re: [ER] ZFS Root & Swap system disk
« Reply #3 on: May 28, 2012, 07:17:35 pm »
AFAIK ZFS uses more resources. Can you name a clear benefit of having it as the main filesystem in pfSense?
Having a NAS or file server in a firewall is definitely not a good idea, see http://forum.pfsense.org/index.php/topic,10201.0.html.

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 14990
  • Karma: +4/-0
    • View Profile
Re: [ER] ZFS Root & Swap system disk
« Reply #4 on: May 28, 2012, 07:41:39 pm »
<sekrit>Boot CD, fire up web browser, go to /installer/ on the box, and use the web installer which can already do zfs for you</sekrit>
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline daplumber

  • Jr. Member
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Re: [ER] ZFS Root & Swap system disk
« Reply #5 on: May 29, 2012, 07:20:10 am »
<sekrit>Boot CD, fire up web browser, go to /installer/ on the box, and use the web installer which can already do zfs for you</sekrit>

One re-install coming up...  ;D
----------
This user has been carbon dated to the 8-bit era...

Offline rcfa

  • Sr. Member
  • ****
  • Posts: 565
  • Karma: +0/-0
    • View Profile
Re: [ER] ZFS Root & Swap system disk
« Reply #6 on: May 29, 2012, 12:59:41 pm »
<sekrit>Boot CD, fire up web browser, go to /installer/ on the box, and use the web installer which can already do zfs for you</sekrit>

One re-install coming up...  ;D

Tempting...

What version of zpool does it use? One great advantage would be that with zevo installed on Mac OS X, I could if need be access the file system from my Mac.

Since I'm still on CF cards, how intense is the write load of zfs compared to UFS, I mean in terms of wearing out the cards...

Offline rcfa

  • Sr. Member
  • ****
  • Posts: 565
  • Karma: +0/-0
    • View Profile
Re: [ER] ZFS Root & Swap system disk
« Reply #7 on: May 29, 2012, 01:03:56 pm »
<sekrit>Boot CD, fire up web browser, go to /installer/ on the box, and use the web installer which can already do zfs for you</sekrit>

I assume a memstick will work just as well, right?

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 14990
  • Karma: +4/-0
    • View Profile
Re: [ER] ZFS Root & Swap system disk
« Reply #8 on: May 29, 2012, 01:05:02 pm »
I don't know anything about the zfs version, it would be whatever is in the underlying OS.

And yes, memstick works too.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline daplumber

  • Jr. Member
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Re: [ER] ZFS Root & Swap system disk
« Reply #9 on: May 29, 2012, 08:22:29 pm »
<sekrit>Boot CD, fire up web browser, go to /installer/ on the box, and use the web installer which can already do zfs for you</sekrit>

One re-install coming up...  ;D

I guess there's a reason it's sekrit: It doesn't work!  :o

Seriously, there's php warnings in the 2.1 version and although both 2.1 and 2.0.1 create ZFS root systems, both of them get stuck on "mountroot>". I did a fair amount of tinkering, including noting that nether creates a /tmp, but nothing could persuade those installs to find their roots.

If anyone wants to tinker: When the zfs install is finished, you'll have to "zfs set mountpoint=/mnt tank0" and then tinker away on the new ZFS root under "/mnt" and then "zfs set mountpoint=legacy tank0" before you reboot.

I suspect I may be running afoul of the zfs cache somewhere, but that's just a guess.

One other thing to watch out for is that apparently 8.3 doesn't know how to write crash dumps to a zfs swap volume, so you'll have to stick with a swap partition for that.

Color me disappointed.  :'( ??? :( :-[

One more point: ZFS (when it's available) is wonderful in a fast paced development/test environment because the Boot Environment (BE, beadm) is basically bootable root filesystem thinly provisioned snapshots with the only restriction being available space, and they're essentially instantaneous to take!

I can't help wondering that given the essential BSD-ness of Solaris if it wouldn't be easier to implement pfSense on OpenIndiana? (http://openindiana.org/) Sigh. ZFS: it's crack for system and network administrators. Darn you big-O!  :P ;D
----------
This user has been carbon dated to the 8-bit era...

Offline rcfa

  • Sr. Member
  • ****
  • Posts: 565
  • Karma: +0/-0
    • View Profile
Re: [ER] ZFS Root & Swap system disk
« Reply #10 on: May 30, 2012, 01:51:53 am »
I don't know anything about the zfs version, it would be whatever is in the underlying OS.

Both BSD8.3 and Zevo 1.0.x use zpool version 28, so that's a good start.
There are other issues with mounting file systems, like how the file system is declared in the partition table, etc. but these things are relatively easy to fix, different, particularly newer (higher) zpool versions however would be a major obstacle. So at least that means it's conceptually feasible to mount a zfs pfSense file system in Mac OS X with Zevo installed.

Now, of course, that would mean a zfs install is doable in the first place...

Together with a drive that doesn't cheat when it comes to SMART statistics, ZFS makes a quite reliable solution even in a single-drive setup. So that would be very cool.

Could also be useful to have an external/additional drive exposed in a DMZ for non critical data, e.g. to remote-backup pictures while traveling, without poking file sharing holes through to the LAN.

Offline daplumber

  • Jr. Member
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Re: [ER] ZFS Root & Swap system disk
« Reply #11 on: May 30, 2012, 09:09:35 am »

Both BSD8.3 and Zevo 1.0.x use zpool version 28, so that's a good start.
There are other issues with mounting file systems, like how the file system is declared in the partition table, etc. but these things are relatively easy to fix, different, particularly newer (higher) zpool versions however would be a major obstacle. So at least that means it's conceptually feasible to mount a zfs pfSense file system in Mac OS X with Zevo installed.


Eh? There's always "legacy" for when you absolutely must have mounting not done automagically.

Partition tables should go the way of the dinosaur. A disk with a ZFS only with swap etc. as zfs volumes are not only more functional but easier to support if you're a low-level dev,
----------
This user has been carbon dated to the 8-bit era...

Offline rcfa

  • Sr. Member
  • ****
  • Posts: 565
  • Karma: +0/-0
    • View Profile
Re: [ER] ZFS Root & Swap system disk
« Reply #12 on: May 30, 2012, 11:49:09 am »

Both BSD8.3 and Zevo 1.0.x use zpool version 28, so that's a good start.
There are other issues with mounting file systems, like how the file system is declared in the partition table, etc. but these things are relatively easy to fix, different, particularly newer (higher) zpool versions however would be a major obstacle. So at least that means it's conceptually feasible to mount a zfs pfSense file system in Mac OS X with Zevo installed.


Eh? There's always "legacy" for when you absolutely must have mounting not done automagically.

Partition tables should go the way of the dinosaur. A disk with a ZFS only with swap etc. as zfs volumes are not only more functional but easier to support if you're a low-level dev,

Partition tables are here to stay, because e.g. EFI requires an EFI partition, otherwise the E in EFI goes away.
Not all partition tables are MBR ;)
The GPT that ZFS requires under BSD is also putting a partition table somewhere. The OS needs to know somehow what's on that disk, and until ZFS is the only file system an OS deals with, it needs a partition table to figure out what type of file system is present.
This has very little to do with swapping or not.
Besides, ZFS on OS X is a third party product because Apple dropped it like a hot potatoe after some patent troll company was about to sue them for billions of dollars if they were to adopt it. I hope in time these patents expire or are invalidated or the patent trolls go bankrupt, and Apple will get back into the ZFS game, but until then there is certainly no swapping to ZFS on OS X, because it's not an OS native file system.

Unfortunately, it just isn't as simple as it technically could be, because there's too much politics and greed in computing (or anywhere else for that matter).

Offline mhab12

  • Hero Member
  • *****
  • Posts: 648
  • Karma: +0/-0
    • View Profile
Re: [ER] ZFS Root & Swap system disk
« Reply #13 on: June 27, 2012, 04:35:50 pm »
Great to see that this is being discussed.  I'm the latest ZFS fan boy and am thrilled to see that it [might] well be in 2.1.

Offline survive

  • Jr. Member
  • **
  • Posts: 94
  • Karma: +0/-0
    • View Profile
Re: [ER] ZFS Root & Swap system disk
« Reply #14 on: June 28, 2012, 11:44:03 pm »
Hi guys,

I agree that the ability to install pfsense onto an all zfs filesystem would be fantastic.

It would be worth it just for the ability to set up mirrored drives alone, but there's also the ability to do snapshots.

-Will
« Last Edit: June 29, 2012, 08:57:03 pm by survive »