Help Center > > User Guide> Disk Capacity Expansion> Extending Disk Partitions and File Systems (Linux)> Partition and File System Extension Preparations (Linux)

Partition and File System Extension Preparations (Linux)

Updated at: Jul 13, 2019 17:52

Before extending the disk partition and file system, you must check the disk partition style and file system format, and then select the appropriate operation accordingly.

  1. To view the disk partition style, see the following methods:
  2. To select the appropriate operation, see Disk Partition and File System Extension Scenarios.

Method 1: Check Partition Style and File System Format

  1. Run the following command to view all the disks attached to the server:

    lsblk

    Information similar to the following is displayed:
    [root@ecs-test-0001 ~]# lsblk
    NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    vda    253:0    0   40G  0 disk
    └─vda1 253:1    0   40G  0 part /
    vdb    253:16   0  150G  0 disk
    └─vdb1 253:17   0  100G  0 part /mnt/sdc

    In this example, data disk /dev/vdb already has partition /dev/vdb1 before capacity expansion, and the additional 50 GB added has not been allocated yet. Therefore, /dev/vdb has 150 GB, and /dev/vdb1 has 100 GB.

  2. Run the following command to view the current disk partition style:

    fdisk -l

    Information similar to the following is displayed:
    [root@ecs-test-0001 ~]# fdisk -l
    
    Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x000bcb4e
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/vda1   *        2048    83886079    41942016   83  Linux
    
    Disk /dev/vdb: 161.1 GB, 161061273600 bytes, 314572800 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x38717fc1
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/vdb1            2048   209715199   104856576   83  Linux

    The value in the System column indicates the disk partition style. Value Linux indicates the MBR partition style. Value GPT indicates the GPT partition style.

    • If the disk partitions displayed are inconsistent with those obtained in 1, the partition that is not displayed uses the GPT partition style and has unallocated space. In this case, you cannot query all the partition information using the fdisk -l command. Go to Method 2: Check Partition Style and File System Format.
    • If the disk partitions displayed are consistent with those obtained in 1, continue with the following operations.

  3. Run the following command to view the partition's file system format:

    blkid Disk partition

    In this example, run the following command:

    blkid /dev/vdb1

    In the command output, the TYPE value is ext4, indicating that /dev/vdb1's file system format is ext4.

  4. Run the following command to view the file system status:

    ext*: e2fsck -n Disk partition

    xfs: xfs_repair -n Disk partition

    In this example, the ext4 file system is used. Therefore, run the following command:

    e2fsck -n /dev/vdb1

    Information similar to the following is displayed:
    [root@ecs-test-0001 ~]# e2fsck -n /dev/vdb1
    e2fsck 1.42.9 (28-Dec-2013)
    Warning!  /dev/vdb1 is mounted.
    Warning: skipping journal recovery because doing a read-only filesystem check.
    /dev/vdb1: clean, 11/6553600 files, 459544/26214144 blocks

    If the file system status is clean, the file system status is normal. Otherwise, rectify the faulty and then perform the capacity expansion.

Method 2: Check Partition Style and File System Format

  1. Run the following command to view all the disks attached to the server:

    lsblk

    Information similar to the following is displayed:
    [root@ecs-test-0001 ~]# lsblk
    NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    vda    253:0    0   40G  0 disk
    └─vda1 253:1    0   40G  0 part /
    vdb    253:16   0  150G  0 disk
    └─vdb1 253:17   0  100G  0 part /mnt/sdc

    In this example, data disk /dev/vdb already has partition /dev/vdb1 before capacity expansion, and the additional 50 GB added has not been allocated yet. Therefore, /dev/vdb has 150 GB, and /dev/vdb1 has 100 GB.

  2. Run the following command and enter p to view the disk partition style:

    parted Disk

    For example, run the following command to view /dev/vdb's partition style:

    parted /dev/vdb

    Information similar to the following is displayed:
    [root@ecs-test-0001 ~]# parted /dev/vdb
    GNU Parted 3.1
    Using /dev/vdb
    Welcome to GNU Parted! Type 'help' to view a list of commands.
    (parted) p
    Error: The backup GPT table is not at the end of the disk, as it should be.  This might mean that another operating system believes the
    disk is smaller.  Fix, by moving the backup to the end (and removing the old backup)?
    Fix/Ignore/Cancel? Fix
    Warning: Not all of the space available to /dev/vdb appears to be used, you can fix the GPT to use all of the space (an extra 104857600
    blocks) or continue with the current setting?
    Fix/Ignore? Fix
    Model: Virtio Block Device (virtblk)
    Disk /dev/vdb: 161GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    Disk Flags:
    
    Number  Start   End    Size   File system  Name  Flags
     1      1049kB  107GB  107GB  ext4         test
    
    (parted) 
    In the command output, parameter Partition Table indicates the disk partition style. Value msdos indicates the MBR partition style, and value gpt indicates the GPT partition style.
    • If the following error information is displayed, enter Fix.
      Error: The backup GPT table is not at the end of the disk, as it should be.  This might mean that another operating system believes the
      disk is smaller.  Fix, by moving the backup to the end (and removing the old backup)?

      The GPT partition table information is stored at the start of the disk. To reduce the risk of damages, a backup of the information is saved at the end of the disk. When you expand the disk capacity, the end of the disk changes accordingly. In this case, enter Fix to move the backup file of the information to new disk end.

    • If the following warning information is displayed, enter Fix.
      Warning: Not all of the space available to /dev/vdb appears to be used, you can fix the GPT to use all of the space (an extra 104857600
      blocks) or continue with the current setting?
      Fix/Ignore? Fix

      Enter Fix as prompted. The system automatically sets the GPT partition style for the additional space.

  3. Enter q and press Enter to exit parted.

Disk Partition and File System Extension Scenarios

Table 1 Disk partition and file system extension scenarios

Disk

Scenario

Method

Impact

Constraints

System disk

Create a new MBR partition with the additional space.

Creating a New MBR Partition

Services are not interrupted.

An EVS system disk supports up to 1 TB (1024 GB). You can expand the capacity of a system disk to up to 1 TB.

Allocate the additional space to an existing MBR partition.

Extending an Existing MBR Partition

Whether services are interrupted is determined by the Linux kernel version.

Data disk

Create a new MBR partition with the additional space.

Creating a New MBR Partition

Services are not interrupted.

An EVS data disk supports up to 32 TB (32768 GB).
  • With MBR, the disk space exceeding 2 TB cannot be allocated and used, because the maximum disk capacity supported by MBR is 2 TB (2048 GB).

    In this case, if you want to expand the disk capacity to over 2 TB, change the partition style from MBR to GPT. Ensure that the disk data has been backed up before changing the partition style because services will be interrupted and data on the disk will be cleared during this change.

  • With GPT, you can expand the capacity of a data disk to up to 32 TB.

Allocate the additional space to an existing MBR partition.

Extending an Existing MBR Partition

Services are interrupted.

Create a new GPT partition with the additional space.

Creating a New GPT Partition

Services are not interrupted.

Allocate the additional space to an existing GPT partition.

Extending an Existing GPT Partition

Services are interrupted.

SCSI data disk

Create a new MBR partition with the additional space.

Creating a New MBR Partition

Services are not interrupted.

Allocate the additional space to an existing MBR partition.

Extending an Existing MBR Partition

Services are interrupted.

NOTE:
For a system disk:
  • If the additional space is used to create a new partition, existing partitions will not be affected, and services will not be interrupted.
  • If the additional space is allocated to an existing partition, whether services are interrupted or not is determined by the Linux kernel version. When the kernel version is too early, the partition and file system extension takes effect only after a reboot. In this case, services will be interrupted. Otherwise, a reboot is not required, and services will not be interrupted.
For a data disk:
  • If the additional space is used to create a new partition, existing partitions will not be affected, and services will not be interrupted. In scenarios where you want to expand data disks without interrupting services, create new partitions with the additional space.
  • If the additional space is allocated to an existing partition, data on the disk will not be cleared but you must unmount the partition. In this case, services will be affected.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel