Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: updated clarify the cases for resizing existing disks

...

Code Block
cat /proc/scsi/scsi
...
Host: scsi2 Channel: 00 Id: 01 Lun:  # the '2' indicates /dev/sdc is the device file
# this marks the whole disk as physical volume
pvcreate /dev/sdc 
# this addds the pv to the volume group
vgextend vg_nmis64_data /dev/sdc
If you resized an existing disk that was partitioned (e.g. the FIRST harddisk):

The resized disk will have grown, but the partition table on it won't reflect the new size yet, and thus  the extra space needs claiming before it can be accessed.

To do that, login as root, then add a new partition to the existing disk, make it use all the new space and give it type 8E (= Linux LVM), reboot to ensure the partition table is actually reread (this doesn't always work on-the-go); when that is done, create a new physical volume on that extra partition.

Code Block
themeEmacs
# assuming the modified disk is the first one, ie. /dev/sda
cfdisk /dev/sda # but you may prefer to use fdisk or gdisk instead
#...go through dialog to claim the extra space, let's assume we create /dev/sda4
reboot
pvcreate /dev/sda4
If you resized an existing disk that was used without partitions, just as phyiscal LVM volume (e.g. 2nd or 3rd harddisk):

In this case we just tell the LVM subsystem that there's now more space available in a particular physical volume. Login as root, then run

Code Block
themeEmacs
# assuming that the second disk was resized
pvresize /dev/sdb

which will tell you that sdb is now as large as the disk2 size you gave configured in vmwareyour virtualisation tool.

New or resized disk

Finally we're ready to add the new space to the logical volume we need it in; To do that, login as root and run

Code Block
themeEmacs
lvextend -l 100%VG /dev/vg_nmis64_data/lv_data

...

should show that /data is now larger than before.

Resizing from disk1

Add a x(g,m,k) new partition  type 8E (Linux LVM) 

Code Block
themeEmacs
cfdisk /dev/sda
reboot
pvcreate /dev/sda3

Extend the vg_nmis64_data with the new partition

Code Block
themeEmacs
vgextend vg_nmis64_data /dev/sda3

The Logical Volume needs to be extended.

Code Block
themeEmacs
lvextend -L+x(g,m,k) /dev/vg_nmis64_data/lv_data
where
x(g,m,k) is the assigned size in the disk 1 -L+200G as example

Now we extend the filesystem this can take a while depends of the size assigned.

Code Block
themeEmacs
resize2fs /dev/vg_nmis64_data/lv_data

Verify the new size.

...

themeEmacs

 

 

...