Extend Partition and Linux LVM on a virtual Server
Linux - Virtualization and CloudThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.