danas_blia

Q: Cannot modify files after copying them from old backup to fresh Yosemite installation

I have a new MacBook Pro with fresh Yosemite installation.

I decided to copy files from my old (Snow Leopard) Time Machine backup manually, because I wanted just some files copied, not everything. So I've created a new user, with same names exactly, as was my old one, and copied old backup files into it.

After copying, I've realized, that I cannot modify almost any of those files without Authenticating, or even at all. I cannot change the default program to open the file,some apps cannot save preferences (I've copied some old prefs too), deleting or moving files always requires Authentication, and I don't know what more...

 

I've tried this "sudo chown -Rv username directory" command (found it in this thread: Root user and permissions), but it didn't help...

I've checked the permissions - they are all ok, I ran permissions fix also from Disk Utility - didn't help.

I'm quite frustrated, as I need to work tomorrow... any solution?

Thanks

MacBook Pro, OS X Yosemite (10.10.3)

Posted on May 26, 2015 4:27 PM

Close

Q: Cannot modify files after copying them from old backup to fresh Yosemite installation

  • All replies
  • Helpful answers

  • by Drew Reece,

    Drew Reece Drew Reece May 26, 2015 4:35 PM in response to danas_blia
    Level 5 (7,552 points)
    Notebooks
    May 26, 2015 4:35 PM in response to danas_blia

    Please avoid entering commands found on the internet if at all possible, especially when they use sudo - it is very easy to mistype or enter the wrong thing if you are unfamiliar with the commands.

     

    You can reset the user permissions via Apples own tools. Backup before you begin – just in case.

    Boot holding cmd+R. Recovery mode should startup (assuming you have a recovery partition).

    Select Terminal from the Utilities menu.

    Enter the word…

    resetpassword

    … & hit return.

    The GUI app will open, select the main boot disk.

    Select your user account in the popup menu.

    Then click the Reset button at the bottom right. It will "Reset Home Folder Permissions & ACL's"

    Repeat for the other users.

    Quit ResetPassword from the menu,

    Quit Terminal

    You can also select Disk Utility and repair the system permissions & repair any disk damage that is reported via 'verify disk'.

    Quit to reboot the Mac.

  • by danas_blia,

    danas_blia danas_blia May 26, 2015 5:09 PM in response to Drew Reece
    Level 1 (9 points)
    Mac App Store
    May 26, 2015 5:09 PM in response to Drew Reece

    That's a thorough and quick answer, thanks!

    I am a bit familiar with commands and Terminal, so far I never did any damage, and all worked fine, so I am quite confident and cautious at the same time.

    By the way - you say to avoid commands found on internet, but you yourself tell me to execute a command

    I will try right away, and will let you know

  • by Drew Reece,

    Drew Reece Drew Reece May 26, 2015 5:31 PM in response to danas_blia
    Level 5 (7,552 points)
    Notebooks
    May 26, 2015 5:31 PM in response to danas_blia

    danas_blia wrote:

     

    By the way - you say to avoid commands found on internet, but you yourself tell me to execute a command

    I will try right away, and will let you know

    Ya I see the irony too

     

    This is a case where there is no alternative way to open that app. The command you posted looks OK, unless you actually entered the quotes & entered the correct path & username, it's a worry when things fail & used 'sudo'.

     

    The main concern is the number of pages that have old or incorrect commands, always get a second opinion.

  • by danas_blia,

    danas_blia danas_blia May 27, 2015 5:19 AM in response to Drew Reece
    Level 1 (9 points)
    Mac App Store
    May 27, 2015 5:19 AM in response to Drew Reece

    Well, I did exactly as you said, and nothing has changed... The "Change All" in the Open With info pane is greyed out, Photoshop cannot save preferences, modifying anything asks for authentication...

  • by cdhw,Helpful

    cdhw cdhw May 27, 2015 5:29 AM in response to danas_blia
    Level 4 (2,653 points)
    Servers Enterprise
    May 27, 2015 5:29 AM in response to danas_blia
  • by Drew Reece,

    Drew Reece Drew Reece May 27, 2015 7:28 AM in response to danas_blia
    Level 5 (7,552 points)
    Notebooks
    May 27, 2015 7:28 AM in response to danas_blia

    The 'change all' button is normally greyed out for me. I have to select another app to 'Open in' before it becomes a clickable button.

     

    The reset permissions should have fixed all those files but you can try the Terminal option if you want, your user will need to be an admin user for this to work…

     

    sudo chflags -R nouchg,nouappnd ~ $TMPDIR..;

    sudo chown -R $UID:staff ~ $_;

    sudo chmod -R u+rwX ~ $_;

    sudo chmod -R -N ~ $_;


    Clearly there is a lot going on here, wait for a second opinion if you want confirmation that it is OK but a backup is a really good idea too!

     

    If you are unsure you can list the files in question to see if they have extended attributes or other ACL permissions set…

    ls -leO@ "Path To Files"

     

    I'm not sure if the extended attributes listed in cdhw's link is part of your issue.

  • by danas_blia,Solvedanswer

    danas_blia danas_blia May 27, 2015 9:46 AM in response to danas_blia
    Level 1 (9 points)
    Mac App Store
    May 27, 2015 9:46 AM in response to danas_blia

    WOW! I found a fix finally. I didn't want to go into Terminal experiments any more - wasn't sure how to use the xattr command precisely, but it gave me some ideas. So I googled a little more and found a simple app "Permissions Reset" http://www.macupdate.com/app/mac/31741/permissions-reset

    I ran it and voila! after 1 minute all is fixed!

    I think that the problem was in messed up Snow Leopard permissions - I believe - removing the ACLs, resetting the permissions, and resetting ownership together did the job.

  • by danas_blia,

    danas_blia danas_blia May 27, 2015 9:49 AM in response to Drew Reece
    Level 1 (9 points)
    Mac App Store
    May 27, 2015 9:49 AM in response to Drew Reece

    Thanks for the help - yeah, I could wait for confirmation on all these scary sudo commands, but anyway - all is fixed now by a simple app!

    When I said that the "change all" is greyed out, I meant, that it's always greyed out - changing app didn't help. Now it's back to normal.

  • by Drew Reece,Helpful

    Drew Reece Drew Reece May 27, 2015 11:44 AM in response to danas_blia
    Level 5 (7,552 points)
    Notebooks
    May 27, 2015 11:44 AM in response to danas_blia

    The issue probably arose from how you moved files back from the Time Machine backup. If you manually did the copy the Finder will copy the ACL's & permissions  over. If you use the Time Machine UI to restore files it should request admin permissions that allows the OS to restore with the appropriate permissions based on the destination. Restoring user files is best done via Migration Assistant if possible.

  • by danas_blia,

    danas_blia danas_blia May 28, 2015 2:30 AM in response to Drew Reece
    Level 1 (9 points)
    Mac App Store
    May 28, 2015 2:30 AM in response to Drew Reece

    You are probably right, because that's what I did - manually copied the files. I should have used the Migration Assistant, but I really wanted to avoid importing all files with no control, and then ending up with 2 users (I already had a new user set-up and some apps installed, and some new files created etc.), and then having to consolidate them into one...

    I didn't realize that just simply copying files will cause such issues - I was long time a Windows user before, and still have some old habits

  • by Drew Reece,

    Drew Reece Drew Reece May 28, 2015 3:05 PM in response to danas_blia
    Level 5 (7,552 points)
    Notebooks
    May 28, 2015 3:05 PM in response to danas_blia

    Try the 'Apple way' by copying files back via the Time Machine interface, opened via the 'Time Machine menu > Browse Time Machine…'. That should restore correctly - you don't have to migrate everything.

     

    Time Machine uses ACL's to prevent other users snooping & editing other users data.

     

    I'm glad you have it sorted & having a rough idea of what may have happened is always nice

     

    Good luck, D

  • by danas_blia,

    danas_blia danas_blia May 29, 2015 1:56 AM in response to Drew Reece
    Level 1 (9 points)
    Mac App Store
    May 29, 2015 1:56 AM in response to Drew Reece

    Totally forgot about this option - my bad, should have done it in the first place. I will do it for other files, if any have left there, and will see it copies correctly.
    Thanks