I do not have sufficient privileges!

Discussion in 'Mac Basics and Help' started by InfiniteLoop, Nov 11, 2007.

  1. InfiniteLoop macrumors member

    Nov 13, 2005
    How annoying :mad: I am trying up create a back up copy of my home directory, my mac tells me some destination file is locked so it cannot be overwritten. I do not know how it got locked (whole bunch of files are locked), but whatever I try fails (when I try to change the ownership it asks for the admin password, I give it, then it says you do not have privileges to do that!). I do not have the privileges to change them. Very strange, I created those files by copying from my mac to an external HD. Any ideas how I can fix this?

    I cannot even delete the files. When I deleted them it put them all in the trash. But now I cannot empty trash because the files are locked! How can I get rid of those in my trash?
  2. InfiniteLoop thread starter macrumors member

    Nov 13, 2005
    OK, I was able to clean up the trash by doing this:

    sudo rm -rf /Volumes/250GB_2/.Trashes/501/My\ Pictures

    But how do i fix the locked files? If i do them one by one it works, but doing wholesale does not work :(
  3. InfiniteLoop thread starter macrumors member

    Nov 13, 2005
    Answering my own question, I found that the magic command is:

    sudo chflags -R nouchg /Volumes/250GB_1/My\ Pictures/

    This command clears the 'lock' flag from all files under My pictures. :)

    Why oh why it could not do this from Finder :mad:
  4. YunusEmre macrumors regular


    Nov 11, 2005
    Santa Clara, CA
    The Mac OS lock flag is used to lock files that you do not want to be overwritten by a new install. It does not make sense why user files are locked.
  5. Father Jack macrumors 68020

    Father Jack

    Jan 1, 2007
    I've always had to unlock them one at at time, but I'm sure someone will know a way to do a batch unlock .... :confused:
  6. InfiniteLoop thread starter macrumors member

    Nov 13, 2005
    I already provided the answer to that:

    sudo chflags -R nouchg /path/to/files/to/unlock

    you will need to enter admin password. This will unlockes all files (any others in sub folders there in) under the path given.
  7. heyp macrumors 6502

    Jan 29, 2008
    i'm having a similar problem. i can't sync my ipod because i do not have sufficient write privileges. however, i looked at every folder in my music folder and they all say i can read and write. i've also tried to repair permissions and reinstall itunes. nothing is working.

    if i try the following command, what would it look like if i were trying to unlock all files in my music folder?

    sudo chflags -R nouchg /Users/Me/Music/unlock?
  8. InfiniteLoop thread starter macrumors member

    Nov 13, 2005
    It would be something like /Users/<user name>/Music
  9. Andre3 Guest

    Hi everyone, my first post :D.

    Im having a similar problem in that, I have mp3 files which I have copied from my external HD. then I have sent the files to trash but cannot proceed to delete permanently.

    I dont know how the file becomes locked? When i go to "get info" under the ownership and permission section i change owner to myself and the padlock opens up, followed by a prompt saying "an unexpected error occured (error code 120)"

    Im not understanding the procedure you guys are talking about. Any help would be great because these files have been sitting in my trash for months.

  10. InfiniteLoop thread starter macrumors member

    Nov 13, 2005
    Welcome to the community Andre :)

    Try this, start trerminal program and then enter the following, substituting your username where you see "<your user name>"

    sudo chflags -R nouchg /Users/<your user name>/.Trash

    Then hit enter. It will ask for admin password, enter that. After this you should be able to empty trash.

  11. Andre3 Guest

    Thanks for the response InfiniteLoop :)
    unfortunatly im a bit of a newbe with this type of thing so bare with me...
    I have opened up the terminal app but all it says is

    "Last login: ******* on console
    Welcome to Darwin!
    andre's-computer:- Andre"

    it does not let me substitute any name either. I can however enter the sudo you gave me below but it warns me it could be risky so i didnt want to continue yet.

    any help would be good,
    thanks again

  12. InfiniteLoop thread starter macrumors member

    Nov 13, 2005
    You do not need to log in as admin to this. You will get a prompt to enter the password, (the same one you get asked when you are installing software or changing system settings etc). So in the terminal program being logged in as yourself is OK.

    As for the risks of the 'sudo' command, well it will be operating on all the files in your trash basket (as long as you type it as I said with /.Trash at the end). Do not worry about the warning. It will not delete anything from trash, but it will allow you to delete them if you want to after you executed this command.

  13. MrSmith macrumors 68040


    Nov 27, 2003
    Did anyone else assume this thread was going to be about denial of conjugal rights?
  14. Andre3 Guest

    what does this thread have to do with conjugal rights?

    thanks to infinateloop, ill give it a try when i get home.
  15. MrSmith macrumors 68040


    Nov 27, 2003
  16. InfiniteLoop thread starter macrumors member

    Nov 13, 2005
    After performing backups to my Firewire drive I got hit with this issue again :mad: I ended up with files in my trash that I could not empty. This happened after I deleted a few folders on my external FW drive. So whatever happened (well appears to be a nasty Tiger OS bug, as I am still on OS 10.4) after I deleted my own files (files from mypictures folder) I was not able to remove them from the trash (on the external drive, when you delete files from an external drive the OS moves those files to a folder under .Trashes of that drive). And that is why I am writing this. Because you may actually have files in your trash that are on an external drive (visible when the said external drive is connected to your mac). So to remedy all this I used the command:

    sudo rm -rf /Volumes/<volume name>/.Trashes/*

    you need to put the name of your external drive instead of <volume name>

    Warning, be very careful with this command, especially after you have entered the admin password once. Since after that if you hit enter with the wrong command you have no way to undo it! But as long as you are deleting the trash contents it is no big deal since you do not want those files anyway

    Now if only I knew this issue has been fixed on Leopard I might spend the $108 and get it...

  17. LABachlr macrumors newbie

    Jan 23, 2008
    I have the same issue, and tried both of the commands that you suggested (the one if the trash is from the HD and the one if the trash is from an external HD). I didn't know they were from the external hard drive until I went to get info.

    Here is what I entered in terminal (replacing "<name of my external drive>" with the name of my external drive:

    sudo rm -rf /Volumes/<name of my external drive>/.Trashes/*

    Still get the same error.

    Btw, they are empty folders, not files, if that makes any difference. And there are empty folders inside of empty folders inside of empty folders (well, empty except for the empty folders inside of them).


  18. InfiniteLoop thread starter macrumors member

    Nov 13, 2005
    Try entering this command first:

    sudo chflags -R nouchg /Volumes/<name of my external drive>/.Trashes

    Now you should be able to delete them.
  19. LABachlr macrumors newbie

    Jan 23, 2008
    I tried it and these were the errors I got:

    chflags: /Volumes/TOSHIBA: No such file or directory
    chflags: EXT/.Trashes: No such file or directory

    The name of my external is TOSHIBA EXT. I think the space through it off. But when I go to "Get Info" for the files, the path does include the space. What do you suggest?
  20. InfiniteLoop thread starter macrumors member

    Nov 13, 2005
    You need to escape the space in the folder name using '\' like this:

    sudo chflags -R nouchg /Volumes/TOSHIBA\ EXT/.Trashes
  21. LABachlr macrumors newbie

    Jan 23, 2008
    OK. Thanks. For whatever reason, the troublesome folders are not there anymore. Not sure if it was after I rebooted or what, but thanks for the help!

Share This Page