Tournée des St-Hubert de Mylène et Denis!

Access disk with ZFS partition from Linux Ubuntu Server

Back to programming and computers menu

At some point I wanted to "convert" a home file server that was working with the Unix Free BSD system called "FreeNAS".
I wanted to convert that server to use Ubuntu Server.
Also, to make thing more "classic", I wanted my data drives to work with ext4 partition and not the ZFS complex, but probably better, file system.
To save time in moving the data, I realized it was possible with Ubuntu Server to read the data from these drives directly with ZFS file system.
This way, I could copy from the ZFS to the ext4 on the same machine.
This page is about how to do it.

First, from the terminal, we need to install ZFS support by typing:

sudo apt install zfs

Confirm the installation and wait.
Installing ZFS support

To know what can be imported, from the terminal, type sudo zpool import and see the result.
Checking what can be imported

If we attempt to import with...

sudo zpool import DRIVE04

...we will get the following message telling us it was coming from another system and we need to confirm we want to import anyway
Resulting of attempt to import

So as suggested, let’s import with -f parameter:

sudo zpool import DRIVE04 -f

So this time it worked:
The now working import action

We need to kinda mount that zfs disk.
I will create a directory with mkdir…

sudo mkdir /mnt/drive04

...and then set the mount point of the ZFS we’ve imported:

sudo zfs set mountpoint=/mnt/drive04 DRIVE04

Mounting the result

So now we may read an access the ZFS file system and like any other.
In my case, I was able to copy back from that source file to my targeted ext4 partition on another drive.
Back to programming and computers menu