ZFS mountpoint problem

Hi,

This is probably an easy problem to fix, but I'm a bit confused. I'm running 8.1-RELEASE with raidz1. The problem is that when I'm trying to create zroot/usr/home/nez the mountpoint gets somehow wrong and the data isn't in my home anymore. It is probably due to linking on /usr/home and /home, but shouldn't zfs handle it?

Code:
$ zfs list
NAME                        USED  AVAIL  REFER  MOUNTPOINT
zroot                       187G  1.59T   611M  legacy
...
zroot/usr                   185G  1.59T  1.49G  /usr
zroot/usr/home              183G  1.59T   183G  /usr/home
...
When I try to create
Code:
$ sudo zfs create zroot/usr/home/nez

$ zfs list
NAME                        USED  AVAIL  REFER  MOUNTPOINT
zroot                       187G  1.59T   611M  legacy
zroot/usr                   185G  1.59T  1.49G  /usr
zroot/usr/home              183G  1.59T   183G  /usr/home
zroot/usr/home/nez         24.0K  1.59T  24.0K  /usr/home/nez

$ zfs get mountpoint
NAME                       PROPERTY    VALUE                      SOURCE
zroot                      mountpoint  legacy                     local
zroot/usr                  mountpoint  /usr                       local
zroot/usr/home             mountpoint  /usr/home                  inherited from zroot/usr
zroot/usr/home/nez         mountpoint  /usr/home/nez              inherited from zroot/usr

It mounts it automatically, but as you can see there's nothing there. And my home is empty. I would like to make these new pools so I can sharenfs only e.g. /usr/home/nez/videos etc. I assume it's only possible to zfs sharenfs only pools, not folders?

So what should I do to get pool for my home directory?

Thanks for your help.
 
Filesystems are mounted on top of folders. If the folder /usr/home/nez already exists and has stuff in it, creating a ZFS filesystem on top will "hide" the contents.

What you need to do:
Code:
# zfs destroy zroot/usr/home/nez
# mv /usr/home/nez /usr/home/nez.tmp
# zfs create zroot/usr/home/nez
# mv /usr/home/nez.tmp/* /usr/home/nez
# zfs create zroot/usr/home/nez

That will sort things out correctly for you. After that, you can set sharenfs on the zroot/usr/home/nez filesystem.

Note: everything works at the filesystem layer. There's only 1 ZFS pool on your system, and it's called "zroot".
 
  • Thanks
Reactions: nez
Back
Top