Expanding harddisk size

If your FileCap server is not having 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 3. “Admin prompt”.
  3. 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”
  5. Create a new partition with the command: ‘fdisk -c /dev/sda’
    lvm1.png

    • Enter: ‘n’, to create a new partition
    • Enter: ‘p’, to create a new primary partition
    • Choose the default partition number (in the example: 3, so it will create /dev/sda3)
    • Cilinder values choose the default as fdisk will give you a default value for the first and last cylinder. Note: the cylinder values will vary on your system.
    • Enter: ‘t’, to change the partition type
    • Enter the partition number (in this example: 3)
    • Enter the partition type: ‘8e’
    • Enter: ‘w’, to write changes to disk.
      You’ll get a message about the kernel still using the old partition table, and to reboot to use the new table. The reboot is not needed as you can also rescan for those partitions using partx.Run the following to scan for the newly created partition: ‘partx -v -a /dev/sda’. If that still does not show you the newly created partition for you to use, you have to reboot the server.
  6. Afterwards, you can see the newly created partition with fdisk by entering: ‘fdisk -l /dev/sda’
    lvm2
  7. Create a physical volume with command: ‘pvcreate /dev/sda3’ (Please replace /dev/sda3 with the newly created partition)
    lvm3
  8. Find out how your Volume Group is called with the command ‘vgdisplay’ in this example it is called “filecap-vg”
    lvm4.png
  9. Extend the volume group by adding the physical volume with the command: ‘vgextend filecap-vg /dev/sda3’ (Please replace /dev/sda3 with the newly created partition and filecap-vg with your volumegroup name)
    lvm5
  10. With ‘pvscan’, we can see our newly added physical volume, and the usable space (16GB in this case).
    lvm6
  11. Use the command ‘lvextend /dev/filecap-vg/root /dev/sda3’ to expand the Logical Volume.
  12. Resize the file system to the volume group, so we can use the space. Enter the command: ‘resize2fs /dev/filecap-vg/root’ (Please replace filecap-vg with your volumegroup name)
    lvm8
  13. The Filesystem is now extended, you can check this with the command ‘df -h’ to see the available space.
    df-h-red.png

 

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