I did a clean install of yosemite on my MacBook Pro. I have not partitioned my hard drive and have left everything by default. I would however like to use the recommended schematic for Linux systems (Partition for the OS (root directory), Partition for /Home and one for my data). Is there a way to do this with mac? I am not aware that i could have done this during the installation process especially choosing a partition for the OS. Furthermore I wonder if it would be possible to partition the HD after the installation and move all the data later. I'm looking for some kind of guidance how I can do that clean.
-
1I'm not sure I'd recommend doing it that way - separate 'boot' from 'data' yes, but I'd leave 'home' where it is. I'll let a nix/mac user elaborate though, my nix is limited.– TetsujinFeb 19, 2015 at 9:47
-
Note that OS X is not Linux - why pick that partition it is not the only one I have seen recommended– mmmmmmFeb 19, 2015 at 10:49
-
what would you recommend and why?– UbuntixFeb 19, 2015 at 11:41
-
Mac software, the OS and apps written for it, do not expect a separation like you are describing. It can work, but it makes backing up and re-installing more difficult. I have done similar things in the past and have decided it was not worth it. However, on some machines with limited hard drive space I do move some of the directories in the Home folder to a different drive.– Dave NelsonFeb 19, 2015 at 12:17
-
move /home to 2nd partition and create a symbolic link, which points to /home in the 2nd partition. Could this work? The main reason i want to do this is because i want a seperation between the OS (including all programs) and my Data (like documents etc.). This would make a reinstallation of the os very easy because there is no need to restore my data.– UbuntixFeb 19, 2015 at 13:51
1 Answer
As mentioned by the other comments, Apple's default partition scheme is to have everything on ONE partition. While not recommended (potentially due to not being easy to do), it is possible to move a home folder to a different partition.
Here is how:
- Create a partition to use for the home folder (Disk Utility is the built-in choice to do so)
- enable the root user
- open System Preferences
- click on Users & Groups
- click on Login Options
- open the padlock on the lower left-hand corner
- click on "Join" next to Network Account Server
- click on "Directory Utility"
- from the menu "Edit" click "Enable Root Account" and supply a password for that account
- log out of the current to-be-moved user
- choose "Other" at the login screen
- type in
root
into the username field and supply the password you just gave it - navigate to your other partition and create a base home folder (to use Apple's naming convention, create a folder named "Users")
- navigate to the system's Users folder and copy the user's home folder over to the other partition.
- open System Preferences > Users & Groups
- open the padlock on the lower left-hand corner
- right-click (or Ctrl+click) the user you want to move and choose "Advanced Options"
- for the field "Home directory", either click the button "Choose" (if it is there) and select the new path or type in the new path.
- If you type it in, the path starts with
/Volumes/<volume_name>
- Important: Use the proper capitalization as depicted on your system or you may run into problems
- Do NOT change anything else on that form (e.g. user ID) or you may end up not be able to log in or use the system with the other user
- If you type it in, the path starts with
- click on "OK"
- restart your computer holding down the Alt key until you see boot options on the screen
- choose the recovery option (e.g. "Recovery HD-10.10")
- choose the language when asked
- from the menu "Utilities" choose Terminal
- type in
resetpassword
and hit Enter - choose the hard drive you normally use to boot from
- choose your user
- Click on "Reset" at the bottom of that window to reset permissions
- reboot your system normally and try to log in to your user
If this is working for you as expected, here is the clean-up:
- remove your user account folder from the system drive (to save disk space on your system drive)
- disable the root user again to improve system security (follow the same steps as outlined above and choose "Disable Root User") this time
In case it is not working (though I would understand that it will), you can use root to log in and move the home directory back to where it was using System Preferences > Users & Groups > Advanced Options (right-click on that user).
I hope this guide helps.
-
thank you very much for your effort. This helps me alot. But why isn't it recommended? I could reinstall my OS without loosing all my data.– UbuntixFeb 19, 2015 at 16:30
-
The main thing of why it is not recommended is that it makes things harder to manage (and Apple is all about simplicity). Having a good and frequent Time Machine backup will take care of potential data loss and since Mac OS X 10.8 it allows even multiple disks to be used in rotation. So, for instance you can set up two disks, back up the system on each of the disks and then place the second hard drive in a different location (e.g. your friend's house) and swap them when visiting.– PhoenixFeb 19, 2015 at 17:05