LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-04-2003, 12:02 AM   #1
commuter
LQ Newbie
 
Registered: Dec 2002
Posts: 15

Rep: Reputation: 0
moving /home and /usr to new partitions?


I did a long search but did not find the specific answer to my question?
I'm adding a second hard drive 6GIG and splitting it into 2 partitions.

I would like to mount /home on /dev/hdb1
and /usr on /dev/hdb2

I installed the second hard drive and partitioned it.
I understand how to write a filesystem using mke2fs -c drive size
I also understand how to mount the partitions and edit fstab.

Finally, my question if I use the mountpoints /home for /dev/hdb1 and /usr for /dev/hdb2 will this affect those directories that currently reside unde / on /dev/hda2 ?

Is there anything special I need to do when issuing the mount command or will linux recognize the fact that I wish to relocate these directories?

Thx

I'm using RH8
My partition tables

Device Boot Start End Blocks Id System
/dev/hda1 * 1 25 100768+ 83 Linux
/dev/hda2 26 657 2548224 83 Linux
/dev/hda3 658 787 524160 82 Linux swap


Device Boot Start End Blocks Id System
/dev/hdb1 2 384 3076447+ 83 Linux
/dev/hdb2 385 788 3245130 83 Linux

If any further info is needed about my system please let me know.
I just want to check before I make a big booboo

commuter
 
Old 01-04-2003, 12:06 AM   #2
commuter
LQ Newbie
 
Registered: Dec 2002
Posts: 15

Original Poster
Rep: Reputation: 0
Oh yeah and how do I move those directories!
In the book "Running Linux" under "tar Tricks" I found a referance to using tar to relocate directories preserving there integrity!
I think I can work this out I'm just nervous about having duplicate directories during the move?
thx again
commuter
 
Old 01-04-2003, 12:19 AM   #3
commuter
LQ Newbie
 
Registered: Dec 2002
Posts: 15

Original Poster
Rep: Reputation: 0
OK I feel like an ASS because I just found the "Hard Disk Upgrade Mini How-To" but it say I need to mount the new drive with a mount point like "/newdisk" then continue after that.
I'm looking to have /home and /usr mounted directly under / .
Is this possible without a complete reinstall?
commuter

Last edited by commuter; 01-04-2003 at 12:20 AM.
 
Old 01-04-2003, 01:52 AM   #4
bulliver
Senior Member
 
Registered: Nov 2002
Location: British Columbia, Canada
Distribution: Gentoo x86_64; FreeBSD; OS X
Posts: 3,764
Blog Entries: 4

Rep: Reputation: 78
I don't see why it wouldn't be possible to manually move your /home and /usr partitions to the new harddrive using the cp command. Check out "man cp" and make sure that you add the flags that preserve ownership/permissions AND links (-p or --preserve).

Then back up your /etc/fstab and put somewhere safe. Now edit fstab and change the entries for /home and /usr to the new settings. Reboot and cross your fingers. Only after you verify it worked should you remove the old /home and /usr.

This should be possible in theory, although I have never tried it personally. Make sure everything important has been backed up.
 
Old 01-04-2003, 04:44 AM   #5
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Reboot? Reload your fstab: mount -a -o remount

I don't know when, or which thread, but I believe it was Aussie who said:
"This is Linux, rebooting is for adding hardware".

Cool
 
Old 01-04-2003, 09:50 AM   #6
commuter
LQ Newbie
 
Registered: Dec 2002
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks guys I'm gonna give it a try as soon as I dig out from the more than 12" of snow I got last night! I love it though!
commuter
 
Old 01-04-2003, 01:38 PM   #7
bulliver
Senior Member
 
Registered: Nov 2002
Location: British Columbia, Canada
Distribution: Gentoo x86_64; FreeBSD; OS X
Posts: 3,764
Blog Entries: 4

Rep: Reputation: 78
Thanks MasterC, I guess I still suffer from windows rot. I am, however, proud of the fact that I chucked Windows and live in a 100% Linux world now!
 
Old 01-04-2003, 07:39 PM   #8
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
That's one step further than I've gotten, p2p still drives me back to the dual boot I live in shame

Cool
 
Old 01-04-2003, 10:53 PM   #9
Aussie
Senior Member
 
Registered: Sep 2001
Location: Brisvegas, Antipodes
Distribution: Slackware
Posts: 4,590

Rep: Reputation: 58
What p2p program do you use Chief?
 
Old 01-04-2003, 11:22 PM   #10
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 50
Don't use cp. Use tar:
Code:
cd /usr
tar cf - . | (cd /newdisk/usr; tar xvf -)
 
Old 01-04-2003, 11:29 PM   #11
Aussie
Senior Member
 
Registered: Sep 2001
Location: Brisvegas, Antipodes
Distribution: Slackware
Posts: 4,590

Rep: Reputation: 58
I used "cp -a" to move a complete slackware install to a new drive, have a look here for the blow by blow explanation on how I did it, you should be able to use the same method for shifting /home and /user to a new drive.
 
Old 01-05-2003, 03:43 AM   #12
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
I've been referring to that how-to alot lately Aussie, very well written, even for a newb I believe.

As for my P2P, well in linux I finally caved and gave up LimeWire (although it was decent for finding files, they never transferred) and have since then given a go (yet again) on gtk-gnutella, still don't like the program at all (seems to be completely worthless IMO) and more recently, gave a new go at DC+ (DirectConnect) and it really seems like it's going to be the best thing that ever happened to P2P on linux. I really could give up my dual boot P2P (which on win is Grokster) for this if it would just make a little more sense. It does great on file transfer, finds files well, and eventually I'll figure out the interfaces. But until I can really figure out how to use it, and understand it well, I will keep a small (~4GB) dual boot going. I really hope I can figure it out faster, or it comes out with a new release that is easier to understand.



Cool
 
Old 01-05-2003, 08:57 AM   #13
commuter
LQ Newbie
 
Registered: Dec 2002
Posts: 15

Original Poster
Rep: Reputation: 0
thks for all the tips guys later on this evening I should be able to find some time and give it a go!
I'll let u know how it turned out
commuter
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Seperate Partitions for /usr & /home? Jukas Debian 6 03-24-2005 11:50 AM
Moving VAR TMP HOME OPT to new partitions JWatson Linux - Newbie 2 01-03-2005 05:54 AM
mount / , /home , /home/usr on different partitions alekoos Slackware 14 05-03-2004 12:39 PM
Advantages of partitions for /home and /usr Rudebr00d Linux - General 15 01-29-2004 09:19 PM
softlink /usr to /home/usr ??? mlsfit Linux - General 4 11-09-2003 01:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:25 AM.

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