Quote:
Originally Posted by morghanphoenix
Is there a way to install a seccond hard drive and use it as my home directory, keeping all the program files on the existing 20 gig while using the new 80 gig for all my personal files? I'm using Kubuntu 6.06 with KDE 3.5.3 and Kernel 2.6.15-26-386. I know how to set all the hardware up, don't know how to format the new hard drive (It's pre-formated NTSF), mount it at startup or move the location of my home directory there. I don't even know if it's possible but I'd be amazed if it wasn't.
|
80gb is a little large for a /home partition but here is how you can do it. Install the new drive and if you have Knoppix boot CD then it is probably the best way to do it as you can be sure everthing is not in use by a running system so boot with Knoppix using
knoppix 2 dma typed in at the Boot: command prompt this get you a console login with DMA enabled on IDE drives. Once at the command line use
cfdisk /dev/hdb this assumes a slave on primary channel look into the output of the
dmesg |less command to see how the drive gets detected and change the hdb part to match new drive. When cfdisk opens use the right/left arrow keys to move to delete then ENTER key to delete ntfs partiton if not highlighted use the up/down arrow keys until it is. Now go to the New option with the unpartitioned space highlighted hit ENTER again make it a primary partition choose the size you want if using the whole drive as one partition hit ENTER again and you will see it show up in list next move to Type set to 83 you would then go to Write to write the updated partitioning to the drive then exit and reboot the machine to make sure the partition table is re-read properly.
You would again boot with the
knoppix 2 dma now at the command line.
Format with filesystem of choice replacing the ??? with ext2, ext3, resiserfs .... the hdb? with drive letter/partition number of new drive.
Code:
mount /dev/hda? /mnt/hda?
mount /dev/hdb? /mnt/hdb?
This mounts the old hda? partition you change the ? to the partition number containing the old /home the hdb? would be changed to its new drive letter/partition number for new /home.
Code:
cp -Rp /mnt/hda?/home/* /mnt/hdb?/
Copy the files from old /home to new /home.
Code:
nano /mnt/hda?/etc/fstab
Change the /etc/fstab to reflect the new /home location with a line similar to this.
Code:
/dev/sda3 /home reiserfs defaults 0 2
Changing the /dev/... and reiserfs to reflect the new drive letter/partition number and file system used reboot and see if you succeded. Now after using your new /home for awhile you may want to boot with Knoppix again mount the partition containing the old /home and use
rm -rf /mnt/hda?/home/* to free up that space on the drive.