Results 1 to 2 of 2
I have a problem extending an existing logical volume when adding a new hard drive.
This is what my disk setup looked like before:
Code:
[root@centos ~]# df -h
Filesystem ...
- 09-11-2009 #1Just Joined!
- Join Date
- Aug 2008
- Posts
- 9
Extending a logical volume
I have a problem extending an existing logical volume when adding a new hard drive.
This is what my disk setup looked like before:
I added a second hard drive to my server (/dev/sdb), formatted it with Linux LVM as its primary partition, and then put a logical ext3 partition on it.Code:[root@centos ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 64G 1.4G 60G 3% / /dev/sda1 99M 19M 76M 20% /boot tmpfs 633M 0 633M 0% /dev/shm
I then created a physical volume for the disk with the commandCode:[root@centos ~]# fdisk -l Disk /dev/sda: 73.4 GB, 73407868928 bytes 255 heads, 63 sectors/track, 8924 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 8924 71577607+ 8e Linux LVM Disk /dev/sdb: 36.9 GB, 36954401792 bytes 255 heads, 63 sectors/track, 4492 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 4492 36081958+ 8e Linux LVM
I then ranCode:pvcreate /dev/sdb1
thenCode:[root@centos ~]# vgextend /dev/VolGroup00 /dev/sdb1 Volume group "VolGroup00" successfully extended
My first hard disk is ~65 GB and my second is ~35. So the combined total should be ~100.Code:[root@centos ~]# lvextend /dev/VolGroup00/LogVol00 /dev/sdb1 Extending logical volume LogVol00 to 100.16 GB Logical volume LogVol00 successfully resized
So this output looks correct:
(the combined total is ~100 GB)Code:[root@centos ~]# lvdisplay --- Logical volume --- LV Name /dev/VolGroup00/LogVol00 VG Name VolGroup00 LV UUID qYo1cg-ldD0-ursB-pbhi-EjUP-7yH8-eeLDIf LV Write Access read/write LV Status available # open 1 LV Size 100.16 GB Current LE 3205 Segments 2 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0 --- Logical volume --- LV Name /dev/VolGroup00/LogVol01 VG Name VolGroup00 LV UUID Uvc0br-Fq2U-WYvi-9I98-ADLH-aKSj-COxsor LV Write Access read/write LV Status available # open 1 LV Size 2.50 GB Current LE 80 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:1
But, "df -h" looks unchanged:
How do I fix this? Must you "commit" the changes to the filesystem somehow?Code:[root@centos ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 64G 1.4G 60G 3% / /dev/sda1 99M 19M 76M 20% /boot tmpfs 633M 0 633M 0% /dev/shm
- 09-11-2009 #2Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
Google: how to extend volume lvm


Reply With Quote