Getting started with Linux: expanding the XFS File System

Source: Internet
Author: User

Getting started with Linux: expanding the XFS File System

Problem: I have extra space on the disk, so I want to extend the existing XFS file system created on it to fully use the extra space. What is the correct way to expand the XFS file system?

XFS is an open-source (GPL) Log File System. It was initially developed by Silicon Valley graphics (SGI) and is now supported by most Linux distributions. In fact, XFS has been adopted by the latest CentOS/RHEL 7 and become its default file system. Among its many features, the "online resizing" feature allows the existing XFS file system to be expanded when it has been mounted. However, the XFS file system is not supported yet.

To expand an existing XFS file system, you can use the command line tool xfs_growfs, which is available in most Linux distributions by default. Because XFS supports online resizing, the target file system can be mounted or not mounted.

Install XFS in RedHat

Configure XFS filesystem on RHEL6

DBA conclusion: MySQL has the greatest advantage in combination with XFS file systems

The basic usage of xfs_growfs is as follows:

As an extension of the target XFS file system, you can specify the mount point, disk partition, or logical volume (when using LVM) and the number of data blocks to specify the size of the new XFS file system. You can use the xfs_info command line tool to check the data block size and quantity:

To extend the XFS file to 1986208:

  1. $ Sudo xfs_growfs/dev/centos/root-D 1986208

If you do not use the "-D" option to specify the size, xfs_growfs will automatically expand the XFS File System to the maximum available size.

  1. $ Sudo xfs_growfs/dev/centos/root

Note: When you expand an existing XFS file system, you must be prepared to add the space for extension of the XFS File System in advance. Although this is obvious, if there is no free space available in the partition or disk volume, xfsGrowfs has no way. At the same time, if you try to expand the size of the XFS file system to more than the size of the disk partition or volume, xfsGrowfs will fail.

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.