Disk image creation fails on locked files and Time Machine backup failures?
I use hdutil to create backup images of project folders to be held offline/offsite as an extra precaution. Recently this process started to fail the culprit being a file that had been emailed and showed as [x] Locked in the file information.
I have only seen this since Sonoma but only got the rogue file a couple of weeks ago. I did see a message about Time Machine failing but looking at
% sudo tmutil listbackups
I can't see any gaps in the normal back up frequency.
Here is the evidence.
bp % /usr/bin/hdiutil create -fs HFS+ -srcfolder ./test -volname testVol ./Ltestdmg.dmg
......could not access /Volumes/testVol/test_lock.txt - Operation not permitted
hdiutil: create failed - Operation not permitted
bp % ls -l ./test
total 32
-rw-r--r-- 1 clive staff 29 3 Dec 12:02 test.1
-rw-r--r-- 1 clive staff 29 3 Dec 12:02 test.2
-rw-r--r-- 1 clive staff 29 3 Dec 12:02 test.3
-rw-r--r-- 1 clive staff 29 3 Dec 12:02 test_lock.txt
bp % rm ./test/test_lock.txt
override rw-r--r-- clive/staff uchg for ./test/test_lock.txt? y
rm: ./test/test_lock.txt: Operation not permitted
bp % ls -l ./test
total 32
-rw-r--r-- 1 clive staff 29 3 Dec 12:02 test.1
-rw-r--r-- 1 clive staff 29 3 Dec 12:02 test.2
-rw-r--r-- 1 clive staff 29 3 Dec 12:02 test.3
-rw-r--r-- 1 clive staff 29 3 Dec 12:02 test_lock.txt
# remove lock using getinfo
bp % rm ./test/test_lock.txt
bp % ls -l ./test
total 24
-rw-r--r-- 1 clive staff 29 3 Dec 12:02 test.1
-rw-r--r-- 1 clive staff 29 3 Dec 12:02 test.2
-rw-r--r-- 1 clive staff 29 3 Dec 12:02 test.3
bp % /usr/bin/hdiutil create -fs HFS+ -srcfolder ./test -volname testVol ./Ltestdmg.dmg
......
created: /Users/clive/CodeProjects/bp/Ltestdmg.dmg
bp % ls -l /Users/clive/CodeProjects/bp/Ltestdmg.dmg
-rw-r--r--@ 1 clive staff 19940 4 Dec 09:46 /Users/clive/CodeProjects/bp/Ltestdmg.dmg
bp % uname -a ; date
Darwin Clives-Mac-mini.local 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:28:12 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T8103 arm64
Mon 4 Dec 2023 09:48:28 GMT
[Re-titled by Moderator]
Mac mini (M1, 2020)