49

Sorry for asking an Ubuntu concerning question, but I hope that someone here has some experience with that.

I have to mount the zfs pool I created with freenas8 on Ubuntu. I tried as it was described in this archived Link. I was able to run this command without errors:

sudo zpool import data

and the status of my zpool is like this:

user@server:~$ sudo zpool status
  pool: data
 state: ONLINE
status: The pool is formatted using an older on-disk format.  The pool can
        still be used, but some features are unavailable.
action: Upgrade the pool using 'zpool upgrade'.  Once this is done, the
        pool will no longer be accessible on older software versions.
 scan: none requested
config:
    NAME        STATE     READ WRITE CKSUM
    data        ONLINE       0     0     0
      sda2      ONLINE       0     0     0
      sdb2      ONLINE       0     0     0

errors: No known data errors

so it looks good to me. but, i dont know how to access the pool. in my eyes i have to mount it, but i dont know how.

Cadoiz
  • 278
btzs
  • 593
  • 1
  • 4
  • 5
  • 1
    btw, you link was shorted so I could not follow it to have a look at the guide you were using, can you post the full link so we can fix this? – Bruno Pereira Apr 18 '12 at 13:37
  • 1
    Do not run zpool import pool. This will import your pools using /dev/sd? which will lead to problems the next time you rearrange your drives. Use zpool import -d /dev/disk/by-id data instead. – brettinternet Jan 25 '21 at 06:38

2 Answers2

39

If you run the command sudo zfs get all it should list all the properties of you current zfs pools and file systems. One of those properties, if correctly set, should be mountpoint=.

enter image description here

Zfs will mount the pool automatically, unless you are using legacy mounts, mountpoint tells zfs where the pool should be mounted in your system by default. If not set you can do so with

sudo zfs set mountpoint=/foo_mount data

That will make zfs mount your data pool in to a designated foo_mount point of your choice.

After that is done and since root owns the mount point you can change the owner of the mount with

sudo chown -R user:user /foo_mount

That will make the user user and the group user own the mount point and everything inside it, adjust the command to assign correct user:group privileges to the mount point.

Bruno Pereira
  • 73,643
  • Just to add, there is another property for datasets canmount which can either be on | off | noauto off and noauto prevent auto-mounting as well for individual datasets. For more info use man zfs. – Christian Ulbrich May 03 '17 at 21:11
20

I had a similar problem and, indeed, canmount was on but the pool+dataset didn't mount on boot nor when going online, etc.

My solution, after zpool import and zpool online the pool, was:

  1. zfs mount poolname

  2. zfs mount poolname/datasetname

Yes, zfs instead of zpool with the poolname and then poolname/datasetname.

Hope this help someone.

user23752
  • 301