Posted by: richlyn | June 6, 2010

Home folder on a separate partition

When I  installed Lucid Lynx i did not set up the home folder to on a  separate  partition and  was facing a space crunch hence I moved the Home folder to a separate partition on a different hard disk. My Lucid was on sda10 and the dedicated partition was sdb2.

I booted with a live cd and mounted the old(sda10) and new (sdb2)partitions:

sudo mkdir /old
sudo mount -t ext3
/dev/sda10 /old
sudo mkdir /new
sudo mount -t ext3
/dev/sdb2 /new

Back up the /home directory on the old partition and move it to the new partition:

cd /old/home
sudo find . -depth -print0 | cpio –R id –null –sparse -pvd /new/
sudo mv /old/home /old/home_backup
sudo mkdir /old/home

Next, I specified to use the new home partition as /home:

sudo cp /old/etc/fstab /old/etc/fstab_backup
gksudo gedit /old/etc/fstab

The /etc/fstab file opened in the Gedit text editor. Add in this line at the end of the file:

/dev/sdb2 /home ext3 nodev,nosuid 0 2

Save the file and exit Gedit. After you reboot, you should be now using your new /home partition.

If you find that you are running out of room on your old partition and you’re pretty confident everything is working as it should be, then go ahead and delete the backup of home:

sudo rm -rf /home_backup

If you reboot and are getting  some errors having to do with the $HOME/.dmrc file and/or .ICEauthority file, boot into recovery mode. Once in recovery mode, type:

chown -R username:username /home/username
chmod 644 /home/
chmod 644 /home/

where username is your actual username. Obviously, you’d repeat the first three commands for all users experiencing the problem before you typed exit.

if you get any errors for the first command above do this:

sudo chown username /home/username/.dmrc
sudo chmod 644 /home/username/.dmrc
sudo chmod 755 /home/username
sudo chown username:username /home/username/.ICEauthority

Once you’ve exited recovery mode, resume the normal boot and log in.

If, for some reason, no matter what you try, the separate /home doesn’t work, that’s why we have a live CD, so we can fix things.

Boot up the live CD, go to a terminal, and paste in (being sure to change the partition device name, of course):

sudo mkdir /recovery
sudo mount -t ext3
/dev/sda1 /recovery
sudo cp -R /recovery/home_backup /recovery/home
sudo cp /recovery/etc/fstab_backup /recovery/etc/fstab

Then, reboot.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: