Sharing same ZFS pool between OSX, Windows and Linux

All your general support questions for OpenZFS on OS X.

Sharing same ZFS pool between OSX, Windows and Linux

Postby Albertdup » Sat May 09, 2020 7:17 pm

Hi everyone

I plan to transition all my data to ZFS raidz. I use Linux Mac and Windows 10 on the same machine and need to access this data on the same machine. Currently, it's been a nightmare as there is no file system apart from ZFS( I hope it works) that can access software raids from all operating systems. I currently have a software HFS+ RAID that I can access in Windows 10 with Macdrive 10 software, I can however not access it in Linux. I have to use a separate non-raid HDD formated as EXT4 to be accessible in all three operating systems. Again using drivers to make it possible for Windows and Mac to read and write to the EXT4 filesystem.

Operating Systems

Linux : Ubuntu 20.04, Version: zfs-0.8.3-1ubuntu12 zfs-kmod-0.8.3-1ubuntu12 (Using ZFS from the Ubuntu repo)
Mac : Catalina 10.15.2, Using OpenZFS, Version: zfs-1.9.4-0 zfs-kmod-1.9.4-0
Windows : Windows 10 Pro, Version: zfs-0.2.3-1 zfs-kmod-0.2.3-1

I have an external enclosure with 2x 1TB hard disk drives using USB3 or Thunderbolt that I can test with. The drives are empty. I have been able to create a ZFS pool in Linux using a unique id:

sudo zpool create -O casesensitivity=insensitive -O compression=lz4 -O atime=off -o ashift=12 raid2tbzsf ata-ST31000525SV_6VP2VP7W ata-ST31000525SV_6VP2VZAT

I used the "ls -lh /dev/disk/by-id/" command to get the unique id. My reasoning being that drive numbers change from OS to OS.

I am able to write to the mount point and the performance seems fine for raid 0, once I get everything sorted I will create a 6 Drive RAIDZ pool. I am however unable to mount the pool in Windows or Mac os.

I did a "sudo zpool export raid2tbzsf" before attempting to mount it in the other os.

When I try to import the pool in Windows command prompt started as Administrator. I get an error

zpool import
no pools available to import

zfs list
no datasets available

zpool status
no pools available

I have installed ZetaWatch on the Mac and when it detects the pool created in Linux it says "error importing pool raid2tbzsf cannot import 'raid2tbzsf' (unsupported version or wrong feature).

Any idea how I can make this work? I have these drives to test with so not concerned about data loss.

Thanks
Albert

EDIT: UPDATE

After some thinking, I wondered considering that Windows ZFS seems like the least feature-complete version I should rather create the pool in Windows. I destroyed the pool created in Ubuntu and created a new one in Windows. I can now read the pool in Windows, Mac and Linux, I still need to figure out permissions between Linux and Mac OSX, I don't want to chown the whole time. Files and folders created in Windows can be changed and accessed by both operating systems.

Thanks for your great work developers, this is going to make life so much easier.

Regards
Albert
Albertdup
 
Posts: 4
Joined: Sat May 09, 2020 4:20 am

Re: Sharing same ZFS pool between OSX, Windows and Linux

Postby Albertdup » Mon May 11, 2020 12:54 am

So I had my first Windows Blue screen pointing to ZFSIN.SYS happened when I was doing a zpool export to reboot the system.
Albertdup
 
Posts: 4
Joined: Sat May 09, 2020 4:20 am

Re: Sharing same ZFS pool between OSX, Windows and Linux

Postby robbrown99 » Mon Nov 30, 2020 4:05 pm

I'd also like to know whether this is possible.

I have a ZFS pool in my aging Mac Pro that I would like to share between OSX (El Capitan), and an ubuntu distro (Elementary, off Ubuntu 18.04 LTS)

Is is possible to share a pool between more than one OS with ZFS, or is the pool bound to one system or the other and has to be exported, then reimported? I'm not looking to run more than one OS at a time, only one OS to access the pool at any one time.
robbrown99
 
Posts: 18
Joined: Tue Jun 10, 2014 4:43 am

Re: Sharing same ZFS pool between OSX, Windows and Linux

Postby Jimbo » Mon Nov 30, 2020 9:59 pm

It is certainly possible. You do need to be careful though. You will need to create the pool with the lowest common set of features (e.g. create it on the least feature-complete platform) so that it can be read and written by all the other hosts.

You will also need to address the ownership differences between your different hosts (a common issue across *NIX-like systems) - things like user and group IDs.

You will also need to live with missing features and don't upgrade the pool or at least be very careful when enabling features (i.e. all platforms must support the feature).
Jimbo
 
Posts: 85
Joined: Sun Sep 17, 2017 5:12 am

Re: Sharing same ZFS pool between OSX, Windows and Linux

Postby Sharko » Wed Dec 02, 2020 3:33 pm

For a while I was moving a pool back and forth between FreeNAS 11.2 and OSX 10.14 via direct connect (USB); I found that yes, I had to export and re-import when moving between systems. Also, I had to use the -F flag when importing, since otherwise the importing system thought that the pool belonged to the other system.
Sharko
 
Posts: 142
Joined: Thu May 12, 2016 12:19 pm

Re: Sharing same ZFS pool between OSX, Windows and Linux

Postby Jimbo » Wed Dec 02, 2020 9:40 pm

I regularly move pools between Fedora and macOS. Just a side note, you should only need to use the -f switch if you didn't explicitly export the pool from the other host (e.g. you just shutdown instead or crashed). Explicit export on one host and import on another host should not require -f.

Cheers!
Jimbo
 
Posts: 85
Joined: Sun Sep 17, 2017 5:12 am

Re: Sharing same ZFS pool between OSX, Windows and Linux

Postby Sharko » Thu Dec 03, 2020 1:50 pm

Jimbo wrote:I regularly move pools between Fedora and macOS. Just a side note, you should only need to use the -f switch if you didn't explicitly export the pool from the other host (e.g. you just shutdown instead or crashed). Explicit export on one host and import on another host should not require -f.

Cheers!


Hmm, I always export explicitly for my pools directly connected via USB, and I always used to get the error message unless I used -f, even when going between Mac systems. But my use of -f is just automatic now on imports, so perhaps recent O3X versions are better in this regard.
Sharko
 
Posts: 142
Joined: Thu May 12, 2016 12:19 pm

Re: Sharing same ZFS pool between OSX, Windows and Linux

Postby lundman » Sat Dec 05, 2020 2:05 am

Normal import saves the hostid, and compare against it the next import. If you export, the hostid is not saved. "import -f" tells it to ignore the hostid differences.

Otherwise there is little difference. Especially if you intend to reboot, or shutdown. However, if you are to unplug it without rebooting, then you should definitely export first.
User avatar
lundman
 
Posts: 834
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan


Return to General Help

Who is online

Users browsing this forum: No registered users and 0 guests

cron