Solved How to store /home/user data in other pool than system pool with "set mountpoint="?????

Hello, I am a newbie in FreeBSD and thus far I love FreeBSD more and more, especially because of the ZFS integration. But now I am stuck on a problem I do not understand.

I have two pools. A system pool called "rpool" on an SSD mirror and a data pool called "bigpool" on a bunch of Raid 10 HD's

Now I want to store my user directory on the HD's instead of on the SSD's

So I tried to arrange this as follows:

zfs set mountpoint=/home/user bigpool/home/user

and the result of zfs get mountpoint bigpool/home/user is:

NAME PROPERTY VALUE SOURCE
bigpool/home/user mountpoint /home/user local


So far so good. But when I try to rollback earlier created snapshots of "bigpool/home/user" that does not seem to be working. And when I try to see what data is in bigpool/home/user I get
Code:
No such file or directory
. And if I do zfs get logicalused bigpool/home/user after I generated with mkfile about 1 GB of files I get 44.5K as an answer.

So clearly those files are not written in the bigpool.

But also a rollback of rpool/ROOT/default does not work. And even when I delete all files I created with mkfile the logicalused size of rpool/ROOT/default stays exactly the same (7.46G)

So what am I doing wrong, or what do I not understand right of the working of "zfs set mountpoint"?

Anybody who can help me with this?
 
It's probably not mounted. zfs mount bigpool/home/user

No that is not it. When I try to mount bigpool/home/user it says: "filesystem already mounted"
I suppose I am doing something wrong with the creation of the mountpoint. But I can not anywhere find a step by step procedure how to do this in this specific situation
 
I suppose I am doing something wrong with the creation of the mountpoint.
One of the things I like about ZFS is that you only need a couple of commands. So there's very little to do wrong.

Basically it's these steps:
Code:
zfs create -o mountpoint=/some/where mypool/dir
zfs mount mypool/dir

I like to set the mountpoint at the creation stage, but you can also split them up:
Code:
zfs create mypool/dir
zfs set mountpoint=/some/where mypool/dir
 
zfs create mypool/dir
zfs set mountpoint=/some/where mypool/dir


This is exactly what I did. That is why I do not understand what is going wrong
 
Depending on how the mountpoint of mypool was defined mypool/dir may have inherited a different mount point. So after changing the mount point, for good measure, unmount and mount it again. This is why I typically set the mount point at creation time.
 
No that is also not the problem. When I immediately after I created the mypool/dir, do "get mountpoint" I get the following result

zfs get mountpoint bigpool/home/user
NAME PROPERTY VALUE SOURCE
bigpool/home/usr mountpoint /usr/home/user local


I thought that maybe I needed to use "/usr/home/user" as the mountpoint, but that even makes the problem worse. Now /bigpool/home/user does not exist and both /usr/home/user and /home/user are empty
When I use /home/user as mountpoint instead of /usr/home/user at least it is filled with data
 
Note that on FreeBSD /home is a symlink to /usr/home. So it's best to mount it under /usr/home/.

Code:
dice@armitage:~ % ls -ld /home
lrwxr-xr-x  1 root  wheel  8 Feb 24  2014 /home -> usr/home
dice@armitage:~ % mount | grep home
zroot/usr/home on /usr/home (zfs, local, noatime, nfsv4acls)

Make sure you're not mounting it on top of an existing mount point. (In my case that would be an additional dataset that's also mounted on /usr/home)
 
I finally succeeded in setting the mounting point from rpool/usr/home to bigpool/home.

Code:
zfs create bigpool/home
cp -prv /usr/home /bigpool/home       #copy the contents of the home folder to the bigpool folder
zfs set canmount=off rpool/usr/home       #disable the original home folder to mount
zfs set mountpoint=/usr/home bigpool/home   #set the mountpoint of bigpool/home to /usr/home
 
Back
Top