Sunday, November 24, 2024

macos – How to remove this warning “lsof: WARNING: can’t stat() apfs file system”

At some point in the last few days I am getting an lsof warning for a shell script that’s been running every 60 seconds for over a year and has never returned this warning before. The only things I can think of are I ran df -h command yesterday to check on volume usage, and I also restored an application from a Time Machine backup recently.

lsof: WARNING: can't stat() apfs file system /Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/iMac191/2024-10-20-002526/iMac191_1TB - Data
      Output information may be incomplete.
      assuming "dev=320000af" from mount table

I can ignore the warning using the -w flag but I am more curious what has changed on my system that is causing it to appear rather than just ignoring this change. To gain knowledge. I don’t see much mention of this error on macOS. I also don’t want to exclude other warning messages I might receive.

The script is simply running lsof -i for internet connections so it’s confusing why lsof is reading the local file system at all. I can’t use the -e flag ( -e /Volumes) because it’s not implemented for macOS AFAIK, only Linux.

lsof -a -i -sTCP:LISTEN -lnP -p 1347 -p 25198 +c0 
lsof: WARNING: can't stat() apfs file system /Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/iMac191/2024-10-20-002526/iMac191_1TB - Data
      Output information may be incomplete.
      assuming "dev=320000af" from mount table
COMMAND      PID     USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
python3.12  1347      501    9u  IPv4 0x5db6dba5e634231a      0t0  TCP 127.0.0.1:8191 (LISTEN)
myprocess    25198      501  336u  IPv4 0x63cedb1e3e597770      0t0  TCP 127.0.0.1:9117 (LISTEN)


lsof -a -i -sTCP:LISTEN -wlnP -p 1347 -p 25198 +c0     
COMMAND      PID     USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
python3.12  1347      501    9u  IPv4 0x5db6dba5e634231a      0t0  TCP 127.0.0.1:8191 (LISTEN)
myprocess    25198      501  336u  IPv4 0x63cedb1e3e597770      0t0  TCP 127.0.0.1:9117 (LISTEN)

The mount point /Volumes/com.apple.TimeMachine.localsnapshots/… is the “high tidemark” of my Time Machine Snapshots:

com.apple.TimeMachine.2024-10-20-002526.local   1,826,162   9B9DC4DB-56B2-402B-B670-8D6851632231    Yesterday at 12:25 AM   431.2 GB (at block 105,273,999) *   3.82 GB (3,815,428,096 bytes)   3.82 GB (3,815,428,096 bytes)   Time Machine Snapshot

There is another similar question on apple.stackexchange here with no answer

UPDATE
I did a safe boot and reset PRAM and no the warning message is gone even though the same two TimeMachine volumes are mounted

comparison of df -h results

Yesterday

➜ df -h
Filesystem                                                     Size    Used   Avail Capacity iused ifree %iused  Mounted on
/dev/disk2s4s1                                                932Gi   9.9Gi   599Gi     2%    407k  4.3G    0%   /
devfs                                                         214Ki   214Ki     0Bi   100%     743     0  100%   /dev
/dev/disk2s2                                                  932Gi   2.2Gi   599Gi     1%    1.5k  6.3G    0%   /System/Volumes/Preboot
/dev/disk2s6                                                  932Gi   1.0Mi   599Gi     1%       1  6.3G    0%   /System/Volumes/VM
/dev/disk2s5                                                  932Gi   3.6Mi   599Gi     1%      23  6.3G    0%   /System/Volumes/Update
/dev/disk2s1                                                  932Gi   319Gi   599Gi    35%    1.8M  6.3G    0%   /System/Volumes/Data
/dev/disk9s1                                                  4.0Mi   676Ki   3.0Mi    19%      18   31k    0%   /System/Library/AssetsV2/com_apple_MobileAsset_PKITrustStore/purpose_auto/6dd55b0d06633a00de6f57ccb910a66a5ba2409a.asset/.AssetData
map auto_home                                                   0Bi     0Bi     0Bi   100%       0     0     -   /System/Volumes/Data/home
/dev/disk3s2                                                  3.6Ti   1.0Ti   2.6Ti    29%    1.6M   28G    0%   /Volumes/Backups of iMac191
com.apple.TimeMachine.2023-10-21-041621.backup@/dev/disk3s2   3.6Ti   253Gi   2.6Ti     9%    1.8M   28G    0%   /Volumes/.timemachine/3A8E0D9F-7C66-4F80-9705-0BE4DD0503D5/2023-10-21-041621.backup
//john@MacMini._smb._tcp.local/Godzilla                       7.3Ti   4.9Ti   2.4Ti    68%    661M  316M   68%   /Volumes/Godzilla
//john@MacMini._smb._tcp.local/Media_2                        5.5Ti   4.9Ti   560Gi    90%    1.3G  147M   90%   /Volumes/Media_2
//john@MacMini._smb._tcp.local/GodzillaClone                  7.3Ti   3.0Ti   4.3Ti    41%    399M  578M   41%   /Volumes/GodzillaClone
com.apple.TimeMachine.2024-10-19-142306.local@/dev/disk2s1    932Gi   318Gi   599Gi    35%    1.8M  6.3G    0%   /Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/iMac191/2024-10-19-142306/iMac191_1TB - Data

Today

Filesystem                                                     Size    Used   Avail Capacity iused ifree %iused  Mounted on
/dev/disk1s4s1                                                1000G     11G    637G     2%    407k  4.3G    0%   /
devfs                                                          220k    220k      0B   100%     745     0  100%   /dev
/dev/disk1s2                                                  1000G   2360M    637G     1%    1.5k  6.2G    0%   /System/Volumes/Preboot
/dev/disk1s6                                                  1000G   1069k    637G     1%       1  6.2G    0%   /System/Volumes/VM
/dev/disk1s5                                                  1000G   3793k    637G     1%      23  6.2G    0%   /System/Volumes/Update
/dev/disk1s1                                                  1000G    349G    637G    36%    1.8M  6.2G    0%   /System/Volumes/Data
/dev/disk9s1                                                  4194k    692k   3150k    19%      18   31k    0%   /System/Library/AssetsV2/com_apple_MobileAsset_PKITrustStore/purpose_auto/6dd55b0d06633a00de6f57ccb910a66a5ba2409a.asset/.AssetData
map auto_home                                                    0B      0B      0B   100%       0     0     -   /System/Volumes/Data/home
/dev/disk3s2                                                  4001G   1137G   2863G    29%    1.6M   28G    0%   /Volumes/Backups of iMac191
com.apple.TimeMachine.2023-10-21-041621.backup@/dev/disk3s2   4001G    272G   2863G     9%    1.8M   28G    0%   /Volumes/.timemachine/3A8E0D9F-7C66-4F80-9705-0BE4DD0503D5/2023-10-21-041621.backup
//john@MacMini._smb._tcp.local/Media_1                          18T     17T   1048G    95%    1.0G   64M   94%   /Volumes/Media_1
//john@MacMini._smb._tcp.local/Media_2                        6001G   5404G    597G    91%    1.3G  146M   90%   /Volumes/Media_2
//john@MacMini._smb._tcp.local/Godzilla                       8001G   5416G   2585G    68%    661M  316M   68%   /Volumes/Godzilla
//john@MacMini._smb._tcp.local/GodzillaClone                  8001G   3267G   4734G    41%    399M  578M   41%   /Volumes/GodzillaClone
com.apple.TimeMachine.2024-10-21-143554.local@/dev/disk1s1    1000G    348G    637G    36%    1.8M  6.2G    0%   /Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/iMac191/2024-10-21-143554/iMac191_1TB - Data

Related Articles

Latest Articles