LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-03-2010, 07:19 AM   #1
Bestnetcraft
LQ Newbie
 
Registered: May 2007
Posts: 6

Rep: Reputation: 0
RHEL - Expanding the / partition


We bought a new server with preinstalled RHEL 5. It has RAID 1 and 2 Hard drives of 500 GB capacity. This is what it shows:
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
3.9G 458M 3.3G 13% /
/dev/mapper/VolGroup00-LogVol05
3.9G 177M 3.6G 5% /home
/dev/mapper/VolGroup00-LogVol04
5.9G 3.9G 1.8G 70% /var
/dev/mapper/VolGroup00-LogVol03
3.9G 137M 3.6G 4% /tmp
/dev/mapper/VolGroup00-LogVol02
7.8G 2.1G 5.3G 29% /usr
/dev/sda3 190M 16M 165M 9% /boot
tmpfs 2.0G 0 2.0G 0% /dev/shm

I usually set up the / partition to the maximum size in all the installations. How do I resize the root partition and others without much of pain ? I tried googling to no avail. I would really appreciate any help.
 
Old 06-03-2010, 08:28 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Looks like you have tons of unused space, so:

• Create a new partition of type 8e (Linux LVM) with the free space using fdisk
• (probably) reboot the machine - to make the partition table readable
• pvcreate /dev/??? use the new partition created
• vgextend the root volume group using the new PV
example: /usr/sbin/vgextend VolGroup00 /dev/sda2
• lvextend the logical volume
example: lvextend -L+15G /dev/VolGroup00/LogVol00
• ext2online - to make the space viewable (may be called resize2fs on RHEL 5)
example ext2online /dev/VolGroup00/LogVol00
• Test for free space - df -h

Last edited by AlucardZero; 06-03-2010 at 08:29 AM.
 
Old 06-03-2010, 08:35 AM   #3
JD50
Member
 
Registered: Nov 2007
Location: Virginia
Distribution: Fedora, RHEL, CentOS
Posts: 67

Rep: Reputation: 17
Do what AlucardZero suggested. Also, he's right, the correct command is resize2fs.
 
Old 06-04-2010, 07:28 AM   #4
Bestnetcraft
LQ Newbie
 
Registered: May 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks AlucardZero.

Here is the situation now:
Disk /dev/sda: 499.5 GB, 499558383616 bytes
255 heads, 63 sectors/track, 60734 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 9 72261 de Dell Utility
/dev/sda2 10 662 5245222+ 8e Linux LVM
/dev/sda3 * 663 687 200812+ 83 Linux
/dev/sda4 688 60734 482327527+ 5 Extended
/dev/sda5 688 60734 482327496 8e Linux LVM


I am a little confused about the pvcreate part. I am sorry.
 
Old 06-04-2010, 09:25 AM   #5
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
so sda5 is new? just run: pvcreate /dev/sda5, then continue
 
Old 06-05-2010, 12:32 AM   #6
Bestnetcraft
LQ Newbie
 
Registered: May 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks for being with me.
Now it says this:
Can't initialize physical volume "/dev/sda5" of volume group "VolGroup00" without -ff

And then I forced it like this:

pvcreate /dev/sda5 -ff

Really INITIALIZE physical volume "/dev/sda5" of volume group "VolGroup00" [y/n]? y
Can't open /dev/sda5 exclusively. Mounted filesystem?
 
Old 06-05-2010, 02:40 AM   #7
Bestnetcraft
LQ Newbie
 
Registered: May 2007
Posts: 6

Original Poster
Rep: Reputation: 0
I am sorry about this. I decided to start from the scratch and reinstall the RHEL after partitioning as I wanted. Thanks for AlucardZero and JD50.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] trouble expanding 4+TB GPT partition after expanding hardware RAID-5 volume muad'dib Linux - Enterprise 6 09-26-2009 05:01 PM
Expanding permissions for fuser beyond root to all users on RHEL 5.1 davetaylorjr Linux - Newbie 3 12-31-2008 07:06 PM
Expanding an NTFS partition nonoitall Linux - Newbie 3 05-20-2005 03:58 PM
Expanding a partition echid Linux - General 1 08-12-2002 10:21 AM
need help expanding a partition linuxmaster Linux - General 2 12-01-2001 03:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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