If it should become necessary to expand the storage space for /data, the following set of instructions should help you to perform that change with minimal NMIS downtime.
...
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 | ||
---|---|---|
| ||
# 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 | ||
---|---|---|
| ||
# 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 | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
cfdisk /dev/sda
reboot
pvcreate /dev/sda3 |
Extend the vg_nmis64_data with the new partition
Code Block | ||
---|---|---|
| ||
vgextend vg_nmis64_data /dev/sda3 |
The Logical Volume needs to be extended.
Code Block | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
resize2fs /dev/vg_nmis64_data/lv_data |
Verify the new size.
...
theme | Emacs |
---|
...