Skip to main content

Expanding the Disk on a FileWave Appliance - CentOS / Debian

This article provides steps for extending the root partition residing in a logical volume created with Logical Volume Manager (LVM) in a virtual machine running CentOS.CentOS or Debian.

Step-by-step guide for CentOS

Expanding the Disk for CentOS

This has been tested on FileWave Server version 14.7.2 and CentOS Linux release 7.9 (Core).
Resources: https://kb.vmware.com/s/article/1006371

Step-by-step guide

Caution: Take a complete backup/snapshot of the VM prior to making these changes.

sda3 is the new Partition.

centos is the physical volume.

root is the logical volume.

1. Edit the virtual machine settings and extend the virtual disk size. This varies for each VM but can be configured in the VM settings for most environments.

2. Identify the device name, which is by default /dev/sda**, and confirm the new size by running the command as root:**

fdisk -l

3. Create a new primary partition:

  • Run the command as root:
    fdisk /dev/sda
    
  • Press p to print the partition table to identify the number of partitions. By default, there are 2: sda1 and sda2.
  • Press n to create a new primary partition.
  • Press p for primary.
  • Press 3 for the partition number, depending on the output of the partition table print.
  • Press Enter two times.
  • Press t to change the system's partition ID.
  • Press 3 to select the newly created partition.
  • Type 8e to change the Hex Code of the partition for Linux LVM.
  • Press w to write the changes to the partition table.

4. Restart the virtual machine.

After the machine is started login to the VM as root and run this command to verify that the changes were saved to the partition table and that the new partition has an 8e type:

fdisk -l

5. Run this command to convert the new partition to a physical volume:

pvcreate /dev/sda3

6. Run this command to extend the physical volume:

vgextend centos /dev/sda3
# or newer servers with volume name changes
vgextend centos_filewave /dev/sda3

Note: To determine which volume group to extend, use the command vgdisplay.

7. Run this command to verify how many physical extents are available to the Volume Group:

vgdisplay centos | grep "Free"
# or newer servers with volume name changes
vgdisplay centos_filewave | grep "Free"

8. Run the following command to extend the Logical Volume to the Maximum amount available:

lvextend -l +100%FREE /dev/centos/root
# or newer servers with volume name changes
lvextend -l +100%FREE /dev/centos_filewave/root

9. Run the following command to expand the ext3 filesystem online, inside of the Logical Volume:

resize2fs /dev/centos/root
# or newer servers with volume name changes
resize2fs /dev/centos_filewave/root

If you receive an error regarding a "Bad Magic Number', you have a different file system type. Try using this command instead:

xfs_growfs /dev/centos/root
# or newer servers with volume name changes
xfs_growfs /dev/centos_filewave/root

10. Run the following command to verify that the / filesystem has the new space available:

df -h /

Step-by-step guide for Debian

Expanding the Disk for Debian

More detail to be added shortly, but the commands to expand the disk on Debian are as follows. Perform the commands as root or use sudo before each command;

apt update && apt install -y cloud-guest-utils
growpart /dev/sda 2 || true
growpart /dev/sda 5 || true
pvresize /dev/sda5
lvextend -l +100%FREE /dev/mapper/filewave--vg-root
resize2fs /dev/mapper/filewave--vg-root