canmount property switches to noauto in user's home dataset

Bug #1849179 reported by Andreas Hasenack
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
zsys (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I can't be 100% sure about this, but I think anytime I have zsys installed and reboot, my user's dataset has its canmount property set to noauto.

That property is set to off in the parent dataset USERDATA:
$ zfs get canmount,mounted,mountpoint rpool/USERDATA
NAME PROPERTY VALUE SOURCE
rpool/USERDATA canmount off local
rpool/USERDATA mounted no -
rpool/USERDATA mountpoint / local

In mine, it's on:
$ zfs get canmount,mounted,mountpoint rpool/USERDATA/andreas_xk451a
NAME PROPERTY VALUE SOURCE
rpool/USERDATA/andreas_xk451a canmount on local
rpool/USERDATA/andreas_xk451a mounted yes -
rpool/USERDATA/andreas_xk451a mountpoint /home/andreas local

I then install zsys 0.2.2:
Get:1 http://br.archive.ubuntu.com/ubuntu eoan/universe amd64 zsys amd64 0.2.2 [1.303 kB]

And reboot.

When I login again, my home is gone, because the andreas_xk451a dataset is not mounted. Running zfs get again confirms that the canmount property changed back to noauto.

NAME PROPERTY VALUE SOURCE
rpool/USERDATA/andreas_xk451a canmount noauto local
rpool/USERDATA/andreas_xk451a mounted no -
rpool/USERDATA/andreas_xk451a mountpoint /home/andreas local

NAME PROPERTY VALUE SOURCE
rpool/USERDATA canmount off local
rpool/USERDATA mounted no -
rpool/USERDATA mountpoint / local

Since "noauto" isn't even the parent's setting, and the SOURCE of the property is marked as "local", something is doing it on purpose. My guess it's zsys, because after I remove it, this behavior stops.

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

I think the issue is that you installed before the final release, as the properties were renamed from `org.zsys` to `com.ubuntu.zsys` for property. As zsys isn't seeded by default, we were told to not migrate the handful of users having installed a pre-released.

Can you confirm that canmount is then correctly set to "on", once you rename the user's property?

Changed in zsys (Ubuntu):
status: New → Incomplete
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

(settings as incomplete until you confirm this is the issue)

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Correct, with the new property, it works correctly.

There is no way to get rid of the org.zsys one though, is there? Apparently there is no way to remove a user property in zfs.

Changed in zsys (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
satmandu (satadru-umich) wrote :

You can remove that property thus:

sudo zfs inherit org.zsys:bootfs-datasets rpool/USERDATA/<username>_<local_user_string>

Revision history for this message
Brian Elliott Finley (finley) wrote :
Download full text (4.3 KiB)

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:...

Read more...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.