LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 12-16-2011, 07:25 AM   #1
Steve_Aug
LQ Newbie
 
Registered: May 2011
Posts: 17

Rep: Reputation: Disabled
Extend Partition and Linux LVM on a virtual Server


Dear All,

I installed CentOS 5.7 from scratch on a virtual server with Disk Space ~ 20 GB.

It looked like::
# fdisk -l /dev/sda

Disk /dev/sda: ~ 20 GB,
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 268 2048287+ 82 Linux swap / Solaris
/dev/sda3 269 2610 18812115 8e Linux LVM

and

# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
18219452 2112220 15166792 13% /
/dev/sda1 101086 12960 82907 14% /boot
tmpfs 9239900 0 9239900 0% /dev/shm



Now the Disk (Space) was extended to ~ 26GB.
I created now a new partition with the fdisk command (fdisk /dev/sda) and now it looks like:
# fdisk -l /dev/sda

Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 268 2048287+ 82 Linux swap / Solaris
/dev/sda3 269 2610 18812115 8e Linux LVM
/dev/sda4 2611 3263 5245222+ 5 Extended
/dev/sda5 2611 3263 5245191 83 Linux

My first question - /dev/sda4 and /dev/sda5 is more or less the same !!??

What I want to do now:
Increase /dev/sda3 (from 269 to 3263 resp. from 20 GB to 26 GB), which probably means to delete /dev/sda4 and /dev/sda5 (??).
Additionally/afterwards I want to increase the Logival Volume.


I would appreciate if somebody can tell me how to do it - as I'm not so familiar with this stuff please give the neccessary commands (as much detailed as possible).
I've tried a a pvresize and lvextend (""pvresize -v /dev/sda3"" and ""lvextend -l 574 /dev/mapper/VolGroup00-LogVol00""), but this was probably bullshit.

Thanks
Stefan

Not sure if you need the following information:
# pvdisplay /dev/sda3
/dev/hdc: open failed: No medium found
--- Physical volume ---
PV Name /dev/sda3
VG Name VolGroup00
PV Size 17.94 GB / not usable 3.21 MB
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 574
Free PE 0
Allocated PE 574
PV UUID vMZrO2-kCRT-nTjU-Gzgn-WI3m-qZON-VohByg




# vgdisplay -v
Finding all volume groups
/dev/hdc: open failed: No medium found
Finding volume group "VolGroup00"
--- Volume group ---
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 17.94 GB
PE Size 32.00 MB
Total PE 574
Alloc PE / Size 574 / 17.94 GB
Free PE / Size 0 / 0
VG UUID dGXirw-lvMH-Py00-PqcR-4oUt-13Fo-SA9QbS

--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID o1Bgui-kLxB-dyHK-ecH2-v1Ss-QVCc-bduCPR
LV Write Access read/write
LV Status available
# open 1
LV Size 17.94 GB
Current LE 574
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0

--- Physical volumes ---
PV Name /dev/sda3
PV UUID vMZrO2-kCRT-nTjU-Gzgn-WI3m-qZON-VohByg
PV Status allocatable
Total PE / Free PE 574 / 0




# lvdisplay /dev/mapper/VolGroup00-LogVol00
/dev/hdc: open failed: No medium found
--- Logical volume ---
LV Name /dev/VolGroup00/LogVol00
VG Name VolGroup00
LV UUID o1Bgui-kLxB-dyHK-ecH2-v1Ss-QVCc-bduCPR
LV Write Access read/write
LV Status available
# open 1
LV Size 17.94 GB
Current LE 574
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
 
Old 12-16-2011, 09:30 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Please do not post questions more than once. See reply in your other thread.
 
  


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
[SOLVED] How to extend /home or / partition through LVM smilemukul Linux - Newbie 9 01-29-2012 11:07 PM
Extend LVM partition rconan Linux - Software 5 08-31-2010 02:32 AM
How to make LiveCD detect and mount extend/LVM partition satimis Linux - General 2 08-30-2007 09:01 PM
How to extend an existing partition without LVM james.reid Linux - Software 14 06-02-2006 12:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

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