Archive for April 20th, 2008

Change user location on mac

If you have familiarize yourself with linux or unix, this is pretty simple. But when you come from windows or earlier mac operating system, this thing just give you headache. And sometimes just make you a laughing stock, i know several people did.

Separating system files and your personal data is always a good practice regardless your operating system. I know it makes re-setting my tiger and leopard a lot easier and faster. As so in linux.

If you don’t have other partition already, first thing is obvious, create one. For ease and reassurance sake, i will recommend using your bootcamp utility or if using diskutility for advance usage. Let’s just try..

Create Partition

You can do this by several ways. First, you can use bootcamp util for partitioning and use disk utility ( Application->Utilities->Disk Utility) to erase the partition and reformat it to HFS+.

Second, you can use diskutility program from terminal. The command is simple, just go to terminal and type

$diskutil resizeVolume disk0s2 <newsize> JHFS+ <newpartitionname> <size>

it is that simple. A word of advice though, before do that, it’s better to know exactly the size of the partition. You can do that with command

$diskutil resizeVolume limits

This command will show you min and max value for you partition.

Third, you can use fdisk or gpt, but hey.. i think bootcamp or diskutil will do just fine.

Copy your user’s folder

Before you do this, make sure you have close all the application. This is just a precaution, since you will copy all your files to new partition, that there’s no changes occurs during the process. I know you can use a safer command, but i don’t think there’s a point of working will copying when your mac will slow down due to disk activities, so copy command will do.

I think you already knew we will use copy command, so here it goes :

$cp -RfL /Users/* <yourpartition>/

this will copy all folder on Users to you newly created partition. The L parameter used so all link will be preserved.

Delete Users folder

Yes, you read this right. Delete folder Users. But, if you want to be sure you get it right, you can just rename it first. So you can do

$rm -Rf /Users

or

$ mv /Users /Users_backup

either way, you actually have a backup on the other partition.

Create link to Users

Since Mac OSX assumed user’s folder is Users, and because OSX is now a *nix, we can fool OSX to think that /Users exists with a symbolic link. You can do this by :

$ln -s <yourpartition> /Users

That’s it. You can logout and logon to see the changes.

<yourpartition> is usually /Volumes/<partitionname>

Tags: ,