March 14th build fails to mount encrypted filesystem

All your general support questions for OpenZFS on OS X.

Re: March 14th build fails to mount encrypted filesystem

Postby lundman » Wed Apr 07, 2021 5:57 pm

Heh amusingly, I just happened to have a "testpool" in my home dir, also called testpool, but with "encrypted" child.

./scripts/cmd-macos.sh zfs mount -l testpool
Enter passphrase for 'testpool':
cannot mount 'testpool': Unknown error: -1
User avatar
lundman
 
Posts: 1337
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: March 14th build fails to mount encrypted filesystem

Postby FadingIntoBlue » Wed Apr 07, 2021 6:01 pm

That explains that :)

A zpool status -v should give you the same error as I showed in my final check
FadingIntoBlue
 
Posts: 106
Joined: Tue May 27, 2014 12:25 am

Re: March 14th build fails to mount encrypted filesystem

Postby lundman » Wed Apr 07, 2021 6:57 pm

So far, it appears to be down to
Code: Select all
2021-04-07 19:56:51.722 Df kernel.development[0:191cc] (zfs) <zfs`spa_do_crypt_objset_mac_abd (dsl_crypt.c:0)> Comparing portable, with osp->portable:
2021-04-07 19:56:51.722 Df kernel.development[0:191cc] (zfs) <zfs`spa_do_crypt_objset_mac_abd (dsl_crypt.c:0)> 1c cc 53 10 3c f0 e7 da c0 35 73 98 5c a8 79 ed 1a 59 a3 c3 1b 21 00 94 7d ba 08 d3 b1 ad 2f 8b
2021-04-07 19:56:51.722 Df kernel.development[0:191cc] (zfs) <zfs`spa_do_crypt_objset_mac_abd (dsl_crypt.c:2712)> 1c cc 53 10 3c f0 e7 da c0 35 73 98 5c a8 79 ed 1a 59 a3 c3 1b 21 00 94 7d ba 08 d3 b1 ad 2f 8b
2021-04-07 19:56:51.722 Df kernel.development[0:191cc] (zfs) <zfs`spa_do_crypt_objset_mac_abd (dsl_crypt.c:0)> Comparing local, with osp->local:
2021-04-07 19:56:51.722 Df kernel.development[0:191cc] (zfs) <zfs`spa_do_crypt_objset_mac_abd (dsl_crypt.c:0)> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2021-04-07 19:56:51.722 Df kernel.development[0:191cc] (zfs) <zfs`spa_do_crypt_objset_mac_abd (dsl_crypt.c:0)> e7 69 1b 2f e8 e3 d3 34 f1 d7 0c 69 4e da 02 50 7a 5a 9b d1 40 e1 d6 b3 1d 67 73 ec 94 bd 95 cf
2021-04-07 19:56:51.722 Df kernel.development[0:191cc] (zfs) <zfs`zfsvfs_create (zfs_vfsops.c:759)> create 1out


digging deeper
User avatar
lundman
 
Posts: 1337
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: March 14th build fails to mount encrypted filesystem

Postby lundman » Wed Apr 07, 2021 7:01 pm

Due to
Code: Select all
    if ((datalen >= OBJSET_PHYS_SIZE_V3 &&
        osp->os_userused_dnode.dn_type == DMU_OT_NONE &&
        osp->os_groupused_dnode.dn_type == DMU_OT_NONE &&
        osp->os_projectused_dnode.dn_type == DMU_OT_NONE) ||
        (datalen >= OBJSET_PHYS_SIZE_V2 &&
        osp->os_userused_dnode.dn_type == DMU_OT_NONE &&
        osp->os_groupused_dnode.dn_type == DMU_OT_NONE) ||
        (datalen <= OBJSET_PHYS_SIZE_V1) ||
        (((intval & OBJSET_FLAG_USERACCOUNTING_COMPLETE) == 0 ||
        (intval & OBJSET_FLAG_USEROBJACCOUNTING_COMPLETE) == 0) &&
        key->zk_version > 0)) {
        bzero(local_mac, ZIO_OBJSET_MAC_LEN);
        printf("Is this why?\n");
        return (0);


As to which thing is true in that giant if....
User avatar
lundman
 
Posts: 1337
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: March 14th build fails to mount encrypted filesystem

Postby lundman » Wed Apr 07, 2021 7:12 pm

Code: Select all
 <zfs`zio_crypt_do_objset_hmacs (zio_crypt.c:0)> Fourth part is true

(((intval & OBJSET_FLAG_USERACCOUNTING_COMPLETE) == 0 0
(intval & OBJSET_FLAG_USEROBJACCOUNTING_COMPLETE) == 0) 1
key->zk_version > 0) 1



Ok, so it thinks OBJSET_FLAG_USERACCOUNTING_COMPLETE has not yet been set.
User avatar
lundman
 
Posts: 1337
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: March 14th build fails to mount encrypted filesystem

Postby lundman » Wed Apr 07, 2021 7:46 pm

OK, so I missed the init of the new projectquota, userobjquota, groupobjquota and projectobjquota.
So current build is broken.
The next build will set those up as expected, however, you will still fail to mount until those features are then also enabled on the pool:
However, once those features are enabled, you can not go back to 1.9.4. Test first.


Code: Select all
# zpool get all|grep quota                             
testpool  feature@project_quota          disabled                       local
testpool  feature@userobj_accounting     disabled                       local

# zpool set feature@userobj_accounting=enabled testpool
# zpool set feature@project_quota=enabled testpool

# echo "testpool" | zpool import -fld ~/ 12191251384201676454
1 / 1 keys successfully loaded

User avatar
lundman
 
Posts: 1337
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: March 14th build fails to mount encrypted filesystem

Postby lundman » Wed Apr 07, 2021 9:30 pm

I have posted zfs-2.0.0rc2-3-gbaec3413df
User avatar
lundman
 
Posts: 1337
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: March 14th build fails to mount encrypted filesystem

Postby FadingIntoBlue » Wed Apr 07, 2021 10:52 pm

Ok, I enabled the features, to good effect

% sudo zfs load-key testpool testpool
Enter passphrase for 'testpool':
% sudo zfs mount testpool
% df
/dev/disk0s1 1700608 2224 1698384 1% 83 1698384 0% /Volumes/testpool
% df
testpool/safe 1700368 1960 1698408 1% 78 1698408 0% /Volumes/testpool/safe


Next stop to try the new build. Thanks, that's great progress
FadingIntoBlue
 
Posts: 106
Joined: Tue May 27, 2014 12:25 am

Re: March 14th build fails to mount encrypted filesystem

Postby theit » Thu Apr 08, 2021 3:14 am

lundman wrote:I have posted zfs-2.0.0rc2-3-gbaec3413df

Hi, but that's not yet available for Big Sur, right?

With zfs-2.0.0-rc2 I'm seeing the following errors under Big Sur (11.2.3):
Code: Select all
~ % sudo zpool import -la
zpool_open_func: zpool_read_label returned error -1 (errno: 0 name: /private/var/run/disk/by-id/volume-85D67001-D93E-3687-A1C2-79D677F0C2E0)
zpool_open_func: zpool_read_label returned error -1 (errno: 0 name: /private/var/run/disk/by-id/media-C82AA85F-548D-4821-960C-9FCEA2B083D0)
zpool_open_func: zpool_read_label returned error -1 (errno: 0 name: /private/var/run/disk/by-id/media-5DAB017F-01AA-8145-8D0C-AE66858F61EF)
zpool_open_func: zpool_read_label returned error -1 (errno: 0 name: /private/var/run/disk/by-id/media-704F36FB-DA19-4BF1-9F89-4B0B17273D3C)
zpool_open_func: zpool_read_label returned error -1 (errno: 0 name: /private/var/run/disk/by-id/media-6B00BFB7-8D17-AB46-85A6-A008A5539E83)
zpool_open_func: zpool_read_label returned error -1 (errno: 0 name: /private/var/run/disk/by-id/media-7242F2F5-6C89-1346-80BF-8476478B3A58)
zpool_open_func: zpool_read_label returned error -1 (errno: 0 name: /private/var/run/disk/by-id/media-42CB6F36-4B54-5C41-AE87-0705578B65B0)
zpool_open_func: zpool_read_label returned error -1 (errno: 0 name: /private/var/run/disk/by-path/PCI0@0-SATA@1F,2-PRT0@0-PMP@0-@0:0)
zpool_open_func: zpool_read_label returned error -1 (errno: 0 name: /private/var/run/disk/by-path/PCI0@0-XHC1@14-@5:0)
zpool_open_func: zpool_read_label returned error -1 (errno: 0 name: /private/var/run/disk/by-path/PCI0@0-XHC1@14-@4:1)
zpool_open_func: zpool_read_label returned error -1 (errno: 0 name: /private/var/run/disk/by-path/PCI0@0-SATA@1F,2-PRT0@0-PMP@0-@0:1)
zpool_open_func: zpool_read_label returned error -1 (errno: 0 name: /private/var/run/disk/by-path/PCI0@0-SATA@1F,2-PRT0@0-PMP@0-@0:2)
zpool_open_func: zpool_read_label returned error -1 (errno: 0 name: /private/var/run/disk/by-path/PCI0@0-XHC1@14-@4:9)
zpool_open_func: zpool_read_label returned error -1 (errno: 0 name: /private/var/run/disk/by-path/PCI0@0-XHC1@14-@6:9)
zpool_open_func: zpool_read_label returned error -1 (errno: 0 name: /private/var/run/disk/by-serial/My_Book_1140-504C313332314C4147334C4E5248)
zpool_open_func: zpool_read_label returned error -1 (errno: 0 name: /private/var/run/disk/by-serial/Elements_107C-574343344533584350534856:9)
zpool_open_func: zpool_read_label returned error -1 (errno: 0 name: /private/var/run/disk/by-serial/Elements_107C-574343344533584350534856)
zpool_open_func: zpool_read_label returned error -1 (errno: 0 name: /private/var/run/disk/by-serial/APPLE_SSD_SM512E-S118NYACB06301:1)

Enter passphrase for 'zroot':
1 / 1 keys successfully loaded
cannot mount 'zroot/daten': Unknown error: -1


The whole pool (a simple 3-way-mirror of 4TB drives, btw) itself is encrypted and contains only one zfs volume (zroot/daten).

Catalina running on the same machine imports the pool without any problems...
theit
 
Posts: 21
Joined: Tue Oct 20, 2015 10:52 pm

Re: March 14th build fails to mount encrypted filesystem

Postby lundman » Thu Apr 08, 2021 3:51 am

rc2 is for Big Sur I believe. Check the values of the features flags
User avatar
lundman
 
Posts: 1337
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

PreviousNext

Return to General Help

Who is online

Users browsing this forum: No registered users and 17 guests