"HFS formatted ZVOL On ZFS", howto?

New to OpenZFS on OS X (Or ZFS in general)? Ask your questions here!

"HFS formatted ZVOL On ZFS", howto?

Postby nodarkthings » Thu Jun 22, 2017 5:24 am

Hi!
I've been using ZFS for a few years now, pools, datasets, and sparsebundles on them.
I've seldom seen mentioned "HFS formatted ZVOL On ZFS" (like here > https://openzfsonosx.org/wiki/FAQ#Q.29_Can_Time_Machine_backups_be_stored_on_ZFS.3F) but I don't get the procedure and can't find any info about it, anywhere included on this forum or on the FAQ.

So,
1) do I still have to start with the regular "sudo zpool create..." and then format the pool with Disk Utility? Or is it a different secret procedure?
2) then, must I fear any issue with an already partitioned disk with mixed HFS and ZFS partitions/pools on it? (or is it possible at all?)
3) is there any benefit compared to a sparsebundle on a ZFS volume?

Thanks for any clarification. ;)
nodarkthings
 
Posts: 72
Joined: Mon Jan 26, 2015 10:32 am

Re: "HFS formatted ZVOL On ZFS", howto?

Postby lundman » Fri Jun 23, 2017 4:10 pm

In ZFS, if you have a pool, you can create as many datasets, and as many ZVOLs, as you want. Dataset being a full ZFS filesystem, and ZVOL is a virtual hard disk volume, which you can use as you please.

To create a ZFS dataset you use
zfs create [ -o options ... ] pool/datasetname


To create a new ZVOL, of 100G in size
zfs create -V 100G [ -o options ... ] pool/zvolname


which will then create a new /dev/diskX node for you. You can't partition it, but you can format it as hfs/fat32/ntfs etc, as you please.

Note that creating its size as 100G does not immediately use 100G, usage will grow as you use blocks in your zvol. You can pre-reserve the 100G is you really wanted to, but that is generally only done when you put swap on a ZVOL (you don't want disk-full on a pageout request...) using the -o refreservation=100G option.

Naturally things like -o compression=lz4 still work on ZVOLs, which is very nice. Compressed hfs on a ZVOL is faster than hfs on the same disk. [1]

Lund


[1] made up, I have no idea.
User avatar
lundman
 
Posts: 363
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: "HFS formatted ZVOL On ZFS", howto?

Postby nodarkthings » Sat Jun 24, 2017 1:21 am

Thanks a lot! :)
I thought ZVOLs and Pools were different names for the same thing... :oops:

As I already use huge sparsebundles instead (to avoid a few issues I had when those volumes were datasets), would there be any benefit of reorganizing again my stuff with ZVOLs, or can I leave it out for now? Would there be any change, performancewise?
nodarkthings
 
Posts: 72
Joined: Mon Jan 26, 2015 10:32 am

Re: "HFS formatted ZVOL On ZFS", howto?

Postby nodarkthings » Sun Jun 25, 2017 5:56 am

Well, I can partially answer to myself, as I've done a few tests:

ZVOL vs Sparsebundle - size :
- sparsebundle created out of an existing 50 Gb HFS partition: 39.42 Gb; 50 Gb 'capacity' in Finder's info
- 40 Gb ZVOL: appears as 42.95 Gb in Disk Utility; 42,61 Gb 'capacity' in Finder's info

ZVOL vs Sparsebundle - speed :
- Copy of a 2.35 Gb folder
• ZVOL > HFS : 40s
• sparsebundle > HFS : 40s
• HFS > dataset : 40s
• HFS > ZVOL : 24s to 1mn
• HFS > sparsebundle : 41s

Conclusion: identical read speed but great variability for ZVOL write speed!
Sizewise, 6 Gb more for the sparsebundle (if created out of an existing HFS partition).

N.B.: I've tried to avoid any flaw in my testing procedure, repeating each test a few times to make them as consistent as possible...
nodarkthings
 
Posts: 72
Joined: Mon Jan 26, 2015 10:32 am

Re: "HFS formatted ZVOL On ZFS", howto?

Postby MacFormatik » Wed Jul 12, 2017 5:02 am

There are some issues i experienced using Zvols....

First one is this... which i never tested, so I don't know if its true.
http://jrs-s.net/2016/06/16/psa-snapsho ... han-zvols/

Second:
You can't shrink a Zvol after you used its space inside HFS....
with Sparsbundles you can shrink it back when the space is no longer needed.
User avatar
MacFormatik
 
Posts: 2
Joined: Sun May 01, 2016 7:25 am

Re: "HFS formatted ZVOL On ZFS", howto?

Postby nodarkthings » Wed Jul 12, 2017 5:51 am

Great! So 2 points for sparsebundles, I'd say. :D
nodarkthings
 
Posts: 72
Joined: Mon Jan 26, 2015 10:32 am


Return to Absolute Beginners Section

Who is online

Users browsing this forum: No registered users and 1 guest