Skip to main content

Expanding the Disk on a FileWave Appliance - 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 oron 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

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 theThe commands to expand the disk on Debian are as follows. Perform the commands as root or use sudo before each command;command and know that these are meant for the FileWave Appliance images. If you use your own Debian install you can still expand your partitions but the names of the disks and partitions will differ so you'll need to adjust the commands used. 

# Make sure the tools are present
sudo apt update
&&sudo apt install -y cloud-guest-utils

# Extend the partitions
sudo growpart /dev/sda 2 || true

# Older Appliances will use the next 2 lines
# If you get an error for them then you should
# try the next 2 lines.
sudo growpart /dev/sda 5 || true
sudo pvresize /dev/sda5

# Newer Appliances will use the next 2 lines
# Do these if the prior 2 lines showed an error
# There is no harm in running the prior lines and these
sudo growpart /dev/sda 3 || true
sudo pvresize /dev/sda3

# Next lines are for all appliances
sudo lvextend -l +100%FREE /dev/mapper/filewave--vg-root
sudo resize2fs /dev/mapper/filewave--vg-root
sudo reboot