"you do not have sufficient access priviliges" on an external HD?

L

lush6

Guest
I have a hard drive that I use in an external case. It works great except when I forget to eject it before shutting down and disconnecting it. Then when I reboot, it takes a while to remount, with the seek light on the drive flashing for a good 15-30 minutes. I *think* it rebuilds the file system, but I don't really know. It works A-OK after that.

I was using it on an old iMac at my friend's place, and forgot to eject it before shutting the machine down and disconnecting the drive. Now, at a computer at school (eMac), I plugged it in, and two of the folders on the drive are unable to be accessed. It says that I do not have "sufficient access priviliges" to do anything with them... When I try to get info for them, it just says "retrieving" for size. Oh, and the seek light has been flashing for a good 45 minutes or so at this point, much longer than normal. The weird thing is that all the other folders on the drive can be accessed normally.

I'm hesitant to eject and remount the drive, as it would have to start the process of rebuilding the file system all over again (I think that's what it's doing), and that would be a waste of time.

What do you think I should do? The folder I need is the one that can't be accessed from this machine, of course.

eMac at school
External USB hard drive

Thanks!
 
Joined
Apr 29, 2006
Messages
4,576
Reaction score
378
Points
83
Location
St. Somewhere
Your Mac's Specs
Mac Studio, M1 Max, 32 GB RAM, 2 TB SSD
When you remove a drive without a final eject of the drive, there is no guarantee that you flushed any data that OS X may be holding in cache. Hence the file structure may be in an indeterminate state. So, when you replug it in, OS X has to completely examine the file system to make sure it is not corrupted. That is the seeking you see going on. What format is the hard drive in? HFS+ is supposed to be a journaling file system, which means it should only have to replay the last few journal entries to ensure that all is well. I suspect that yours is not set up for journaling. Open Disk Utility and examine the disk - take note of the file system type and report it back. You may wish to reformat it ultimately as HFS+ (Journaled) to help with your recovery times.

Re the permissions issue, I am guessing that this is a file ownership problem. OS X is a multi user OS, and so each file is stamped as being owned by the user who created it. When you create files on one Mac and then try to use them on another, it may not work, since the userids won't be the same. In this case, you will see some form of error just like you are reporting. Since OS X thinks the file belongs to someone else, it is not letting you at it - this is actually a nice security touch.

Now sometimes, it DOES work, if both computers only have one userid on them. This is because OS X will have chosen the same user ID identifier (a magic number that OS X actually uses when marking the file). These numbers typically start at 1000 for the first user and go up. So, two machines with just one user each will both be using 1000 as the user ID identifier (no matter what the identifier's name) and you will be able to seamlessly transfer files between them. You are taking advantage of a weakness here basically.

So, how do you fix things so that you can access the files and folder you are interested in? For the files in question, do the following. First, open a Terminal session (Terminal lives in the Utilities folder). Yes (fear and trepidation) command line magic follows. For each file / directory, issue the following magic command:

sudo chmod o+rw filename <-- for a file
sudo chmod o+rwx foldername <-- for a folder

What you have just done is tell OS X to allow "other users" (that is the "o" in the above commands) to have read/write (rw) or read/write/execute (rwx) access to the file/folder in question. As weird as it sounds, "execute" permission against a folder is what allows you to traverse into it.

This should resolve your issue allowing you to see and use the files and folders of interest. You may need to do this recursively, getting all the subfolders and files. I believe adding "-R" to each of the above commands, right after the o+rw part will do it.

Even better, if OS X will let you (I am not at my Mac and so can't test this) you can simply fix the root cause of the problem by changing the owner ID stamp to be your own. To do this, at the command line issue:

sudo chown -R youruserid: foldername

Note that this is case sensitive - capitalize the R in "-R". This will recursively ("-R") descend through the folder and change the ownership ("chown" = change owner - see, the command line isn't so bad after all) of all files and folders there to your userid. In this case, it is your actual userid you use, not the magic user ID identifier I mentioned above. So, if you mac userid was "lush6", you would enter:

sudo chown -R lush6: foldername

Give this a whirl and let us know if it fixes your issue.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top