Saturday, 16 May 2009

HOWTO: [MAC] Move User to a different partition

Move User to a different partition

As we have hopefully set up a separate partition for our private data, here’s the bash-way of moving a home. (based on this article)

  1. in 'Disk Utility' to setup a new partition with 'Mac OS Extended (Journaled)' format, I call it 'home'.
  2. copy the whole home to your new partition:

    # sudo su -
    # cp -Rp /Users/username /Volumes/username
  3. Now we use Directory Services which can be accessed by dscl (Directory Services Command Line):

    # sudo su -
    # dscl localhost
    > cd /Local/Default/Users
    > change username dsAttrTypeNative:home /Users/username /Volumes/home/username> exit

Reboot, verify if your user data is at the new spot and then delete it from the old spot (/Users/username).

No comments:

My photo
London, United Kingdom
twitter.com/zhengxin

Facebook & Twitter