LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 12-15-2003, 08:46 PM   #1
gregkise
LQ Newbie
 
Registered: Nov 2003
Posts: 3

Rep: Reputation: 0
Partition Free Space - Move /home to the new partition


Hi All,

When I installed RH 9 for some reason it put the boot and swap on hda and everything else on hdb. It also left 37 gig of free space on hda (which I would like to reclaim). How do I make a new ext3 partition out of the free space and then move /home to the new partition.

BTW - my overall theoritical strategy was to use Disk Druid to partition the free space, then copy /home to a temporary directory ( /newhome ) on the new partition, then edit fstab to make the new directory home. But I don't know the details to make this work without screwing something up.

Thanks much!
Greg

-----------------------------------------------------------------------

Here is the data from fdisk -l (with some editing).

Disk /dev/hda: 40.0 GB, 40027029504 bytes (Maxtor 40gig)
255 heads, 63 sectors/track, 4866 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 143 1044225 82 Linux swap
........................144 4866 37048000 FREE SPACE

Disk /dev/hdb: 40.0 GB, 40020664320 bytes (Seagate 40gig)
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 4865 39078081 83 Linux
 
Old 12-16-2003, 12:16 AM   #2
Scruff
Member
 
Registered: Oct 2002
Location: Stoughton, MA
Distribution: Gentoo x86_64 & PPC
Posts: 949

Rep: Reputation: 30
You've got it basically. I just helped someone do this same thing a week or two ago here.

Give that a quick look and if you have any questions post em up

Last edited by Scruff; 12-16-2003 at 12:19 AM.
 
Old 12-16-2003, 07:56 AM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
If you want to take a look at my latest journal, I explained in it how I moved my partition /var to a new drive/partition. Might be helpful to you: http://www.linuxquestions.org/questi...60&action=view
 
Old 12-16-2003, 06:04 PM   #4
ac1980
Member
 
Registered: Aug 2003
Location: Trento, Italy
Distribution: Debian testing
Posts: 394

Rep: Reputation: 30
I had a look at Scuff post, and I have a patch to suggest (can u apply it, pls?):

When moving/archiving filesystem piecies as root, I strongly suggest giving cp the "--archive" (short -a) option instead of -R, It will keep original ownership, permissions and so on.
Refer to cp manpage.

Last edited by ac1980; 12-16-2003 at 06:08 PM.
 
Old 12-16-2003, 06:16 PM   #5
Scruff
Member
 
Registered: Oct 2002
Location: Stoughton, MA
Distribution: Gentoo x86_64 & PPC
Posts: 949

Rep: Reputation: 30
lol! Just got finished reading your post on the other thread. Good idea though, and I will make the changes.
 
Old 12-16-2003, 10:19 PM   #6
gregkise
LQ Newbie
 
Registered: Nov 2003
Posts: 3

Original Poster
Rep: Reputation: 0
Woohoo

I think I just graduated from newbie-ville.

I successfully partitioned the free space (using cfdisk), set up my file system (mkfs.ext3), and moved my /home directory to the new partition using this great command from MaroonBaboon:

# cd /home ; tar cf - * | ( cd /mnt/newhome ; tar xvf - )

BTW - I made a small variation on the whole move thing which worked quite nicely.

1) I copied /home to /mnt/newhome, edited fstab appropriately, and testing that this worked by mounting and unmounting.

2) I created a dummy directory called /home/test. Remember I previously copied /home to /mnt/newhome without the dummy "test" directory

3) I edited fstab to mount the new partition at /home. And then mounted the new partition.

4) If the mount worked properly and all was well I should no longer see /home/test. And this is exactly what happened (fortuitously). I could then umount and see the /home/test directory reappear.

5) Finally I reboot and start working on the new partition. Assuming all goes well for the next couple of weeks I'll unmount the new partition and delete the old /home (I know I could probably do this now, but I'm a chickenS&!t).

Oh yeah -- I also rearranged the desktop on the old home just to make doubly sure when I rebooted.

--------
A couple things that might help other newbies with similar problems. First, cfdisk doesn't come installed on RH9 machines - you have to go out and download the cfdisk rpm (I used cfdisk-glibc).

Second, I wasn't able to access these commands from a terminal inside X - even as SU. I had to open a new shell using ctrl-alt-F1 then login as root to use fdisk and/or cfdisk.

Third, the documentation on cfdisk is a little sketchy. It wasn't clear that you have to Write the partition after you set it up - and doing this the first time is a little scary if you're not 100% positive that this is the proper thing to do (I was probably 95%).

That's all. Thanks Scruff and Trickykid. I really appreciate all your help!

Greg
 
  


Reply



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
Ambiguity in free disk space in /home partition vharishankar Linux - General 15 02-22-2013 02:58 PM
Creat free space from /home partition, how? hraposo Mandriva 1 09-22-2004 12:09 PM
How do i move /home to a new partition? glenn69 Linux - General 8 06-25-2004 11:38 AM
How to move space from one partition to another? Rgamboa Linux - Newbie 3 05-16-2003 04:39 PM
How to move space from one partition to another? Rgamboa Linux - Software 1 05-16-2003 04:02 PM

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

All times are GMT -5. The time now is 05:48 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