Maddy
asked on
pvresize is not growing required space in VM
Hi experts.
Requirement?
Need to add 10GB of space to existing disk (/dev/sde1)
What we did?
Increase the size of the disc in VSphere to 10GB and rescanned the drive so the 10GB was available in Linux VM.
Issue :
The "pvresize" command not increased the disc size?
]# pvresizr -v /dev/sde1
-bash: pvresizr: command not found
[root@sap4expfs etc]# pvresize -v /dev/sde1
Using physical volume(s) on command line
Archiving volume group "vg_app3" metadata (seqno 14).
No change to size of physical volume /dev/sde1.
Resizing volume "/dev/sde1" to 419430015 sectors.
Updating physical volume "/dev/sde1"
Creating volume group backup "/etc/lvm/backup/vg_app3" (seqno 15).
Physical volume "/dev/sde1" changed
1 physical volume(s) resized / 0 physical volume(s) not resized
# pvscan
PV /dev/sde1 VG vg_app3 lvm2 [199.97 GB / 992.00 MB free]
PV /dev/sdd VG vg_app2 lvm2 [339.94 GB / 0 free]
PV /dev/sdc2 VG vg_app1 lvm2 [250.00 GB / 152.00 GB free]
]# vgdisplay vg_app3
--- Volume group ---
VG Name vg_app3
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 15
VG Access read/write
VG Status resizable
MAX LV 256
Cur LV 10
Open LV 10
Max PV 256
Cur PV 1
Act PV 1
VG Size 199.97 GB
PE Size 32.00 MB
Total PE 6399
Alloc PE / Size 6368 / 199.00 GB
Free PE / Size 31 / 992.00 MB
VG UUID zF1nKy-rtTc-JhW4-2jGu-kBti -027p-DpFU Zg
# pvdisplay /dev/sde1
--- Physical volume ---
PV Name /dev/sde1
VG Name vg_app3
PV Size 200.00 GB / not usable 31.81 MB
Allocatable yes
PE Size (KByte) 32768
Total PE 6399
Free PE 31
Allocated PE 6368
PV UUID KTH7TQ-zmlx-lFWf-1lYn-StQN -uB7Q-5X8R ky
Thanks,
SK
Requirement?
Need to add 10GB of space to existing disk (/dev/sde1)
What we did?
Increase the size of the disc in VSphere to 10GB and rescanned the drive so the 10GB was available in Linux VM.
Issue :
The "pvresize" command not increased the disc size?
]# pvresizr -v /dev/sde1
-bash: pvresizr: command not found
[root@sap4expfs etc]# pvresize -v /dev/sde1
Using physical volume(s) on command line
Archiving volume group "vg_app3" metadata (seqno 14).
No change to size of physical volume /dev/sde1.
Resizing volume "/dev/sde1" to 419430015 sectors.
Updating physical volume "/dev/sde1"
Creating volume group backup "/etc/lvm/backup/vg_app3" (seqno 15).
Physical volume "/dev/sde1" changed
1 physical volume(s) resized / 0 physical volume(s) not resized
# pvscan
PV /dev/sde1 VG vg_app3 lvm2 [199.97 GB / 992.00 MB free]
PV /dev/sdd VG vg_app2 lvm2 [339.94 GB / 0 free]
PV /dev/sdc2 VG vg_app1 lvm2 [250.00 GB / 152.00 GB free]
]# vgdisplay vg_app3
--- Volume group ---
VG Name vg_app3
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 15
VG Access read/write
VG Status resizable
MAX LV 256
Cur LV 10
Open LV 10
Max PV 256
Cur PV 1
Act PV 1
VG Size 199.97 GB
PE Size 32.00 MB
Total PE 6399
Alloc PE / Size 6368 / 199.00 GB
Free PE / Size 31 / 992.00 MB
VG UUID zF1nKy-rtTc-JhW4-2jGu-kBti
# pvdisplay /dev/sde1
--- Physical volume ---
PV Name /dev/sde1
VG Name vg_app3
PV Size 200.00 GB / not usable 31.81 MB
Allocatable yes
PE Size (KByte) 32768
Total PE 6399
Free PE 31
Allocated PE 6368
PV UUID KTH7TQ-zmlx-lFWf-1lYn-StQN
Thanks,
SK
try this - http://content.hccfl.edu/pollock/AUnix1/LVM.htm
not all filesystems support growing and shrinking
Have you run
resize2fs
?
You have to grow your file system after resizing your lvm
resize2fs
?
You have to grow your file system after resizing your lvm
Issue command
resize2fs </dev/Devicename/of/lvm>
resize2fs </dev/Devicename/of/lvm>
ASKER
HI farzani:
# pvscan
PV /dev/sde1 VG vg_app3 lvm2 [199.97 GB / 992.00 MB free]
PV /dev/sdd VG vg_app2 lvm2 [339.94 GB / 0 free]
PV /dev/sdc2 VG vg_app1 lvm2 [250.00 GB / 152.00 GB free]
the /dev/sde1 still shows 200GB , not 210GB which 10GB we added from Vcenter.
Without growing disk (/dev/sde1) how can grow FS.
Thanks
sk
# pvscan
PV /dev/sde1 VG vg_app3 lvm2 [199.97 GB / 992.00 MB free]
PV /dev/sdd VG vg_app2 lvm2 [339.94 GB / 0 free]
PV /dev/sdc2 VG vg_app1 lvm2 [250.00 GB / 152.00 GB free]
the /dev/sde1 still shows 200GB , not 210GB which 10GB we added from Vcenter.
Without growing disk (/dev/sde1) how can grow FS.
Thanks
sk
Well, you are right. What I was talking about is a much later stage.
In /dev/sde1, I don't even see 10GB free. I only see 992MB, less than 1GB. So pvresize would not help.
I see a lot of extra space in /dev/sdc2.
In /dev/sde1, I don't even see 10GB free. I only see 992MB, less than 1GB. So pvresize would not help.
I see a lot of extra space in /dev/sdc2.
ASKER
Hi farzani:
Yes , /dev/sde1 don't have space . Hence from Vcenter(VMware). We added 10GB space to /dev/sde1 & i am trying to do "pvresize" command to resize (/dev/sde1). The Linux box we supporting is VM, it getting Virtual storage from datastorage. Below are the fdisk output .
# fdisk -l
Disk /dev/sda: 128.8 GB, 128849018880 bytes
255 heads, 63 sectors/track, 15665 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 11762 94373842+ 82 Linux swap / Solaris
/dev/sda3 11763 15665 31350847+ 83 Linux
Disk /dev/sdb: 22.5 GB, 22548578304 bytes
255 heads, 63 sectors/track, 2741 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 1305 10482381 83 Linux
/dev/sdb2 1306 1958 5245222+ 83 Linux
/dev/sdb3 1959 2611 5245222+ 83 Linux
/dev/sdb4 2612 2741 1044225 5 Extended
/dev/sdb5 2612 2741 1044193+ 83 Linux
Disk /dev/sdc: 365.0 GB, 365072220160 bytes
255 heads, 63 sectors/track, 44384 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 609 4891761 82 Linux swap / Solaris
/dev/sdc2 11749 44384 262148670 83 Linux
Disk /dev/sdd: 365.0 GB, 365072220160 bytes
255 heads, 63 sectors/track, 44384 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdd doesn't contain a valid partition table
Disk /dev/sde: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sde1 1 26109 209715199+ 8e Linux LVM
Yes , /dev/sde1 don't have space . Hence from Vcenter(VMware). We added 10GB space to /dev/sde1 & i am trying to do "pvresize" command to resize (/dev/sde1). The Linux box we supporting is VM, it getting Virtual storage from datastorage. Below are the fdisk output .
# fdisk -l
Disk /dev/sda: 128.8 GB, 128849018880 bytes
255 heads, 63 sectors/track, 15665 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 11762 94373842+ 82 Linux swap / Solaris
/dev/sda3 11763 15665 31350847+ 83 Linux
Disk /dev/sdb: 22.5 GB, 22548578304 bytes
255 heads, 63 sectors/track, 2741 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 1305 10482381 83 Linux
/dev/sdb2 1306 1958 5245222+ 83 Linux
/dev/sdb3 1959 2611 5245222+ 83 Linux
/dev/sdb4 2612 2741 1044225 5 Extended
/dev/sdb5 2612 2741 1044193+ 83 Linux
Disk /dev/sdc: 365.0 GB, 365072220160 bytes
255 heads, 63 sectors/track, 44384 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 609 4891761 82 Linux swap / Solaris
/dev/sdc2 11749 44384 262148670 83 Linux
Disk /dev/sdd: 365.0 GB, 365072220160 bytes
255 heads, 63 sectors/track, 44384 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdd doesn't contain a valid partition table
Disk /dev/sde: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sde1 1 26109 209715199+ 8e Linux LVM
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi farzani:
Sorry i new to the Linux Vm
How i can extend partition using parted or gparted.
Thaks
sk
Sorry i new to the Linux Vm
How i can extend partition using parted or gparted.
Thaks
sk
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You would issue
parted /dev/sde
Inside parted:
print
resize 1 1 <END_BLOCK>
parted /dev/sde
Inside parted:
resize 1 1 <END_BLOCK>
ASKER
Hi farzani:
Thanks!
How to rescan the scsi devices.
Sk
Thanks!
How to rescan the scsi devices.
Sk
partprobe
Resized successfully?
ASKER
Finely Red hat fix the issue.