LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 09-20-2006, 09:02 PM   #1
morghanphoenix
LQ Newbie
 
Registered: Aug 2006
Posts: 12

Rep: Reputation: 0
2nd hard drive for home directory?


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.

 
Old 09-20-2006, 09:33 PM   #2
musicman_ace
Senior Member
 
Registered: May 2001
Location: Indiana
Distribution: Gentoo, Debian, RHEL, Slack
Posts: 1,555

Rep: Reputation: 46
Once the hard drive is connected. Boot linux. Type

Code:
mkreiserfs /dev/hdb1  (assuming IDE 2nd device)
mount /dev/hdb1 /home
You could create EXT3 instead of reiserfs, but that is personal perference their. for EXT3, it would be mke2fs -j /dev/hdb1. Edit the /etc/fstab file to have /home mounted on system startup

Last edited by musicman_ace; 09-20-2006 at 09:34 PM.
 
Old 09-20-2006, 09:37 PM   #3
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
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.

Code:
mkfs.??? /dev/hdb?
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you install a new hard drive and make it the new /home directory??? anilnatha Linux - Hardware 4 08-02-2005 04:39 PM
2nd Hard Drive snutz411 Linux - Hardware 3 03-24-2004 12:52 PM
2nd hard drive naflan Debian 4 02-22-2004 02:55 PM
2nd hard drive neo.sarcastic Linux - Hardware 4 09-22-2003 11:22 PM
2nd hard drive jarrodatt Linux - Hardware 1 11-12-2002 02:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 09:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration