LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-08-2007, 11:43 PM   #1
JohnGalt007
LQ Newbie
 
Registered: Jan 2007
Posts: 2

Rep: Reputation: 0
expand root partition to occupy whole disk


I have a pretty old Linux server running some version of redhat. It has a 6 GB disk of which 2 GB are devoted to / and rest of the 4 GB to /home as shown below by df -h command:

Filesystem Size Used Avail Use% Mounted on
/dev/hda1 1.9G 1.8G 25M 99% /
/dev/hda5 3.9G 3.1G 582M 85% /home
none 161M 0 161M 0% /dev/shm


As you can see my root file system is almost 100% full. I'd like to move /home to a new disk and let / occupy the whole 6GB.

I know how to move /home to another disk. But how do I reclaim the space created by /home such that root file system takes up all 6GB without a new installation of the operating system?

Any pointers or solutions would be appreciated.

Thanks.

JG
 
Old 01-09-2007, 12:11 AM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
gparted can resize partitions and it comes on a bootable livecd:

http://gparted.sourceforge.net/

Note, you will need the live cd since you can't resize on a live, running system. Here's some specific instructions on using gparted to resize a partition:

http://gparted.sourceforge.net/larry...e/resizing.htm

If you have some external storage or space on another internal hard drive, I'd back up your root partition from that gparted livecd using tar:

# cd <mount point of root partition on livecd>
# tar -czvf <path to partition that will recieve backup/filename_of_backup.tar.gz> .

Note the trailing period as it will not run without that.

Resizing with data on a partition is the highest risk partitioning operation with any partitioning tool so it's always best to backup first.
 
Old 01-09-2007, 03:23 PM   #3
JohnGalt007
LQ Newbie
 
Registered: Jan 2007
Posts: 2

Original Poster
Rep: Reputation: 0
kilgoretrout, thanks for the prompt reply and thank you for introudcing me to a wonderful tool. However, this did not help me. I was able to boot the machine with systemlinux live cd, which has gparted and a few other such goodies but I could not start X server. I got something like following error message on issuing startx command:

No usable screen found.
XIO error 104: X server could not be started

So, it seems I am stuck doing this at the CLI only unless someone can tell me how to start X server. This machine is pretty old with a PII 300 MHz and 128 MB RAM.

Can someone point me or provide instructions as to how to accomplish what I asked for in my first post here?

Thanks.

JG

Quote:
Originally Posted by kilgoretrout
gparted can resize partitions and it comes on a bootable livecd:

http://gparted.sourceforge.net/

Note, you will need the live cd since you can't resize on a live, running system. Here's some specific instructions on using gparted to resize a partition:

http://gparted.sourceforge.net/larry...e/resizing.htm

If you have some external storage or space on another internal hard drive, I'd back up your root partition from that gparted livecd using tar:

# cd <mount point of root partition on livecd>
# tar -czvf <path to partition that will recieve backup/filename_of_backup.tar.gz> .

Note the trailing period as it will not run without that.

Resizing with data on a partition is the highest risk partitioning operation with any partitioning tool so it's always best to backup first.
 
Old 01-09-2007, 04:55 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,137

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
Simplest solution is probably to find a good candidate directory, and move it to the newly freed space.
Pick your largest/most likely to grow - something like /var/log, or /opt maybe.

Frees space in your current root to allow other things to grow (slowly hopefully), and the "problem child" gets the new area.
I've used this to avoid having to risk a system I'd rather not play around with.

Else I'd second trying the gparted liveCD.
For CLI instructions, see the GNU parted (which does all the work anyway) site.
 
Old 01-09-2007, 06:03 PM   #5
timrs
Member
 
Registered: Nov 2005
Location: MN, US
Distribution: openSuse 10.2
Posts: 93

Rep: Reputation: 15
A computer with this little harddrive space can't have that much ram, don't you think it'd be a good idea to have a swap partition too?
 
  


Reply

Tags
disk, partitioning, resizing, space



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
Do device files occupy disk space? tarun301 Linux - General 1 12-15-2006 05:15 PM
Can I expand a reiserfs partition? LeftyAce Debian 4 12-13-2005 12:51 PM
Need to expand /usr partition marenkiapina Linux - Software 2 05-22-2004 06:27 AM
how to expand my /tmp...partition Zvezda Linux - General 2 07-03-2003 07:42 PM
disk quota root partition fosky Linux - Newbie 0 06-23-2002 04:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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