Expanding harddisk size

If your FileCap server does not have enough disk space left and you want to expand the disk this can be done by following these steps.

Important: Please be aware that making changes to hard disk size/partitions can cause data loss if something goes wrong. Make sure you have a full backup of the FileCap Server.

 

Determine the correct procedure

  1. Login to the FileCap server with SSH
  2. In the console menu choose option 6. “Admin prompt”.
  3. Switch to the root user using the command:
    sudo su
  4. Determine if the FileCap server is using LVM partitioning or not
    To do this enter the command: ‘fdisk -l’ and review the result.fdisk-lvm 

 

Steps if the FileCap server is using LVM

  1. Backup the whole FileCap server, because we are changing partitions something can go wrong, so a backup is necessary.
  2. Expand the virtual disk (in VMware/Hyper-V) to the desired size. (For advised hard disk sizing see the chapter “System requirements“)
  3. Login to the FileCap server with SSH
  4. In the console menu choose option 3. “Admin prompt”
    3
  5. Switch to the root user using the command:
    sudo su
  6. Enter cfdisk using the following command
    cfdisk /dev/sda
  7. Using the arrow keys navigate to Free space and create a New partition by pressing enter.
  8. Accept the default partition size by pressing enter.
  9. After creating the new partition, change the Type to Linux LVM.

  10. After changing the partition type, Write changes to disk.
  11. Quit cfdisk.

  12. Rescan the partition table by running the following command, remember the highlighted partition number from your own output (In the example it is #3, yours may differ.):
    partx -v -a /dev/sda

  13. Afterwards, you can see the newly created partition with fdisk by entering:
    fdisk -l /dev/sda

  14. Create a physical volume with the following command, replace sda partition number with your own from step 12:
    pvcreate /dev/sda3


  15. Find out what your Volume Group is called with the following command:
    vgdisplay

  16. Extend the volume group by adding the physical volume with the following command, replace sda partition number and the Volume Group name with your own from the output of steps 12 and 15:
    vgextend filecap-vg /dev/sda3


  17. With the following command we can see our newly added physical volume and the usable space:
    pvscan

  18. Use the following command to find your root Logical Volume path:
    lvdisplay

  19. Use the following command to extend the Logical Volume, replace sda partition number and the Logical Volume path with your own from the output of steps 12 and 18:
    lvextend /dev/filecap-vg/root /dev/sda3


  20. Now resize the root file system to use the newly available space, to do this use the following command, replace the Logical Volume path with yours from step 18:
    resize2fs /dev/filecap-vg/root

  21. The root file system has now been resized, this can be validated with the following command:
    df -h


 

Steps if the FileCap server is using something else

  1. Backup the whole FileCap server, because we are changing partitions something can go wrong, so a backup is necessary.
  2. Download the latest stable version of the partition manager GParted ISO file from https://gparted.org/download.php
  3. Shutdown the FileCap server
  4. Expand the virtual disk (in VMware/Hyper-V) to the desired size. (For advised hard disk sizing see the chapter “System requirements“)
  5. Connect the GParted ISO file to the FileCap virtual machine.
  6. Boot the FileCap server from ISO file.
    1 gparted-boot.png
  7. Select “Don’t touch keymap”
    2 gparted-keymap
  8. Keep the default language US English, option “33” press enter.
    3 gparted-language.png
  9. Keep the default mode, option “0” press enter.
    4 gparted-mode
  10. Now GParted would start automatically and you see the next screen.
    Note: This screen can be different on every server depending on hard disk size and previous partitioning.
    5 gparted overview
  11. First we need to extend the Extended partition (/dev/sda2 color light blue)
    Click on the rule /dev/sda2 and click the “Resize/Move” button.
  12. Move the bar to the right, like this:6 gparted extended1
  13. If you moved the bar you see this, and you can click the “Resize/Move” button:
    7 gparted extended2
  14. When step 13 is completed you get back to the overview and the /dev/sda2 partition is wider.8 gparted extended3
  15. Now we need to extend the /dev/sda6 ext4 partition (/dev/sda6 color dark blue)
    Click on the rule /dev/sda6 and click the “Resize/Move” button.
  16. Move the bar to the right, like this:
    9 gparted storage1
  17. If you moved the bar you see this, and you can click the “Resize/Move” button:
    10 gparted storage2.png
  18. When step 17 is completed you get back to the overview and the /dev/sda6 partition is wider.
    11 gparted storage3.png
  19. Now you can click the “Apply” button, next you see the following message where you also can click on “Apply” to change the partition.
    Note: Please make sure you have a full backup of the FileCap server before applying.12 gparted apply.png
  20. Wait for all operations to be completed13 gparted waiting
  21. The partitions are now changed and the free space is added. Gparted can now be closed
    14 gparted quit.png
  22. Now you can shutdown the server by clicking “Exit” and after that choose “Shutdown”.
    15 gparted exit.png
  23. Disconnect the GParted ISO file from the FileCap virtual machine.
  24. Start the FileCap server, the disk is now expanded.

 

Check disk space

  1. Login to the FileCap server with SSH
  2. in the console menu choose option 3. “Admin prompt”
  3. Enter the command ‘df -h’ to check used/available disk space.
    df-h.png