LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Home directory on separate partition (https://www.linuxquestions.org/questions/linux-newbie-8/home-directory-on-separate-partition-627446/)

Steve W 03-12-2008 03:22 AM

Home directory on separate partition
 
I'm looking for the best way to set up my /home directory on a separate partition to my root directory. This setup is widely recommended for any Linux distro and I understand the reasons why. I've been researching how to do this, in Linux magazines and on the internet, but I'm getting more and more confused as to the way it should be done.

Part of the problem is that some methods go into detail about creating and formatting the partition itself, as well as copying the /home directory over. This does not apply in my case as I already have a spare 17Gb partition formatted as ext3. I just need to get my stuff over and tell the system this is where my new /home is located.

Could someone please go into detail as to the exact terminal commands I will need to do this? From the different methods outlined on the internet, it seems to be done using a variety of weird and wonderful commands such as rsync and other; some just use "mv".

There is also the question of whether I need to amend fstab to take account of the new location. One method detailed in a Linux magazine makes no mention of fstab at all; is it necessary to amend it or will Ubuntu just locate and pick up the /home directory automatically?

For instance, here is one method detailed in a magazine. It assumes all your stuff is currently on hda1, and you want your new home partition to be hda2:

mkdir -p /mnt/{root,home}
mount /dev/hda1 /mnt/root
mount /dev/hda2 /mnt/home
mv /mnt/root/home/* /mnt/home/
rm -fr /mnt/root/home/*

And that's it. No mention of fstab at all. Would this work in those five lines?

Obviously, I could just try it and see, but without knowing exactly what is going to happen, I don't want to risk messing up my system as it is now...

Could someone please advise whether I should go ahead using the above method, or do they have a better way?

Steve Wylie

acid_kewpie 03-12-2008 04:06 AM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Tinkster 03-12-2008 12:36 PM

http://www.linuxquestions.org/questi...tition-627445/


All times are GMT -5. The time now is 08:37 AM.