...
- adding extra storage 'hardware' to the VM
- informing the operating system of the extra storage, attaching the storage and resizing the active file systsystems.
This is possible because the Opmantek Virtual appliance makes use of Linux's excellent LVM support (Logical Volume Management, described in more details here).
First Step, determine the current state
...
If you would like to avoid any downtime and not reboot, that's also possible if your virtualisation system allows adding or resizing disks "on the go": Virtualbox doesn't allow that, Vmware does. Please note that vmware Vmware doesn't let you resize disks if there are any snapshots present; if that is the case, then these snapshots must be removed before the resize can occur.
In many cases it will be simpler to add another 'disk' to the system rather than resizing either of the existing 'disks'.
Third Step, Informing the OS and resizing the file system
When the VM boots the newly resized disk 2 (aka /dev/sdb) will be detected but volume group and logical volume still need to be told about the change of 'hardware'. (
If you added a new disk
If you did add disks on the goinstead of resizing existing ones, the OS should have picked them up dynamically and they should show up as /dev/sdc, sdd etc. In this case they must be registered as physical volumes (optionally after partitioning) Login , and added to the volume group.
To do so, login as root first. Then check under what id your new disk has shown up, and add it as a whole as a new physical volume:
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
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 | ||
---|---|---|
| ||
pvresize /dev/sdb |
which will tell you that sdb is now as large as the disk2 size you gave in vmware.Now
New or resized disk
Finally run
Code Block | ||
---|---|---|
| ||
lvextend -l 100%VG /dev/vg_nmis64_data/lv_data |
...