Revision of Move your home directory to its own partition from Mon, 09/24/2007 - 04:30

There are some reasons why you may need to move your home directory to its own partition, it could be because you run out of space, or because you may want to share it with another distro in a dual Linux boot installation, well lets start.

Preparing the new partition

This may be different in your environment, in my case I will do in the same disk, just in another partition, but you can use a complete new and different disk for you /home directory.

Gparted

If you do not have gparted, install it with

sudo apt-get install gparted

the call it with:

sudo gparted

then use gparted to create and format your new partition

Once created, it is time to move your /home

Moving your home directory

First logout from GNome or KDE, press Alt+F1 and login as root.

Follow this steps

mv /home /home.bak
mkdir /home
mount -t ext3 /dev/sda3 /home
cp /home.bak/* /home -R

Remember to change /dev/sda3 with your own data

Now we need to assign the new permissions to the recently created /home directory.

you need to repeat this sentence for all the users you have in your system, be sure to recreate what you have at /home.bak/ directory.

We need one final step,

Open your /etc/fstab file, and add this line, in my case it is /dev/sda3 but could be different for you.

/dev/sda3       /home           ext3    defaults,errors=remount-ro 0    1

It there were a line for /home in you /etc/fstab file replace it with the new data.

with this finished, just reboot your system and enter as usually.

Important note

Remember to back up before using gparted if you are resizing your disk to make room for the new partition