Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4160
  • Last Modified:

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-DpFUZg

# 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-5X8Rky


Thanks,

SK
0
Maddy
Asked:
Maddy
  • 8
  • 5
2 Solutions
 
Randy DownsOWNERCommented:
try this - http://content.hccfl.edu/pollock/AUnix1/LVM.htm

not all filesystems support growing and shrinking
0
 
farzanjCommented:
Have you run

resize2fs

?

You have to grow your file system after resizing your lvm
0
 
farzanjCommented:
Issue command

resize2fs </dev/Devicename/of/lvm>
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
MaddyUNIXAuthor Commented:
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
0
 
farzanjCommented:
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.
0
 
MaddyUNIXAuthor Commented:
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


0
 
farzanjCommented:
Sorry, I was lost :)

You have two options

1.  Extend your partition /dev/sde1 using parted or gparted.
2.  OR create another partition on /dev/sde1 using parted or fdisk.

0
 
MaddyUNIXAuthor Commented:
Hi farzani:

Sorry i new to the Linux Vm

How i can extend partition using parted or gparted.

Thaks

sk

0
 
farzanjCommented:
Do this:

parted /dev/sde

You can type help to see all the commands available

Then you chose your partition 1

you have to issue command resize

All of this is done within parted program

Here is some description

http://www.centos.org/docs/5/html/Deployment_Guide-en-US/ch-disk-storage.html
0
 
farzanjCommented:
You would issue
parted /dev/sde

Inside parted:

print
resize 1 1 <END_BLOCK>
0
 
MaddyUNIXAuthor Commented:
Hi farzani:

Thanks!

How to rescan the scsi devices.

Sk
0
 
farzanjCommented:
partprobe
0
 
farzanjCommented:
Resized successfully?
0
 
MaddyUNIXAuthor Commented:
Finely Red hat fix the issue.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

  • 8
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now