I am having the same issue with canmount=on switching to canmount=noauto on a
user's dataset, and I'm using the final release of 19.10, so perhaps this will
help.

Version Details:
------------------------------------------------------------------------
v-eight# cat /etc/issue.net
Ubuntu 19.10

v-eight# dpkg -l zfs\* zsys | grep ^ii
ii  zfs-auto-snapshot 1.2.4-2           all          ZFS automatic snapshot 
service
ii  zfs-initramfs     0.8.1-1ubuntu14.2 amd64        OpenZFS root filesystem 
capabilities for Linux - initramfs
ii  zfs-zed           0.8.1-1ubuntu14.2 amd64        OpenZFS Event Daemon
ii  zfsutils-linux    0.8.1-1ubuntu14.2 amd64        command-line tools to 
manage OpenZFS filesystems
ii  zsys              0.2.2+19.04       amd64        ZFS SYStem integration


Here's how it all went down:
-------------------------------------
I did a full disk ZFS install, then I installed zsys.

I wanted an encrypted home dir, so I created a new dataset
(rpool/USERDATA/bfinley-encrypted) and copied all of my data into it.

    As a side note, I configured boot time decryption as per option 3 in
    chungy's HOWTO (https://github.com/chungy/zfs-boottime-encryption).  This
    is working great and keys are successfully loaded at boot time.  Also, a
    second encrypted non-homedir dataset I created at the same time is
    successfully mounted automatically
    (rpool/ROOT/ubuntu_rkiozo/var/lib/mlocate), and retains it's 'canmount=on'
    setting.


I then changed the mountpoint for the system created homedir dataset from
'/home/bfinley' to 'none'.

And changed the mountpoint for the new homedir dataset from
'/home/bfinley-encrypted' to '/home/bfinley' and set it to 'canmount=on'.

After rebooting, the mlocate dataset mounted automatically, but the homedir
dataset did not.  'zfs get keystatus rpool/USERDATA/bfinley' showed
'available', but 'canmount' had been changed to 'noauto'.

At this point, I could 'zfs set canmount=on rpool/USERDATA/bfinley' and do a 
'zfs mount -a', and it would mount.

But again, after reboot, 'canmount=on' was changed to 'canmount=noauto'.

So, I looked for other differences in the settings between the system created
homedir and new new one.  The system created homedir has these additional
settings:

    com.ubuntu.zsys:bootfs-datasets  rpool/ROOT/ubuntu_rkiozo
    org.zsys:bootfs-datasets         rpool/ROOT/ubuntu_rkiozo
    com.ubuntu.zsys:last-used        1577134248


Based on that discovery, I added the first to settings to my new dataset
(omitting the third, as I expected it would be added automatically via zsys) 
and rebooted.

    zfs set com.ubuntu.zsys:bootfs-datasets=rpool/ROOT/ubuntu_rkiozo 
rpool/USERDATA/bfinley
    zfs set org.zsys:bootfs-datasets=rpool/ROOT/ubuntu_rkiozo 
rpool/USERDATA/bfinley


After reboot, my new encrypted homedir was mounted automatically!

    As a side note, I took a look and 'com.ubuntu.zsys:last-used' was indeed
    automatically set with a timestamp.


SOLUTION and Conclusions
------------------------------------------------------------------------
1) I now have a solution to the problem at hand, and hopefully others do too.
   The solution summary for me was to set 'com.ubuntu.zsys:bootfs-datasets' and
   'org.zsys:bootfs-datasets' to my root dataset as above.

   NOTE:  If you are following this to fix your own system, your root dataset 
   will (almost certainly) have a different name.  To find it, you can do this:

    zfs list -r rpool/ROOT | grep -w /


2) Although it now works for me, I think we should consider the implementation 
   broken.  While it makes sense that zsys would look for certain ZFS User
   Properties to choose which datasets to act on, I don't think it should
   automatically change any dataset setting that is not a ZFS User Property
   that it "owns".

   Ideas to reconcile the behavior:

    - If canmount=noauto is required for zsys to do it's thing, and canmount is
      set to anything else, it should simply NOT do it's thing, and log a
      useful message to syslog.

    - Include a command to zsys-ize a dataset.  Something like:

        zsys set type=TYPE DATASET

            Where TYPE is the type of dataset, from a zsys perspective.
            Current options include: bootfs-datasets, none.

            Where DATASET is the name of the dataset for zsys to manage.

            Example:  zsys set type=bootfs-datasets
rpool/USERDATA/bfinley


Cheers!  -Brian

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1849179

Title:
  canmount property switches to noauto in user's home dataset

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/zsys/+bug/1849179/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to