Skip to content

How to expand the file system

Attention

Before updating the drive size, you should always back up all important data stored on it. Resizing the drive may result in data loss or data corruption.

Linux

Information

GrowPart — is a Linux command line tool used to extend a partition in a partition table. This command is provided by the cloud utility package.

In our example, the disk will be extended by 10 GB. To do this, you must perform the following algorithm of actions:

  1. Checking the availability of free space on the hard disk using the lsblk command. If there is no free space, you need to create a new partition using the Linux distribution tools.

    [root@45839 ~]# lsblk
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    sda 8:0 0 40G 0 disk
    ├─sda1 8:1 0 1023M 0 part /boot
    └─sda2 8:2 0 29G 0 part
    ├─vg45839-swap 253:0 0 3.7G 0 lvm [SWAP]
    └─vg45839-root 253:1 0 25.3G 0 lvm /
    sr0 11:0 1 1024M 0 rom
    

    In our example, the root file system is on the physical volume /dev/sda2. Disk capacity - 30 GB.

    Note

    If the physical volume has a different name, such as /dev/vda2, use this partition name in subsequent instructions.

  2. Use the growpart utility to expand a partition. For example, /dev/sda2:

    lsblk
    growpart /dev/sda 2
    pvresize /dev/sda2
    vgs
    lvextend -r -l +100%FREE /dev/vg45839/root
    

    The result of the previous steps:

Windows

  1. Go to Disk Manager (shortcut Win+X) and choose Disk Management.

  2. Find the volume you want to expand, and right-click on its name, choose Properties.

  3. In the Volume tab, click on the Advanced button, then select Expand Volume.

  4. Go through as instructed and select free space on the hard disk to add it to the current volume.

  5. Press the Finish button and wait until the operation is over.

  6. Check the result of the change - the amount of available space on the volume: