Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Cannot unlock a folder

I cannot unlock a folder I created and locked. In Unix I see the directory is owned by "503", whereas the other folders are owned by me "GWS". Padlock is not active. Get info permissions shows "fetching..." in the first section. I am also admin on the laptop as "GWS". The behavior is the same when restarted in safe mode. OS 11.5.1, running on Apple silicon (M1).


How can I unlock this folder and get it back to myself as owner?


Thanks for reading, and extra thanks if you can help!

MacBook, OS X 10.11

Posted on Jun 3, 2022 7:00 AM

Reply
Question marked as Best reply

Posted on Jun 11, 2022 2:42 AM

SOLVED!


I am indebted to Linc Davis who, on Dec 18, 2014 in response to a similar or perhaps identical problem, solved mine! Please see the link below to the problem and his solution to mine! Bed sure to read the warnings at the beginning of his response.


Repairing permissions when owner is "Fetc… - Apple Community


I'm happy and grateful to join the thousands of users in this community who have been rescued by Mr Davis. Thank you.


Similar questions

10 replies
Question marked as Best reply

Jun 11, 2022 2:42 AM in response to Gary Sears

SOLVED!


I am indebted to Linc Davis who, on Dec 18, 2014 in response to a similar or perhaps identical problem, solved mine! Please see the link below to the problem and his solution to mine! Bed sure to read the warnings at the beginning of his response.


Repairing permissions when owner is "Fetc… - Apple Community


I'm happy and grateful to join the thousands of users in this community who have been rescued by Mr Davis. Thank you.


Jun 5, 2022 7:10 AM in response to VikingOSX

Thanks, VikingOSX, but it failed as "operation not permitted". It's possible I messed up the syntax, but I tried it twice.


I control-clicked my user in System Preferences > Users and Groups and see that I am user 503 and group staff.


I checked the other users similarly and find there is no user 505, yet the file is owned by 505.


Here's the file:

drwxr-xr-x@ 3336 505  staff   106752 Oct 13  2021 Antiques Inventory Pictures


I confirmed there is no user 505 using

id 505 -F


Result:

id: 505: no such user


Alas.


Thank you for your time and suggestion!


Regards,

Gary


Jun 5, 2022 10:20 AM in response to Gary Sears

You may have a Catch-22 issue with the folder being locked and it having a different owner uid that is not on your Mac. Can't change the owner ID on the folder because it is locked, and cannot unlock it without being the real owner.


Do the following on the folder (e.g. Desktop) that contains the Antiques Inventory Pictures folder folder:


ls -lO | egrep -i "schg|uchg"
-rw-r--r--@   1 viking  staff  schg      2861 May 18  2021 exif.txt



That will show you whether you have a system or user lock respectively on the folder. If it just returns to the Terminal prompt, then no lock was found on it. The former requires sudo to unlock, but in your case, the martian uid may block you from unlocking it.


Try the previous command again, this time recursively, note the (blue) colon separator in the chown command, and that the sudo password prompt echoes nothing you type:


# your username : your group name
sudo chown -R $(id -nu):$(id -ng) ./foldername
# if successful, then… remove system lock
sudo chflags -R noschg ./foldername

Jun 6, 2022 6:10 AM in response to VikingOSX

Hi -


The first command containing the egrep returned nothing.


Here's how I entered the 2nd command at the directory above the recalcitrant folder, which is named Antique Business:


sudo chown -R $(GWS -nu):$(staff -ng) ./Antique\ Business

-bash: GWS: command not found

-bash: staff: command not found

Password:


GLB-MacBook-Pro:~ GWS$


I filled in my password, but failed. Did I type the command incorrectly (judging by the errors for "GWS" and "staff")?


Here's the way the file still looks:


drwxr-xr-x@ 3336 505  staff   106752 Oct 13  2021 Antiques Inventory Pictures


As before I do appreciate your time and efforts.


Hoping I screwed up the command and the solution is now only a matter of typing it correctly.


Regards!


Jun 6, 2022 6:22 AM in response to Gary Sears

That ls command needed to be run in the same folder that contained your Antique\ Business folder. If you did that and it did not match either schg or uchg, then there is no System or user lock on that folder.


Wrong usage of the syntax.


The $(id -nu) returns your short name (e.g. GWS) and the $(id -ng) returns staff. You do not replace the command id with literal strings as you have done.

Jun 6, 2022 8:10 AM in response to VikingOSX

I was happy to learn I had misunderstood the command syntax as it presented the possibility that doing it correctly could still work. Alas, doing it correctly also failed:


GLB-MacBook-Pro:~ GWS$ sudo chown $(id -nu):$(id -ng) /Users/GWS/Antique\ Business/Antiques\ Inventory\ Pictures 

Password:

chown: /Users/GWS/Antique Business/Antiques Inventory Pictures: Operation not permitted

GLB-MacBook-Pro:~ GWS$


I know how to (temporarily) disable SIP, or perhaps I should become root. Do you think either of those methods could work?


Thanks and regards -

Cannot unlock a folder

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.