pfSense Gold Subscription

Author Topic: HOW TO: 2.4.0 ZFS Install, RAM Disk, Hot Spare, Snapshot, Resilver Root Drive  (Read 10145 times)

0 Members and 1 Guest are viewing this topic.

Offline kevindd992002

  • Sr. Member
  • ****
  • Posts: 401
  • Karma: +5/-0
    • View Profile
Ok, thanks.

So which between the two commands is better to make two copies of everything:

pkg upgrade -f

or

find / -exec touch {} \;

?

Offline stolid

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
I might be mistaken, but updating the file should cause ZFS to rewrite it.  The fastest/easiest way to update all of the files would be
Code: [Select]
find / -exec touch {} \;
On a fresh install, that should not take long at all.  And before first boot it won't really change any timestamps by much either.  The right answer would be to change the ZFS defaults, but I didn't go that far into the installer.
This won't really work. ZFS's ditto feature is filesystem block-based, so if you touch files, you'll just be updating some file metadata, not the file itself. You'd have to fully re-write (or copy and replace) each file on the system to get the ditto copies to be retroactively created all around.

Honestly, I think a mirror pool way less hassle and of course more effective.

I haven't tried ZFS on pfsense, so I can't speak specifically, but in general you have a couple options to apply copies=n to existing files for a ZFS pool (these same kinds of hacks would be needed if say you want to compress or dedup existing files after enabling those respective features [by the way, I wouldn't recommend dedup at all]:
  • Force all your files to rewrite fully (i.e. copy them somewhere and replace the originals)
  • Snapshot a pool dataset (assuming you didn't store files in the pool root which you shouldn't as the root of a pool can't be snapshotted), zfs send it somewhere (to the same pool, different dataset), then swap out the datasets if possible (maybe literally rename them, or just swap their mount points, then destroy the unneeded original dataset)

Offline kpa

  • Hero Member
  • *****
  • Posts: 1179
  • Karma: +131/-6
    • View Profile
Just wait for the next update to your pfSense system, the update will rewrite almost all of the base system files and then you can do the 'pkg upgrade -f' trick to reinstall the rest.

Offline NollipfSense

  • Jr. Member
  • **
  • Posts: 46
  • Karma: +0/-0
    • View Profile
I was thinking of creating a ZFS on a SSD 16GB and use another hard drive 320GB formatted UFS for data log collection. However, upon reading this: https://docs.oracle.com/cd/E19253-01/819-5461/gaynr/index.html  it appears that won't work as stated there:

"The root pool cannot have a separate log device."

So, UFS it is...unless, someone can share more info. I have had a bad experience with one disk "raid"...it was a Cloudbox 3TB drive...died just over a year so no warranty...waste of money.

Offline kpa

  • Hero Member
  • *****
  • Posts: 1179
  • Karma: +131/-6
    • View Profile
What the hell you need a separate ZIL device *) for on a firewall system? It makes sense on a very busy file server but a firewall system is mostly just idling on the disk I/O side.


*) The ZIL log is "ZFS intent log", used only for guaranteeing integrity and atomicity of synchronous writes on ZFS in case the system crashes.
« Last Edit: November 15, 2017, 07:31:45 am by kpa »