Πέμπτη 25 Οκτωβρίου 2007

Move your home directory to its own partition

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:
gksudo gparted

then use gparted to create and format your new partition.
Once created and formated, it is time to move your /home

You may need to resize your / "root" partition to make enough room for your /home partition, or use another disk for it.

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 -a /home.bak/* /home

Remember to change /dev/sda3 and ext3with your own data

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

Δεν υπάρχουν σχόλια: