Extending the Disk Volume

  • Last update:December 16, 2025
  • Overview

    The error message "no space left on device" indicates insufficient disk space, which may cause server startup or certain operations to fail.

    In this case, you need to extend the disk volume.

    Procedure

    Extending a Disk Volume in Linux

    Checking Remaining Disk Space

    You can use the command df  -h to check remaining disk space, as shown in the following figure.

    2.1.1.jpg

    You can identify the disk partition that needs to be extended by checking the project mount point. For example, if the project is mounted on /home, you need to extend /dev/mapper/vg0-data.

    Extending the Disk Volume

    For physical machines, you can add a hard drive. For virtual machines (VMs), you need to modify the VM settings, as shown in the following figure.

    2.1.2.jpg

    Adding a Partition

    1. Run the command to check disk partitions, as shown in the following figure:

    fdisk -l

    2.1.3-1.jpg

    2. Run the command to add a partition, as shown in the following figure:

    fdisk /dev/sda

    3. Restart the system.

    Initializing the Partition and Adding it to the Volume Group

    1. After you add a new partition, you need to initialize it as a physical volume (PV) so that it can be added to the Logical Volume Manager (LVM) and used to extend the disk volume. Run the command to initialize the partition as a PV, as shown in the following figure:

    pvcreate /dev/sda4

    2. Check the volume group (VG) information and add the initialized partition /dev/sda4 to the VG.

    Run the command to view the VG:

    vgdisplay

    Run the command to add the new PV /dev/sda4 to vg0 to extend the VG:

    vgextend vg0 /dev/sda4

    Extending the Logical Volume

    1. Run the command to extend the logical volume (LV), as shown in the following figure:

    lvextend -L +5G /dev/mapper/vg0-data


    2. Run the command to reload the LV and check the file system, as shown in the following figure:

    cat /etc/fstab | grep vg0-data

     2.1.5-2.jpg

    For the XFS file system, use the command:

    xfs_growfs /data

    2.1.5-3.jpg

    3. Check the remaining disk space again, as shown in the following figure.

    2.1.5-4.jpg

    The figure shows that /dev/mapper/vg0-data has been extended by 5GB.

    Extending a Disk Volume in Windows

    Take Windows 11 as an example. You can right-click This PC, select Management to open the Computer Management window, and select Disk Management, or you can right-click the Windows icon and select Disk Management, as shown in the following figure.

    The computer has two disks: Disk 0 is the primary drive containing the C drive, and Disk 1 is a removable hard drive. In this example, New Volume (E:) will be re-partitioned to extend New Volume (F:).

    Generating Unallocated Space

    2. Right-click New Volume (E:), and select Shrink Volume, as shown in the following figure.

    Enter 10240 in Enter the amount of space to shrink in MB, and click Shrink. 10 GB of unallocated space is generated in Disk 0, as shown in the following figure.

    Extending the Volume

    1. Right-click New Volume (F:), select Extend Volume, select the available disk, specify the amount of space, click Next, and click Finish, as shown in the following figure.

    2. A new volume (F:) is created, as shown in the following figure.

    3. Check the disk space in File Explorer. The space of New Volume (F:) has been increased by 10 GB, as shown in the following figure.

    Notes

    Extend Volume Option Grayed out

    Problem:

    On some computers, if there is no unallocated or free space immediately to the right of the partition you want to extend, Extend Volume is grayed out when you right-click that partition, as shown in the following figure.

    Solution:

    Assume the volume you want to extend is New Volume (H:), and the volume immediately to its right is New Volume (I:), as shown in the following figure.

     

    1. Back up important data in New Volume (I:) to another disk. Right-click New Volume (I:), select Delete Volume. After the volume is deleted, the space will appear as Unallocated, as shown in the following figure.

    iconNote: 

    If you have accidentally deleted a new volume without backing it up, do not create a new volume with the unallocated space. Try using DiskGenius to recover the files first.

    3.1-3.jpg

    2. Right-click New Volume (H:). Extend Volume can be selected, as shown in the following figure.

    3.1-4.jpg

    Attachment List


    Theme: Deployment and Integration
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy