XFS is a high-performance journaling file system created by Silicon Graphics, Inc. XFS is particularly proficient at parallel IO due to its allocation group based design. This enables extreme scalability of IO threads, filesystem bandwidth, file and filesystem size when spanning multiple storage devices.
GNU Parted is a program for creating and manipulating partition tables.
This article describe how to use parted and xfs_growfs to resize XFS disk partition size dynamically.
Prerequites
Before resizing the disk partition or file system, please backup the data on that disk.
Run
There are two options to resize disk partition.
Option1. Run parted with disk partition
Use lsblk to check disk partition.
1 2 3 4
$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 1T 0 disk └─sda1 8:1 0 10G 0 part /
Use parted to resize /dev/sda1 disk partition to 300 GB.
1 2 3 4 5
# parted /dev/sda resizepart 1 Warning: Partition /dev/sda1 is being used. Are you sure you want to continue? Yes/No? Yes End? [10.7GB]? 300000 Information: You may need to update /etc/fstab.
[root@centos ~]# parted GNU Parted 3.2 Using /dev/sda Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) print Model: ATA VBOX HARDDISK (scsi) Disk /dev/sda: 1100GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags:
Number Start End Size Type File system Flags 1 1049kB 10.7GB 10.7GB primary xfs boot
(parted) help align-check TYPE N check partition N for TYPE(min|opt) alignment help [COMMAND] print general help, or help on COMMAND mklabel,mktable LABEL-TYPE create a new disklabel (partition table) mkpart PART-TYPE [FS-TYPE] START END make a partition name NUMBER NAME name partition NUMBER as NAME print [devices|free|list,all|NUMBER] display the partition table, available devices, free space, all found partitions, or a particular partition quit exit program rescue START END rescue a lost partition near START and END resizepart NUMBER END resize partition NUMBER rm NUMBER delete partition NUMBER select DEVICE choose the device to edit disk_set FLAG STATE change the FLAG on selected device disk_toggle [FLAG] toggle the state of FLAG on selected device set NUMBER FLAG STATE change the FLAG on partition NUMBER toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER unit UNIT set the default unit to UNIT version display the version number and copyright information of GNU Parted (parted) resizepart 1 Warning: Partition /dev/sda1 is being used. Are you sure you want to continue? Yes/No? Yes End? [10.7GB]? 300000 (parted) quit Information: You may need to update /etc/fstab.