Table of Contents |
---|
...
Warning |
---|
It is always advisable to make a backup of the target VM first, ensuring you can recover your original VM should things go wrong ! |
Introduction
Generally you should only be needing to resize the partiton at the /data mountpoint on an NMIS VM as this partition contains the following directories:
...
Code Block |
---|
# centos|rhel sudo yum update sudo yum install -y cloud-utils-growpart # debian|ubuntu sudo apt update sudo apt install -y cloud-guest-utils |
Grow the partition at the /data mountpoint, which we now know from the df -h commands above is /dev/sdb1:
...
Resize the filesystem, which will take a bit of time and eventuallly tell you that it has resized the file system for the new extended disk size:
Code Block |
---|
# note there is NOT a space between '/dev/sdb' and '1':
sudo resize2fs /dev/sdb1
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/sdb1 is mounted on /data; on-line resizing required
old_desc_blocks = 5, new_desc_blocks = 15
The filesystem on /dev/sdb1 is now 31457019 blocks long. |
...
Moving and Resizing partitions /dev/sda1 to /dev/sda4 as needed where NMIS VM is using Traditional Partitions
This should not be necessary with regards to the NMIS VM and requires more thought, effort and skill to achieve.
For example, one could consider adding a third disk (dev/sdc) additional disks to the NMIS VM and moving the /home directory and|or any other directory consuming huge disk space to its own mountpoint on this third disk the additional disks as an alternative to growing partitions on disk 1 (/dev/sda).
...
Since disk 1 (/dev/sda) has more than 1 partition, GParted is probably a useful tool for this jobtask:
https://gparted.org/display-doc.php%3Fname%3Dmoving-space-between-partitions
NMIS VMs' using Logical
...
Volume Manager (LVM)
The resizing procedure is quite simple, for size increases at least. The two required steps are:
...
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 adddsadds the pv to the volume group vgextend vg_nmis64_data /dev/sdc |
...