MonOnoM

Q: How to regain permissions for internal storage drive?

I have installed my original Macbook pro's hard drive in my optical bay, clean installed osx lion on a new SSD in the drive bay, but having trouble accessing and editing the files and folders on the old hard drive.

 

I've tried "repair permissions", I've tried unlocking the padlock in inspector and inserting my admin account into the permissions window with "read and write" privileges, but at the file level most of the files have "mixed permissions" so I can't edit them all simultaneously with cmd + opt + i, besides I'm also getting problems with Textedit (for example) saying that I can't edit a file despite having changed the permissions for the file in the inspector.

 

When I try "chflags -r nouchg" in Terminal it says "Permission Denied" at the end of every string.

 

Somebody suggested the following commands for a similar problem, but the second half contains elements I don't really understand (presumably for the first one I replace "/Volumes/GPAudio" with the path of the drive)?, so I thought better of giving it a bash (heh) on my system without figuring if it was appropriate for what I want to do or deadly poison

 

sudo chflags -R nouchg /Volumes/GPAudio


sudo find !$ -type d -exec chmod a+x {} \;

MacBook Pro, Mac OS X (10.7.5), null

Posted on Jul 17, 2016 3:46 PM

Close

Q: How to regain permissions for internal storage drive?

  • All replies
  • Helpful answers

Page 1 Next
  • by theratter,

    theratter theratter Jul 17, 2016 4:01 PM in response to MonOnoM
    Level 4 (3,907 points)
    Desktops
    Jul 17, 2016 4:01 PM in response to MonOnoM

    Any commands you use in the Terminal to make changes to the storage disk require adding "sudo" at the beginning. For example, sudo chflags -r nouchg. You will be prompted for your admin password. It will not echo back to the window. You might try this instead:

     

    sudo chflags 0 /Volumes/*

    sudo chmod a+rx /Volumes/*

    killall Finder

     

    Another procedure is:

    Boot into single-user mode and at the prompt enter these commands pressing RETURN after each:

     

    mount -uw /

    chown root:admin /

    chmod 1775 /

    reboot

     

    After rebooting open Terminal in the Utilities folder. Paste these commands into the Terminal application to avoid typos:

     

    sudo su

     

    Press RETURN. Enter your admin password when prompted.  It will not be echoed to the screen. Press RETURN again. Now paste each of the following at the prompt and press RETURN after each.

     

    chown root:admin /Applications

    chmod 0775 /Applications

    chown root:admin /Library

    chmod 1775 /Library

    chown root:admin /System

    chmod 0775 /System

    chown root:admin /Users

    chmod 0775 /Users

    chmod -R -N /Applications

    chown -R :admin /Applications/*

     

    I suggest you first print these instructions out using a large mono-spaced font so you can read them correctly. There are spaces in the lines that may not be easily observed.

  • by Drew Reece,Helpful

    Drew Reece Drew Reece Jul 18, 2016 10:11 AM in response to MonOnoM
    Level 5 (7,527 points)
    Notebooks
    Jul 18, 2016 10:11 AM in response to MonOnoM

    Before you go & wildly change these permissions you need to answer one simple question…

    Do you plan to boot from this disk ever again?

     

    If you ever want to boot from it do not change the permissions via sudo or any other way. OS X requires these permissions & access controls to run correctly.

     

    It would probably help if you explained why you feel the need to edit these protected files - there may be a better way that won't ruin the ability to boot. Also be aware that typos with sudo can ruin the OS you are booted from, Terminal & sudo are not tools you use without solid backups (that are safely disconnected).

  • by MonOnoM,

    MonOnoM MonOnoM Jul 18, 2016 6:35 AM in response to Drew Reece
    Level 1 (8 points)
    Notebooks
    Jul 18, 2016 6:35 AM in response to Drew Reece

    I didn't really plan to use it as a boot drive, though it might be a useful function in the event of my main drive failing, but I have a Lion thumb drive for that sort of thing.

     

    Well, they're just the old user files on my hard drive; documents, photos, Logic/Ableton projects etc., they shouldn't really be protected in the first place. I had considered wiping the old drive and then dragging over the folders from the time machine backup I had before I upgraded my mac, but I'm concerned I'd just get the same problems with permissions and such.

  • by Drew Reece,Helpful

    Drew Reece Drew Reece Jul 18, 2016 10:10 AM in response to MonOnoM
    Level 5 (7,527 points)
    Notebooks
    Jul 18, 2016 10:10 AM in response to MonOnoM

    Forget about booting if you hack away at permissions like has been suggested here - it will be unbootable after you alter them.

    MonOnoM wrote:

    Well, they're just the old user files on my hard drive; documents, photos, Logic/Ableton projects etc., they shouldn't really be protected in the first place.

    Sorry that is incorrect - otherwise someone could simply move a system disk to another device & easily read all your user files (which may contain private data). Target disk mode can mean that the disk doesn't even need to be removed! OS X tries to prevent that the best it can - permissions are it's primary system that protects user data.

     

    MonOnoM wrote:

    I had considered wiping the old drive and then dragging over the folders from the time machine backup I had before I upgraded my mac, but I'm concerned I'd just get the same problems with permissions and such.

     

    Do not try dragging anything to other disks from Time Machine. You can ruin Time Machine backups if you go digging into them in Finder or Terminal etc. OS X has the Time Machine UI to browse & export backups - use that to get access to data. Use 'Browse Time Machine' from it's menu to restore data, then consider resetting permissions on the copy etc.

     

    The correct way to access user files is to sign in as that user & transfer files to other users via the Public/Dropbox in each home folder. Only consider changing permissions on home folders if you never want to login as that user again.

     

    I don't have a simple answer beyond this…

    Open Migration Assistant, select the option to migrate users from another disk. Migrate your old account to the Mac. Assuming you have unique user names you will have the old user on your disk once it completes. Sign in to the old user & move files to the other user via the Public/Dropbox in each home folder.

     

    I'll leave it to others to give you Terminal commands that can edit the permissions.

  • by MonOnoM,

    MonOnoM MonOnoM Jul 18, 2016 10:10 AM in response to Drew Reece
    Level 1 (8 points)
    Notebooks
    Jul 18, 2016 10:10 AM in response to Drew Reece

    I primarily want to use the old drive as a storage drive, so I can use my new drive for apps and OS (I thought this would be the simplest solution, especially given the old drive already had all my old files on it...)

     

    So with Migration transfer I would have to transfer the user account from the old drive to my current drive, then (using the old user) transfer the relevant folders from the current drive to the "Shared" folder, then wipe the original drive and move all the files from the Shared folder back to the drive they were originally on?

     

    I've already changed added my account to have read and write permissions in the inspector using the padlock and permissions window (on the advice of other people) does that mean I've already negated the possibility of transferring the user or booting from it? If I can still boot from it, could I do so and transfer the files from that drive onto an external drive, boot from the new drive again and then wipe the old drive and drag the files over from the external? This seems marginally more elegant to me.

  • by Drew Reece,

    Drew Reece Drew Reece Jul 18, 2016 2:55 PM in response to MonOnoM
    Level 5 (7,527 points)
    Notebooks
    Jul 18, 2016 2:55 PM in response to MonOnoM

    I'm having a tough time working out what your overall aim is - it seemed like it was to access a few files now it seems like you'd like full access to the user data. Clarifying this would help devise an appropriate plan. I suspect I may have confused the issue too

     

    You can migrate the data if you have the space for it. Migration Assistant copies all the user data & resets the permissions to use the new user ID.

     

    NOTE: OS X is also happy to store a users home folder on another disk - provided that disk is always available. To do this just make a new user account (using the same 'short name' as the old home folder). Then use the advanced preferences to point the home folder to the old account on the other disk. The advanced preferences are shown when right clicking the username in System Preferences.

    You may need to get OS X to fix the user permissions after that. This method should do that correctly…

    http://osxdaily.com/2011/11/15/repair-user-permissions-in-mac-os-x-lion/

    Ask before you make changes via this method it can be tricky to get right, but it is the correct way to move a home filer to another disk. Here is an explanation of that.

    http://chris.pirillo.com/2008/02/06/how-to-move-the-home-folder-in-os-x-and-why/

    Obviously that ruins permissions & the ability to login as the user on the old OS.

     

    Considering you have already damaged the old user account permissions you can probably continue with the modifications that edit the permissions via sudo if you only want to access a few files. 

     

    I don't know what you overall aim is but permissions are not something that you can normally just 'get rid of' at least not if you want to preserve booting or user logins.

     

    I'm also not sure how you can just transfer files to another drive - most decent copy (one that verify a copy actually happened) apps will preserve permissions. Copying in Finder won't strip out ACL's or nested permissions either. If you have a plan, stick to it, just verify th etools you plan on using actually remove the permissions - OS X will write permissions to external disks too. Using the 'Ignore ownership' checkbox doesn't remove the permissions on volumes, it just ignores the ownership rules.

     

    It's complex because it is how OS X is designed to work.

  • by MonOnoM,

    MonOnoM MonOnoM Jul 19, 2016 6:50 AM in response to Drew Reece
    Level 1 (8 points)
    Notebooks
    Jul 19, 2016 6:50 AM in response to Drew Reece

    Sorry, my reply was deleted and didn't autosave properly so I rewrote it differently!

     

    I probably should have been more thorough in my explanation:

    I had thought I could simply use my old hard drive "as is" as a storage drive, keeping all of the files and projects that were stored on that drive, and symlinking some of my new drive's home folders (photos, music, movies, etc.) to point to the folders on the old drive, and copying over a few important preferences and plugin components to my new drive. As I saw it, this would avoid the problem of having to copy all the old files on my hard drive to an external drive, then wipe the original drive, only to put all the same files back on it again. I want to use the new drive only for OS and applications (ideally).


    Supplementary to that, I had thought keeping the OS on the old drive wouldn't take up too much space and would mean I could potentially also boot from it in an emergency, but the primary usage intention was storage, so if there's no way to keep it bootable then "c'est la vie".

    Hopefully that is a bit less confusing I think other people I've asked for advice maybe haven't understood what I was trying to do, what do you think the best course of action would be?

  • by Drew Reece,

    Drew Reece Drew Reece Jul 19, 2016 8:53 PM in response to MonOnoM
    Level 5 (7,527 points)
    Notebooks
    Jul 19, 2016 8:53 PM in response to MonOnoM

    MonOnoM wrote:

     

    I had thought I could simply use my old hard drive "as is" as a storage drive, keeping all of the files and projects that were stored on that drive, and symlinking some of my new drive's home folders (photos, music, movies, etc.) to point to the folders on the old drive, and copying over a few important preferences and plugin components to my new drive.

    This is all achievable.

    Personally I find symlinks are fragile, ideally if you can use the same home folder on 2 OS's that makes it simpler. It requires a little care & setup but it is possible to use one home folder for multiple OS's, ideally the OS is the same version but it isn't totally critical.

    That does mean that you have one home folder without the possibility of customising things.

     

    You can also save files to the 'base' of a system drive, however you will have to create a folder as admin & then loosen the permissions to allow other users to access that folder. The OS likes to protect that location, so it is is best to use the home folder for your own data or use /Users/Shared/ for content everyone needs to access. It's up to you if you'd rather save to the base of the disk, it is not impossible, just not recommended & a little non-standard nowadays.

     

    Overall I'd say you can achieve what you desire without having to break the old OS's permissions.

     

    The first step would be to confirm the state of the old OS… boot the old OS & check the old user logs in & functions. Repair the disk permissions in Disk Utility. NOTE: will not fix user permissions. Use recovery mode to repair disk permissions if it won't boot & retry.

     

    If that works fine you can add a new user to the second OS & then point the new users home folder to the old location. You will also need to set the same UID (user id) as the old one, this is also done in the advanced section of the preferences.  I'm trying to keep the explanation short, so ask if you want more detail.

     

    Your general aims seem achievable to me, it really depends on if you can limit yourself to one home folder, or only want to symlink pieces to the old one. Symlinks can fail & I have had issues with them, so I don't recommend them for critical data like the home folder because some apps can misbehave if you have files in unexpected paths.

  • by MonOnoM,

    MonOnoM MonOnoM Jul 21, 2016 5:54 AM in response to Drew Reece
    Level 1 (8 points)
    Notebooks
    Jul 21, 2016 5:54 AM in response to Drew Reece

    Okay, I booted from the old OS and it worked, so I repaired Disk Permissions, it came up with the message :
    "Warning: SUID file “System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAg ent” has been modified and will not be repaired." Though all other permissions appeared to be repaired without incident.

    If that works fine you can add a new user to the second OS & then point the new users home folder to the old location. You will also need to set the same UID (user id) as the old one, this is also done in the advanced section of the preferences.  I'm trying to keep the explanation short, so ask if you want more detail.

    Okay, this sounds like a good plan, more detail please! Also, would I have to switch to using this new user or would both my accounts be able to access it?

  • by Drew Reece,

    Drew Reece Drew Reece Jul 23, 2016 2:00 PM in response to MonOnoM
    Level 5 (7,527 points)
    Notebooks
    Jul 23, 2016 2:00 PM in response to MonOnoM

    The ARD error in Disk Utility is normal, don't worry about that…

    Mac OS X: Disk Utility's Repair Disk Permissions messages that you can safely ignore - Apple Support

     

    To set the OS to use the one home folder shared to multiple OS's the process is as follows. Please read all before you begin, there are some considerations at the end.

     

    I'm labelling each OS to try to make it clear '[source]' is where the home folder exists '[dest]' is the OS that will gain access to the new account.

     

    Ensure you have an admin account on both OS's - this needs to be different to the user account you plan to change.

     

    STAGE 1 On the [source] OS.

     


    Ensure the account you plan to share can login & works OK.

    1. Login as your admin
    2. Open 'System Preferences > Users & Groups', unlock the panel if it is locked (admin access is needed).
    3. Select the user you plan to share, ctrl+click on the username (or right click), select the 'Advanced Options…'
    4. Make a note of the 'User ID' and 'Account name'. You will need to access this on the other OS later, so write these down.
    5. Close the advanced options & reboot into the [dest] OS.

     

     

    STAGE 2 On the [dest] OS.

    1. Open 'System Preferences > Users & Groups', unlock the panel if it is locked (admin access is needed).
    2. Confirm that ALL of the other users on the system are not using the same User ID - use the advanced options to check each user account manually, but do not change any settings.
    3. If there is an existing user with the same User ID STOP NOW & post back, otherwise continue…
    4. Create a new user - use the same name as the account name on the [source] OS, it is best use the same password too so the keychain will be unlocked in both OS's.
    5. Once created you can edit the new account under the advanced options.
    6. Set the user ID to the same as the user on [source].
    7. Set the home directory to '/Volumes/{name of source disk}/Users/{account-name} to the same as the user on [source] (insert the name of your disk & the user account)
    8. Save the changes.
    9. Try logging in as the user you created, (change the desktop background as a test).
    10. Reboot to the other OS & login see if your desktop is the same.

     

    Note any errors & post them here.

     

    You previously asked about switching into this account. That is up to you just be sure to keep a functioning admin on both OS's otherwise it can be difficult to fix any errors. Merging user accounts is always difficult when you consider preferences & other files that do not merge well, you may find it simplest to copy over any files you need but permissions will still be an issue. They will need repairing after you copy them to the new account.

     

    OS X has two types of 'repair permissions feature' - one is built into Disk Utility & it repairs the permissions of installed apps (only apps that used installers). The other method is built into recovery mode. You use a tool called 'resetpassword' in recovery mode, opened from Terminal. It is opened as explained here…

    How to reset the user password in OS X Lion and newer OS X releases

    There are options in that tool to reset user permissions despite it's name, you simply select the user account & apply the reset password.

     

    P.S. Apologies for the delay, I was away from my Mac & needed to clarify a few things.

    Post back if anything is unclear.

     

    As always this is fairly a major change, so make a backup beforehand of any important data.

  • by MonOnoM,

    MonOnoM MonOnoM Jul 24, 2016 4:43 PM in response to Drew Reece
    Level 1 (8 points)
    Notebooks
    Jul 24, 2016 4:43 PM in response to Drew Reece

    Okay, most of that sounds straightforward enough!

     

    So on both OSes I would need to create a new separate admin account (with a different name) to the current sole account on each system (which are both admin accounts) - would I also have to remove admin privileges from the original accounts as well?

     

    I saw you mentioned preferences and I wanted to make sure that this method doesn't pertain to migrating the Preferences/Applications/System/Library, etc. of the [source] to the [dest], instead it is just creating a new (essentially blank) [dest] user account, with a Home folder pointing to the Home folder on the [source] disk?

     

    1. Create a new user - use the same name as the account name on the [source] OS, it is best use the same password too so the keychain will be unlocked in both OS's.

    Regarding this, will I still be able to change the password for this new [dest] user given the congruence between the passwords described here, or will doing so cause issues?

     

    P.S. No worries, sorry for the delay in replying too, unexpectedly hectic weekend, wanted to ensure I read thoroughly and wrote a perspicacious response!

  • by Drew Reece,

    Drew Reece Drew Reece Jul 24, 2016 5:36 PM in response to MonOnoM
    Level 5 (7,527 points)
    Notebooks
    Jul 24, 2016 5:36 PM in response to MonOnoM

    You shouldn't need to edit any admin accounts. You just need to have a functioning admin on each OS disk. Only create a new admin if you only have one account on the source system. You need to avoid trying to modify the only admin user on either system.

     

    You can revoke admin access if you desire - it really doesn't matter provided the admin accounts have passwords and you keep one admin user on each system.

     

    You are not changing anything in /System or the other places you mention. You are simply creating new account and then telling OS X to use a home folder on the other disk. The only consideration is that the user ID needs to match on each OS installation, otherwise permissions can get in a mess.

     

    The passwords can be different on each account, there is one nuance that is easy to miss – the login keychain. That is normally unlocked with your login password. If the keychain password is not the same as the login password you have to unlock it manually. It is not a problem, just something that confuses most users who do not realise that the password is setup in 2 places not just one. Obviously you can't have 2 different login passwords that match the single keychain password (you have one home folder with this setup).

     

    If this is too confusing try detailing your setup so it is clear what users are on which OS disk & what User ID's they have & their admin status.

     

    We can determine all of that info via Terminal commands but I was hoping to avoid a lot of back & forth since I don't know how often I can reply.

     

    If this is all too confusing it is best to avoid doing this - it is non standard & may lead you to get into a mess, but you seem convinced that you want to login from multiple OS's.

  • by MonOnoM,

    MonOnoM MonOnoM Jul 25, 2016 8:37 AM in response to Drew Reece
    Level 1 (8 points)
    Notebooks
    Jul 25, 2016 8:37 AM in response to Drew Reece

    Not to worry, I understood your clarification, followed the instructions and it appears to have worked without incident, for the test I changed the background on the [dest] OS user and it remained changed when I logged back into the [source], with no error messages! Huzzah!


    Are there next steps and/or checks I should be making?

     

    P.S. Can I simply drag individual files from the Library/Audio/Plug-Ins folders on the [source] to dropbox and move those to the Library/Audio/Plug-Ins folder on the [dest] OS without incident? I don't think I'll bother attempting to transfer my old preferences, but plug-ins would save a lot of time.

     

    P.P.S. So if I wanted to change the password on the new [dest] user, I would also have to change the shared login keychain password to match it or it would keep bugging me to enter the keychain login password?

  • by Drew Reece,

    Drew Reece Drew Reece Jul 25, 2016 8:51 AM in response to MonOnoM
    Level 5 (7,527 points)
    Notebooks
    Jul 25, 2016 8:51 AM in response to MonOnoM

    I think the audio plugins should work if you place them into the correct folder - ideally it is better re-run the installer that created them in the first place, otherwise permissions can be incorrect.

    Installers create a 'bill of materials' that is used to repair these permissions. You won't have that BOM file without running the installer.

     

    The keychain will bug you when the login password is different. It doesn't really matter if you can unlock it when prompted.

     

    I'm glad it seems to have worked out for you

     

    Re-read the part I posted about 'resetpassword' it can be used to fix user permissions from recovery mode, but it seems like you have them correct so far.

Page 1 Next