FreeNAS 11.2 create dataset with desired mount point

dpchrist

Dabbler
Joined
Dec 23, 2018
Messages
18
FreeNAS -> Help & Support -> Storage:

I have a FreeNAS 11.2 server and have created a pool. Next, I would like to create datasets and specify the mount point. For example, I would like to create the dataset my_pool/home and have it mounted at /home, rather than the default of /mnt/my_pool/home. I do not see the mountpoint property via the Storage -> Pools -> Add Dataset page (basic or advanced). Searching the User Guide, I did not find a relevant page.

Please advise.

David
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
You don't change the mount point within the NAS. FreeNAS handles that. The only thing that should matter is the sharing configuration. Why are you trying to change the mount point?
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
AFAIK, FreeNAS does not allow users to set the mountpoint property--everything goes under /mnt. But like Chris, I'm unsure why it matters.
 

dpchrist

Dabbler
Joined
Dec 23, 2018
Messages
18
Thank you for replying.

I looked at Uncle Fester's guide, and have STFW and found other such introductory tutorials. Most, including Uncle Fester's, gloss over the issue of home directories by directing the reader to accept the default of /nonexistent.

The Linux and FreeBSD convention is that user home directories are placed under /home. I would like to follow that convention on my FreeNAS system.

Fundamentally, I expect a FOSS NAS distribution to allow me to organize the file system however I please.

David

p.s. I have created a issue requesting that "mountpoint" be added to the Add Dataset page:

https://redmine.ixsystems.com/issues/66495
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
The Linux and FreeBSD convention is that user home directories are placed under /home. I would like to follow that convention on my FreeNAS system.
You can create a separate dataset to keep your home directories in, but you can't mount them anywhere other than under the /mnt directory.
If you want to do it differently, you probably need to setup your own server instead of using a NAS.
 

dpchrist

Dabbler
Joined
Dec 23, 2018
Messages
18
I wiped my pool and created a new pool "tracy_p0".

I then used the web UI -> Shell to create two datasets:

Code:
[root@freenas ~]# zfs create tracy_p0/tracy_ds0
[root@freenas ~]# zfs create -o mountpoint=/home tracy_p0/tracy_ds0/home


I then used the web UI -> Storage -> Pools -> Add Dataset to create one more dataset "tracy_ds0/home/dpchrist".

I then used the web UI -> shell to mount the datasets:

Code:
[root@freenas ~]# zfs mount


tracy_p0/tracy_ds0 is mounted at /mnt/tracy_p0/tracy_ds0 as expected.

tracy_p0/tracy_ds0/home is mounted at /mnt/home -- I was expecting /home.

tracy_p0/tracy_ds0/home/dpchrist is mounted at /mnt/home/dpchrist -- I was expecting /home/dpchrist.

I then used the web UI -> Shell and 'zfs list', 'zfs get', 'zfs unmount', 'zfs set', 'zfs mount', etc., but tracy_p0/tracy_ds0/home is still mounted at /mnt/home and tracy_p0/tracy_ds0/home/dpchrist is still mounted at /mnt/home/dpchrist.

So, it seems the mountpoint property is always prefaced with "/mnt". Is this a configurable setting that I can change? (E.g. in zfs(8)? Python middleware?)

David
 
Last edited:

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
You are not supposed to work around it. You are supposed to go through the GUI and not try to circumvent it. Any modifications you make at the command line may not even survive a reboot. The pool is dismounted and remounted through the boot cycle and the entire configuration is loaded from the configuration database which is configured from the GUI. If you want to make a setting that stays, you do it through the GUI.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Last edited:

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Here is a video that goes over setting up users and accounts, but you have got to quit thinking that you have a choice where /home is going to live. It must be inside the pool and the pool is always mounted at /mnt

https://www.youtube.com/watch?v=2zVih_VuGWY
 

dpchrist

Dabbler
Joined
Dec 23, 2018
Messages
18
grep'ing the file system, I see hard-coded instances of 'zpool import ... -R /mnt ...' in several places:

Code:
root@freenas[~]# egrep -r 'zpool import .*-R /mnt' /[a-ce-v]* 2>/dev/null | egrep -v 'log|Binary'
/conf/base/etc/ix.rc.d/ix-zfs:            [ -e /data/zfs/zpool.cache.saved ] && /sbin/zpool import -c /data/zfs/zpool.cache.saved -o cachefile=none -R /mnt -f ${vol_guid} || /sbin/zpool import -o cachefile=none -R /mnt -f ${vol_guid}
/conf/base/etc/ix.rc.d/ix-zfs:            /sbin/zpool import -o cachefile=none -R /mnt -f ${vol_name}
/etc/ix.rc.d/ix-zfs:            [ -e /data/zfs/zpool.cache.saved ] && /sbin/zpool import -c /data/zfs/zpool.cache.saved -o cachefile=none -R /mnt -f ${vol_guid} || /sbin/zpool import -o cachefile=none -R /mnt -f ${vol_guid}
/etc/ix.rc.d/ix-zfs:            /sbin/zpool import -o cachefile=none -R /mnt -f ${vol_name}
/usr/local/www/freenasUI/middleware/notifier.py:            imp = self._pipeopen('zpool import -f -R /mnt %s' % id)
/usr/local/www/freenasUI/middleware/notifier.py:            imp = self._pipeopen('zpool import -f -R /mnt %s' % name)


'/mnt' may appear in other contexts that my searches did not find. Not all of the instances I did find may apply to ZFS.

So, a work-around would entail finding all instances of '/mnt' related to ZFS, converting the string literals into variables, and moving the '/mnt' value into a configuration file readable by all languages used. Then, validating it all.

David
 
Last edited:

dpchrist

Dabbler
Joined
Dec 23, 2018
Messages
18
Any modifications you make at the command line may not even survive a reboot. The pool is dismounted and remounted through the boot cycle and the entire configuration is loaded from the configuration database which is configured from the GUI. If you want to make a setting that stays, you do it through the GUI.

A killer feature of ZFS is that properties for ZFS pools, datasets, etc., are stored inside the ZFS storage devices. "mountpoint" is one of the default ZFS dataset properties. The 'zpool import' commands I found above use this property, so the changes I made via the Shell are preserved across a reboot:

root@freenas[~]# zfs list -r tracy_p0/tracy_ds0
NAME USED AVAIL REFER MOUNTPOINT
tracy_p0/tracy_ds0 384K 2.55T 128K /mnt/tracy_p0/tracy_ds0
tracy_p0/tracy_ds0/home 256K 2.55T 128K /mnt/home
tracy_p0/tracy_ds0/home/dpchrist 128K 2.55T 128K /mnt/home/dpchrist

Did you say that you read the manual?

I previously read the Accounts -> Users section of the Users Guide.

Here is a video that goes over setting up users and accounts ...

I previously searched YouTube and watched several videos (that one looks familiar).

David
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
I wiped my pool and created a new pool "tracy_p0". ...

tracy_p0/tracy_ds0/home/dpchrist is mounted at /mnt/home/dpchrist -- I was expecting /home/dpchrist.

David

@dpchrist A zpool list would show you that your main pool "tracy_p0" was mounted with an ALTROOT of /mnt, which is part of the FreeNAS design that imports main pools using the "-R" option. Apart from convention/expectation is there any practical reason why home directories mounted at /mnt/<pool name>/home can't work for you?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Fundamentally, I expect a FOSS NAS distribution to allow me to organize the file system however I please.
I don't think your expectation is reasonable in this regard. FreeNAS runs with the web GUI, which greatly simplifies administration for the user, but also reduces flexibility. If you want complete control over everything, FreeNAS probably isn't for you--just install FreeBSD and have at it.

Second, FreeNAS is, well, a NAS--network-attached storage. Users ssh-ing into the machine on a regular basis is probably a bit out of scope. For shared storage, NFS is the only place where the filesystem path is exposed to clients at all.

So, no, there's no way to get there from here. But not to put too fine a point on it, why do you care?
 

dpchrist

Dabbler
Joined
Dec 23, 2018
Messages
18
A zpool list would show you that your main pool "tracy_p0" was mounted with an ALTROOT of /mnt, which is part of the FreeNAS design that imports main pools using the "-R" option

You are correct:

Code:
root@freenas[~]# zpool list
NAME           SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
freenas-boot  14.5G   763M  13.8G        -         -      -     5%  1.00x  ONLINE  -
tracy_p0      5.44T  31.9M  5.44T        -         -     0%     0%  1.00x  ONLINE  /mnt


Apart from convention/expectation is there any practical reason why home directories mounted at /mnt/<pool name>/home can't work for you?

I understand that there are balances between flexibility and convenience, power and risk, time and money, etc., but as I have learned various systems over the years and approached the limits of their envelope, systems with artificial limitations usually prevent me from maximizing their potential.

I have filed a feature request to make ALTROOT a configurable option:

https://redmine.ixsystems.com/issues/66576

I don't think your expectation is reasonable in this regard. FreeNAS runs with the web GUI, which greatly simplifies administration for the user, but also reduces flexibility. If you want complete control over everything, FreeNAS probably isn't for you--just install FreeBSD and have at it.

It is not uncommon for noobs to see the elephants in the living room that the old timers have been conditioned to accept. This can be viewed as an opportunity to shoot the elephants, shoot the noobs, shoot the old-timers, blow up the living room, or some combination thereof. I prefer to invest myself in projects that are willing to accept criticism and make changes to improve.

Second, FreeNAS is, well, a NAS--network-attached storage. Users ssh-ing into the machine on a regular basis is probably a bit out of scope. For shared storage, NFS is the only place where the filesystem path is exposed to clients at all.

I view FreeNAS as FreeBSD with a slick web UI on top that makes system administration better, faster, and cheaper, especially for file-server related tasks. But, while FreeNAS may dumb things down for simple use-cases, it should not preclude advanced use-cases. The fact that the FreeNAS web UI provides a root shell and the ability to enable root SSH logins indicates that the FreeNAS project supports this principle at some level.

David
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
I view FreeNAS as FreeBSD with a slick web UI on top that makes system administration better, faster, and cheaper, especially for file-server related tasks. But, while FreeNAS may dumb things down for simple use-cases, it should not preclude advanced use-cases. The fact that the FreeNAS web UI provides a root shell and the ability to enable root SSH logins indicates that the FreeNAS project supports this principle at some level.
David
I don't think that is right. FreeNAS is considered an appliance which is built using FreeBSD. It is customizable to a point - but it is what it is.

What do you want to accomplish by putting /home in some custom place? I am curious to know what I might be missing.
 

dpchrist

Dabbler
Joined
Dec 23, 2018
Messages
18
I view FreeNAS as FreeBSD with a slick web UI on top that makes system administration better, faster, and cheaper, especially for file-server related tasks.

I don't think that is right.

I now realize that you (and others) are correct, and that I had a fundamental mental disconnect -- FreeNAS is not "FreeBSD with a slick UI on top". I would do better to view FreeNAS as a fork of FreeBSD -- reduced and re-configured into an embedded NAS appliance OS with its own unique design. I must stopping thinking about FreeNAS like it was FreeBSD, and instead climb the FreeNAS learning curve.

I apologize for the distraction. Thank you, everyone, for helping me.

David
 
Top