Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Problem moving /home to zfs pool

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
toquinho
Posts: 59
Joined: 2014-06-24 16:50
Been thanked: 1 time

Problem moving /home to zfs pool

#1 Post by toquinho »

I have just installed bullseye and set up an encrypted zpool. I use the bullseye version, not the one from the backports:

Code: Select all

root@TRILLIAN:~# zfs --version
zfs-2.0.3-9
zfs-kmod-2.0.3-9
I copied the contents of my old /home from my backup to the HOME dataset of the zpool (which is called hpool), and the dataset of the zpool with the contents of my old /home finds the encryption key file and mounts automatically when the system boots. I basically followed the procedure described here:


https://www.shernet.com/linux/zfs-home-directory/


The problem is the mount point, which I cannot change to /home. Before booting, I moved the /home that was created when I installed the computer to /home_bak.

The zfs pool and the home share look like this:

Code: Select all

root@TRILLIAN:~# zfs get all | grep mount
hpool       mounted               no                             -
hpool       mountpoint            none                           local
hpool       canmount              on                             local
hpool/HOME  mounted               yes                            -
hpool/HOME  mountpoint            /home                          local
hpool/HOME  canmount              on                             default
Overlay is on, and the pool is case sensitive:

Code: Select all

root@TRILLIAN:~# zfs get all | grep overlay
hpool       overlay               off                            local
hpool/HOME  overlay               on                             local
root@TRILLIAN:~# zfs get all | grep case
hpool       casesensitivity       sensitive                      -
hpool/HOME  casesensitivity       sensitive  
When booting, I get the following message in journalctl...

Code: Select all

Apr 02 00:23:49 TRILLIAN zfs-mount-generator: -.mount already exists. Skipping.
... and hpool/HOME ends up in /HOME regardless whether there is a directory /home or not before booting. It seems that /home gets created on system start if it is not present (i.e., after moving it to /home_bak). Nevertheless, I would expect the dataset to be mounted in /home because the overlay flag is on.

What is different in my configuration with respect to the one described in

https://www.shernet.com/linux/zfs-home-directory/

and other examples on the internet is that I do not have a separate dataset for each user, but one dataset called HOME where all user directories are. Moreover, I noticed that it does not matter if the zfs-load-key.service described in the link above is enabled or not. HOME finds the key file and gets mounted anyway.

If there is no way to mount the dataset directly to /home, would it be possible to replace the directory /home by a link to /HOME or may this break something I am not thinking of?

I think I remember trying to change the mount point of HOME to something different from /home and this worked. I.e., mounting HOME to /home seems to be the problem.

As always, any help is greatly appreciated.

Toquinho

Post Reply