Solved A second home folder created under /mnt on FreeBSD 14.2 install

I have noticed that when I install FreeBSD 14.2 with root-on-ZFS, a second home folder gets created under /mnt as /mnt/home/<user name>. I have seen this happening on two separate computers and on a virtualbox installation. This second home folder does not seem to be used (it is empty) and deleting it seems to cause no problems. I have not seen this happening with previous FreeBSD releases. Am I the only one seeing this behavior? Is that second home folder getting created on purpose/should I keep it?
 
Hi,
I did an installation in VM to check your saying and just like you I end up with an empty home directory in /mnt , that's unusual.
Code:
root@fbsd14:~ # find / -type d -name home
/mnt/home
/home
I think it deserves a bug report, if you don't/can't do it, I will report it this week-end.
 
I can confirm it as well. Did a new install of 14.2 RELEASE on ZFS earlier this week and have the mystery home folder also under /mnt.
Haven't done anything with it yet. Just watching it.
 
14.1-RELEASE and 15-CURRENT are affected as well (checked in VMs). Both branches create a /mnt/home/<user> mount point when adduser(8) is executed during the installation phase and the created ZFS is mounted on /mnt.
Code:
 # zfs list -o name,mountpoint  zroot/home/jane
NAME                MOUNTPOINT 
zroot/home/jane     /mnt/home/jane

/var/log/bsdinstall_log
Rich (BB code):
DEBUG: zfs_create_boot: zpool create -o altroot=/mnt -O compress=lz4 -O atime=off -m none -f "zroot"   ada0p2
 
Last edited:
  • Thanks
Reactions: drr
I noted something like this with 14.2-RC1 / and -RELEASE when choosing to enable ZFS encryption of the home directory via adduser (installer or after the fact). I created a bugzilla report for this and notified the release manager; the current step being taken is documentation; admins must deal with the key manually after creating the user/install.

After creating a user with encryption, rebooting, a /home/user directory is accessible but it is empty; the encrypted homedir with templated dotfiles will be listed by zfs list but is of course not mounted.
 
  • Like
Reactions: drr
14.1-RELEASE and 15-CURRENT are affected as well (checked in VMs). Both branches create a /mnt/home/<user> mount point when adduser(8) is executed during the installation phase and the created ZFS is mounted on /mnt.
Do we have a separate bug report for this already? Did I create a duplicate?

If adduser is creating this directory during install, I am wondering where is the actual home directory coming from! After reboot, I do have a proper home directory zroot/home/<username> mounted as my home.
 
I noticed a /home dir under /mnt on my 14.2-R server, but not sure where it came from and thought I made a mistake with a command.

I don't recall /mnt/home existing after installing with ZFS root (didn't check immediately after install) but think it appeared either after I mounted a 2nd drive (formatted to ZFS manually post-install), or mounted a 3rd non-ZFS (NTFS) drive.

The 2nd ZFS drive is under /NAS (not /mnt), but the 3rd NTFS drive is under /mnt/NAS2.
 
Do we have a separate bug report for this already? Did I create a duplicate?
I don't believe there is another PR addressing this issue, at least I didn't spot one.

If adduser is creating this directory during install, I am wondering where is the actual home directory coming from! After reboot, I do have a proper home directory zroot/home/<username> mounted as my home.
The actual home directory is defined by the users dataset "mountpoint=/home" property, with resulting /home/<user> mount points.

After the pool is created, the zroot/home dataset has this property set on creation:
Rich (BB code):
2024-12-18.21:32:41 zfs create -o mountpoint=/home zroot/home
That property is inherited by the users child dataset of zroot/home when adduser(8) creates it.

The creation of /mnt/home/<user> mount points is due to the fact that the created pool is mounted on the alternate root directory /mnt during system installation ( non-permanent "altroot" property, see zpoolprops(8)).
Rich (BB code):
2024-12-18.21:32:41 zpool create -o altroot=/mnt -O compress=lz4 -O atime=off -m none -f zroot ada0p2
After the installation is complete, the rebooted system mounts all data sets at the mount points previously created, defined by “mountpoint” property.

I'm not sure if the FreeBSD developers want to address the problem.

For example, when the "mountpoint" property changes the old mount point remain as well.
Rich (BB code):
 # zfs create -o mountpoint=/test  zroot/test

# zfs list -o name,mountpoint  zroot/test
NAME        MOUNTPOINT
zroot/test  /test

 # ls -F / | grep test
test/

 # zfs set mountpoint=/test-test zroot/test

 # zfs list -o name,mountpoint  zroot/test
NAME        MOUNTPOINT
zroot/test  /test-test

 # ls -F / | grep test
test/
test-test/

HAPPY NEW YEAR TO ALL
 
Back
Top