Cannot export pool on Big Sur with zfs-2.1.0

All your general support questions for OpenZFS on OS X.

Cannot export pool on Big Sur with zfs-2.1.0

Postby theit » Mon Aug 30, 2021 2:32 am

Hi,

I'm seeing a strange error when I try to export my pool:
Code: Select all
admin@Thorstens-MBP ~ % zpool status -v     
  pool: rpool
 state: ONLINE
  scan: resilvered 19.1M in 00:00:04 with 0 errors on Tue Aug 24 11:06:38 2021
config:

   NAME                                            STATE     READ WRITE CKSUM
   rpool                                           ONLINE       0     0     0
     mirror-0                                      ONLINE       0     0     0
       media-D0B57E8D-EB8E-904D-9CCC-D06FC70F0113  ONLINE       0     0     0
       media-32C12AE0-135F-9242-8BD1-76595BB1FB18  ONLINE       0     0     0
       media-7242F2F5-6C89-1346-80BF-8476478B3A58  ONLINE       0     0     0

errors: No known data errors
admin@Thorstens-MBP ~ % sudo zpool export -a
Unmount failed for /Volumes/daten
umount(/Volumes/daten): Resource busy -- try 'diskutil unmount'
cannot unmount '/Volumes/daten': empty component or misplaced '@' or '#' delimiter in name
admin@Thorstens-MBP ~ %

I have to use the "-af" flag to successfully export the pool:
Code: Select all
admin@Thorstens-MBP ~ % sudo zpool export -af
Unmount successful for /Volumes/daten
admin@Thorstens-MBP ~ %


Does anybody know what's causing this behavior?

macOS: 11.5.2
OpenZFS 2.1.0 (x64)
theit
 
Posts: 21
Joined: Tue Oct 20, 2015 10:52 pm

Re: Cannot export pool on Big Sur with zfs-2.1.0

Postby lundman » Mon Aug 30, 2021 7:51 pm

Hmm that is most peculiar, can you show a "zfs list" so I can see names? The "@" usually refers to snapshots, but do you have any mounted?
User avatar
lundman
 
Posts: 1335
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: Cannot export pool on Big Sur with zfs-2.1.0

Postby theit » Tue Aug 31, 2021 4:51 am

lundman wrote:Hmm that is most peculiar, can you show a "zfs list" so I can see names? The "@" usually refers to snapshots, but do you have any mounted?

I know, but I don't have any snapshots created and don't use them ATM.
Anyway, here's the filesystem list ("zfs list -tall"):
Code: Select all
NAME          USED  AVAIL     REFER  MOUNTPOINT
rpool        3.18T   342G       96K  legacy
rpool/daten  3.18T   342G     3.18T  /Volumes/daten
theit
 
Posts: 21
Joined: Tue Oct 20, 2015 10:52 pm

Re: Cannot export pool on Big Sur with zfs-2.1.0

Postby theit » Thu Sep 02, 2021 9:58 am

I get the error again, but now when I try to change the mount point of a zfs dataset:
Code: Select all
thorsten@Thorstens-MBP ~ % zpool status -v
  pool: zroot
 state: ONLINE
status: One or more devices is currently being resilvered.  The pool will
   continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
  scan: resilver in progress since Thu Sep  2 19:52:20 2021
   19.4G scanned at 293M/s, 1.64M issued at 24.8K/s, 2.78T total
   0B resilvered, 0.00% done, no estimated completion time
config:

   NAME                                            STATE     READ WRITE CKSUM
   zroot                                           ONLINE       0     0     0
     mirror-0                                      ONLINE       0     0     0
       media-50977439-3F41-E94A-93BC-99AB0D31777B  ONLINE       0     0     0
       media-7242F2F5-6C89-1346-80BF-8476478B3A58  ONLINE       0     0     0
       disk2                                       ONLINE       0     0     0

errors: No known data errors
thorsten@Thorstens-MBP ~ % zfs list -tall
NAME          USED  AVAIL     REFER  MOUNTPOINT
zroot        2.78T   753G     3.07M  legacy
zroot/daten  2.78T   753G     2.78T  /Volumes/daten2
thorsten@Thorstens-MBP ~ % sudo zfs set mountpoint=/Volumes/daten zroot/daten
Unmount failed for /Volumes/daten2
umount(/Volumes/daten2): Resource busy -- try 'diskutil unmount'
cannot unmount '/Volumes/daten2': empty component or misplaced '@' or '#' delimiter in name

Any idea what could cause this strange behavior?
theit
 
Posts: 21
Joined: Tue Oct 20, 2015 10:52 pm

Re: Cannot export pool on Big Sur with zfs-2.1.0

Postby theit » Thu Sep 02, 2021 10:04 am

I also couldn't directly unmount the dataset:
Code: Select all
thorsten@Thorstens-MBP ~ % sudo zfs unmount zroot/daten
Unmount failed for /Volumes/daten2
umount(/Volumes/daten2): Resource busy -- try 'diskutil unmount'
cannot unmount '/Volumes/daten2': empty component or misplaced '@' or '#' delimiter in name
thorsten@Thorstens-MBP ~ % sudo zfs unmount -f zroot/daten
Unmount failed for /Volumes/daten2
umount: /Volumes/daten2: not currently mounted
cannot unmount '/Volumes/daten2': empty component or misplaced '@' or '#' delimiter in name
thorsten@Thorstens-MBP ~ % sudo zfs unmount -f zroot/daten
cannot unmount 'zroot/daten': not currently mounted
thorsten@Thorstens-MBP ~ % sudo zfs set mountpoint=/Volumes/daten zroot/daten

Notice the error message when unmounting with "-f", but obviously it was unmounted. Very strange.
Anyway, at least I could then change the mount point as intended originally...
theit
 
Posts: 21
Joined: Tue Oct 20, 2015 10:52 pm

Re: Cannot export pool on Big Sur with zfs-2.1.0

Postby lundman » Thu Sep 02, 2021 2:05 pm

Yeah we do seem to have an issue in this area.
User avatar
lundman
 
Posts: 1335
Joined: Thu Mar 06, 2014 2:05 pm
Location: Tokyo, Japan

Re: Cannot export pool on Big Sur with zfs-2.1.0

Postby srirangav » Thu Oct 07, 2021 10:10 am

Hi,

I recently had a similar issue when exporting pools on Big Sur on my M1 MacBook Air. For me, it occurs when I try to export a pool as a regular non-privileged user, but it does not occur when I use sudo, for example:

Code: Select all
sudo zpool export -a


Perhaps this is a permissions issue?

Best,

-ranga
srirangav
 
Posts: 6
Joined: Tue Aug 10, 2021 3:46 pm

Re: Cannot export pool on Big Sur with zfs-2.1.0

Postby theit » Thu Oct 07, 2021 9:49 pm

srirangav wrote:Hi,

I recently had a similar issue when exporting pools on Big Sur on my M1 MacBook Air. For me, it occurs when I try to export a pool as a regular non-privileged user, but it does not occur when I use sudo, for example:

Code: Select all
sudo zpool export -a


Perhaps this is a permissions issue?

Best,

-ranga

I always use "sudo zpool export -a" because I'm working as an unprivileged user.
OTOH I discovered a strange phenomenon:

I use ZFS as storage for a sparse disk image I'm using for Time Machine. Double-click in the Finder on the image to mount it so that Time Machine can backup what was changed. When TM is finished, unmount the image in the Finder by dragging it onto the trashcan. Exporting the pool via "sudo zpool export -a" doesn't work; a popup appears claiming that some files from the pool are still opened in some processes.

Open Disk Utility and you'll see that the sparse disk image for my TM backup is still listed there, the backup volume is only deactivated. Reactivate it again and unmount the image itself from within Disk Utility by clicking on the corresponding icon besides "Apple sparse bundle disk image Media". This takes lots of seconds until the image is finally (and fully) unmounted and not listed anymore, and only then can the pool be exported. Strange.

Tested on macOS Big Sur 11.6
theit
 
Posts: 21
Joined: Tue Oct 20, 2015 10:52 pm

Re: Cannot export pool on Big Sur with zfs-2.1.0

Postby srirangav » Wed Oct 13, 2021 5:40 pm

I've had strange issues with Time Machine backing up to sparsebundles. Have you tried looking for the process (or processes) that might be holding onto your sparsebundle using lsof (usually located /usr/sbin/lsof)?
srirangav
 
Posts: 6
Joined: Tue Aug 10, 2021 3:46 pm

Re: Cannot export pool on Big Sur with zfs-2.1.0

Postby theit » Mon Oct 25, 2021 11:19 am

srirangav wrote:I've had strange issues with Time Machine backing up to sparsebundles. Have you tried looking for the process (or processes) that might be holding onto your sparsebundle using lsof (usually located /usr/sbin/lsof)?

I'm not sure, but I guess it was some lsd process still running. Anyway, I'm actually using the disk utility way to unmount the sparse bundle when I want to export my pool because that at least WorksForMe(tm) ;-)
theit
 
Posts: 21
Joined: Tue Oct 20, 2015 10:52 pm


Return to General Help

Who is online

Users browsing this forum: No registered users and 31 guests