Manually extend a Btrfs-based Zesty Disk filesystem
  • 2 Minutes to read
  • PDF

Manually extend a Btrfs-based Zesty Disk filesystem

  • PDF

Article summary

This topic describes how to manually extend a Btrfs-based Zesty Disk filesystem.

Manually extending may be necessary if there is a connectivity issue between the instance and the Zesty Disk backend.

Manual actions may be reverted automatically by the Zesty Disk backend according to the Zesty Disk algorithm and the state of the filesystem.

You can extend in the following ways:

Extend a volume that is already part of a Zesty Disk filesystem

This section describes how to manually extend a Btrfs filesystem by extending a volume that is part of that filesystem.

Prerequisites

  • Login access to the Zesty platform

  • Root CLI access to the instance, for example by using SSH

  • Access to the AWS console with IAM permissions to modify an existing EBS volume

Limitations

To see the AWS requirements for modifying an EBS volume, see Requirements for Amazon EBS volume modifications. After modifying a volume, that volume cannot be further modified for at least six hours.

To extend a volume:

  1. From the Zesty platform, select Zesty Disk.

  2. In the Managed filesystems tab, select the filesystem to extend.

    The filesystem disk details and devices are displayed.

  3. From the Overview tab, identify the relevant EBS volume to increase.

    Use the value in the Volume ID column to identify the volume in the AWS console.

  4. Extend the EBS volume in your AWS console, as described in Request Amazon EBS volume modifications.

  5. Connect to the instance with CLI root access.

  6. Instruct the Btrfs filesystem to use the maximum volume capacities by running the following command:
    btrfs filesystem resize max <mount_path>

    This command directs Btrfs to rescan the filesystem volume capacities and update the available capacity for each of the volumes of the filesystem mounted to <mount_path>.

  7. (Optional) You can see the new filesystem capacity by running the df -h command.

Add a new EBS volume

This section describes how to manually extend a Btrfs filesystem by adding a new EBS volume to the filesystem.

Prerequisites

  • Login access to the Zesty platform

  • Root CLI access to the instance, for example by using SSH

  • Access to the AWS console with IAM permissions to create a new EBS volume and attach it to an existing EC2 instance. (If you are using KMS for encrypting the volume, additional permissions might be required.)

Limitations

AWS limits the amount of EBS volumes that can be attached to an EC2 instance, as described in Amazon EBS volume limits for Amazon EC2 instances.

To add a new volume:

  1. From the AWS console, create a new EBS volume with the desired size following these guidelines:

    • Create the volume in the same region and availability zone as the instance.

    • Copy all the AWS tags from an existing volume on this EC2 instance to the new volume.

    • Note the ID of the new volume. You will need it in a later step.

      For more details, see Create an Amazon EBS volume.

  2. Attach the volume to the instance.

    For more information, see Attach an Amazon EBS volume to an Amazon EC2 instance.

  3. Connect to the instance with CLI root access.

  4. Identify the device path of the new attached EBS:

    1. Run the following command:
      lsblk -o NAME,SERIAL,MOUNTPOINT -n | awk  '$2 ~ /^vol/ {print $1,$2}' | sed s/vol/vol-/g
      The output contains pairs of device names and the corresponding AWS volume IDs. For example:

    2. Identify the device name that is associated with the EBS volume. In our example, the created volume ID (from AWS) is “vol-0db571ecc7fc9cf95,” so the device name is /dev/nvme1n1.

  5. Run the following command:
    btrfs device add <device_name> <mount_path>
    Example: btrfs device add /dev/nvme1n1 /data

  6. (Optional) You can see the new filesystem capacity by running the df -h command.


Was this article helpful?