Views: 79
Last Modified: 20.01.2025

Attention!
  1. For operations, described in this chapter, knowledge of *nix-systems administration is required. Prior to start of these operations, it is recommended to perform full backup of Bitrix Virtual Appliance.
  2. Provided settings are listed outside the scope of the Virtual Appliance menu. This means that the details below are provided for informational purposes only and should be used with clear understanding of your actions and under your own liability. Bitrix24 technical support reviews the questions related to Virtual Appliance menu items only.

Sequence of actions

To increase space available at the VA disk, complete the four steps as follows:

  1. increase specified system disk space in the hypervisor
  2. disable and delete the swap
  3. increase the space available for the main partition
  4. create and connect swap once again

Swap — is a specially dedicated disk space, used by the system as backup space when employed ram memory is not sufficient. For Linux swap can be implemented in two ways: as a separate partition and as an individual file.

Step 1. Increase system disk space in hypervisor

Modify space available in the virtualization software: VirtualBox, VMWare or HyperV. You can find more details about such software in the documentation for corresponding software.

Example for VirtualBox:

  1. Inside VirtualBox menu, select File > Tools > Virtual Media Manager.
  2. Select your Virtual Appliance.
  3. Indicate the required disk space.
  4. Click Apply button.

After you have increased the system disk inside the player, launch the Bitrix Virtual Appliance. Get authenticated under the 'root' user and switch to command string mode. To do that, select the menu item 0. Exit.

You can check the current parameters for the disk using the following command:

df -Th

Disk size didn't change. Partition on the disk /dev/sda1 is 47 GB space, the remaining space from current 50 GB is used by temporary tmpfs.

Step 2. Disable and delete swap

  1. Browse the list of all existing swaps.

    swapon --show

    Swap can be both an individual partition and a file. In our case it is a partition.

  2. Disable swap.

    swapoff -v /dev/sda2

    Swap is disabled, but remains listed in /etc/fstab partition table. This can be changed by the command.

    cat /etc/fstab

  3. Open the table /etc/fstab in the editor, for example, in mcedit.

    mcedit /etc/fstab

    Comment the swap string with the character #. The result must be: # UUID=b2028b1a-d0d1-463e-8b6e-31e40af16322 none swap defaults 0 0.

    Close the editor mcedit using the key F10. Editor will require confirmation, whether to save changes: select Yes.

  4. View the disk list.

    fdisk -c -u -l

    Here, sda — disk name, sda1 — first partition, sda2 — second swap partition. Go to the utility for managing fdisk hard drive partitions and open /dev/sda.

    fdisk -c -u /dev/sda

    Enter the commands in sequence:

    • d — delete
    • 2 — section 2
    • w — write changes

  5. Open file /etc/defualt/grub in the editor mcedit.

    mcedit /etc/default/grub

    Delete resume=UUID in the string GRUB_CMDLINE_LUNUX . Result must be as follows:

    Click image to expand

    Close the editor mcedit using the key F10, saving the changes.

  6. Update the configuration.

    grub2-mkconfig -o /etc/grub2.cfg

    Generates new operational file.

  7. Launch the file regeneration.

    dracut --regenerate-all --force

    Wait for regeneration process to complete. When successful, command input string will appear again.

  8. Attention! If you do not complete this step, Virtual Appliance won't be restored after relaunch.

    View the information about all the available kernel versions.

    grubby --info=ALL

    Delete the swap identifier.

    grubby --update-kernel=ALL --remove-args='resume=UUID=b2028b1a-d0d1-463e-8b6e-31e40af16322'

    Check if swap identifiers have been deleted.

    grubby --info=ALL

    Click image to expand

  9. Relaunch the Virtual Appliance.

    reboot

Step 3. Increase main partition size

To increase space available at the disk, re-create the partition.

  1. Delete the section sda1. Go to the fdisk utility for managing hard drive partitions and open /dev/sda.

    fdisk -c -u /dev/sda

    Enter the commands sequentially:

    • d — delete
    • w — write changes

  2. Create a new partition sda1. To do it, switch to fdisk and open /dev/sda.

    fdisk -c -u /dev/sda

    Enter the commands sequentially:

    • n — create
    • p — main
    • 1 — partition with number 1
    • First sector do not fill
    • In Last sector indicate +78G — size for the main disk
    • Y — delete the signature
    • w — write changes

  3. For the new configuration to be applied, re-launch the virtual appliance.

    reboot

  4. Return to the console and increase size for the partition sda1.

    xfs_growfs /dev/sda1

  5. Check for the increased disk size.

    df -Th

Step 4. Create and connect swap

  1. Go to the utility for managing fdisk hard drive partitions and open /dev/sda.

    fdisk -c -u /dev/sda

    Create a new partition. Enter the following commands seuqeuntially:

    • n — create
    • p — main
    • 2 — partition with number 2
    • First sector do not fill
    • Last sector do not fill
    • t — change partition type
    • 2 — partition с номером 2
    • 82 — assign hex-код 82, corresponding to swap
    • w — write the changes

  2. Create swap for the new partition.

    mkswap /dev/sda2

  3. Enable swap.

    swapon -v /dev/sda2

  4. The remaining action is to ensure that the system does not loose the created swap during relaunch.

  5. View the created swap identifier.

    blkid

    In out case, the new swap identifier is UUID=e8f52632-dd10-43dc-9c75-8981fe11684d. This identifier must replace the previously deleted legacy identifier.

  6. Add swap identifier to the fstab table.

    mcedit /etc/fstab

  7. Also, add the swap identifier to the file /etc/defualt/grub.

    mcedit /etc/default/grub

    Click image to expand

    Full string will look as follows: GRUB_CMDLINE_LINUX="console=ttyS0,115200n8 no_timer_check net.ifnames=0 crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M resume=UUID=e8f52632-dd10-43dc-9c75-8981fe11684d selinux=0"

  8. Update the configuration again.

    grub2-mkconfig -o /etc/grub2.cfg

    dracut --regenerate-all --force

  9. Add swap identifier to grubby.

    grubby --update-kernel=ALL --args='resume=UUID=e8f52632-dd10-43dc-9c75-8981fe11684d'

    Check, if identifiers were added successfully.

    grubby --info=ALL

    Click image to expand

  10. Relaunch the Virtual Appliance.

    reboot





Courses developed by Bitrix24