LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Adding A New HDD as a new /home & for 2nd OS (https://www.linuxquestions.org/questions/linux-hardware-18/adding-a-new-hdd-as-a-new-home-and-for-2nd-os-293452/)

ixus_123 02-22-2005 11:55 AM

Adding A New HDD as a new /home & for 2nd OS
 
I have a 20gig hard disk with slackware on it & it runs pretty nice on on my old AMD however I have 20gigs of music & about 30 of backed up DVDs so I want to add another hardrive and move slackware's /home partition onto it, keeping the rest of the system on the original 20gig drive.

The second hard drive is 200gig & will be set to slave on the DVD drives IDE channel. I also want to install Windows XP on the second drive (needed :[) on a 10gig partition & ubuntu linux sharing the new home.

can anyone help with moving /home or point me in the right direction. Thanks.

Davidian1024 02-22-2005 05:07 PM

First off I am going to assume you will be using the first partition on the second drive as your XP partition, and the second partition as your /home partition. And from now on I will refer to your root fs partition as /dev/hda1 and your /home fs as /dev/hdb2.

You could set things up like this:

First copy everything from /home to the root of the second drive:

1. Mount the second drive to a temporary mount point:
Code:

mount /dev/hdb2 /mnt/temp
2. Copy everything from /home to the root of the second drive with the archive option. This will preserve file permissions and ownership:
Code:

cp -a /home/* /mnt/temp
Now that you have a copy of everything that was in /home on the second drive you can mount that drive under /home. Here is an example of the relevent lines of fstab:
Code:

# /etc/fstab

/dev/hda1  /      /ext3  defaults  1  1  #Your root partition - this should already be in fstab
/dev/hdb2  /home  /ext3  defaults  0  0  #Your /home partition - you will have to add this

Now this leaves everything that was in /home still there on the root partition. With /dev/hdb1 mounted on /home you will not be able to see this. I would try setting things up like this and then reboot and check the output of df to see that /dev/hdb1 got mounted on /home and that you can login fine and access your home directories. Once you are satisfied you can switch to single user mode and unmount /dev/hdb1 from /home and delete anything within that directory. Then remount /home and switch back to multi-user mode.

Hope this helps.

ixus_123 02-23-2005 09:37 AM

Thanks. I'm going to put the drive iin & give it a try in about an hour :)


All times are GMT -5. The time now is 02:20 AM.