mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-13 22:30:37 +08:00
Translated:20140915 Linux FAQs with Answers--How to expand an XFS File System.md
This commit is contained in:
parent
1e5114e550
commit
986f25b205
@ -1,39 +0,0 @@
|
|||||||
Translating by GOLinux ...
|
|
||||||
Linux FAQs with Answers--How to expand an XFS file system
|
|
||||||
================================================================================
|
|
||||||
> **Question**: I have extra space in my disk, so I want to grow the size of an existing XFS file system created on it, in order to fully utilize the extra space. What is a proper way to expand an XFS file system?
|
|
||||||
|
|
||||||
XFS is an open-source (GPL) journaling file system originally developed by Silicon Graphics. The suport for XFS file system is available on most Linux distros nowadays. In fact, XFS has become the default file system adopted by the latest CentOS/RHEL 7. One of its many features is "online resizing", where an existing XFS file system can be expanded while it is mounted. Support for shrinking an XFS file system is not available though.
|
|
||||||
|
|
||||||
To expand an existing XFS file system, you can use a command line utility called xfs_growfs, which is available by default on most Linux distros. Since XFS supports online resizing, the target file system can be mounted or unmounted.
|
|
||||||
|
|
||||||
Here is the basic usage of **xfs_growfs**:
|
|
||||||
|
|
||||||
![](https://farm6.staticflickr.com/5551/14915082088_b4e29af3cf_z.jpg)
|
|
||||||
|
|
||||||
As the destination XFS file system to expand, you can specify either a mountpoint, a disk partition, or logical volume (in case of LVM). You specify the size of a new XFS file system as the number of data blocks. You can use xfs_info command-line tool to check data block size and the number of data blocks:
|
|
||||||
|
|
||||||
![](https://farm6.staticflickr.com/5584/14915075270_cd272d4468_z.jpg)
|
|
||||||
|
|
||||||
To extend the size of an XFS file system to 1986208:
|
|
||||||
|
|
||||||
$ sudo xfs_growfs /dev/centos/root -D 1986208
|
|
||||||
|
|
||||||
If you do not specify size with "-D" option, xfs_growfs will automatically expand an XFS file system to the largest possible size.
|
|
||||||
|
|
||||||
$ sudo xfs_growfs /dev/centos/root
|
|
||||||
|
|
||||||
![](https://farm6.staticflickr.com/5569/14914950529_ddfb71c8dd_z.jpg)
|
|
||||||
|
|
||||||
Note that when you expand an existing XFS file system, you must prepare added space for the XFS file system to grow beforehand. It may be obvious, but if there is no free space available in the underlying partition or disk volume, xfs_growfs will not do anything. Also, if you attempt to extend XFS file system size beyond the size of disk partition or volume, xfs_growfs will fail.
|
|
||||||
|
|
||||||
![](https://farm4.staticflickr.com/3870/15101281542_98a49a7c3a_z.jpg)
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
via: http://ask.xmodulo.com/expand-xfs-file-system.html
|
|
||||||
|
|
||||||
译者:[译者ID](https://github.com/译者ID)
|
|
||||||
校对:[校对者ID](https://github.com/校对者ID)
|
|
||||||
|
|
||||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
|
@ -0,0 +1,38 @@
|
|||||||
|
Linux有问必答——如何扩展XFS文件系统
|
||||||
|
================================================================================
|
||||||
|
> **问题**:我的磁盘上有额外的空间,所以我想要扩展其上创建的现存的XFS文件系统,以完全使用额外空间。怎样才是扩展XFS文件系统的正确途径?
|
||||||
|
|
||||||
|
XFS是一个开源的(GPL)日子文件系统,最初由硅谷图形开发,现在被大多数的Linux发行版都支持。事实上,XFS已经被最新的CentOS/RHEL 7采用,成为其默认的文件系统。在其众多的特性中,包含了“在线调整大小”这一特性,使得现存的XFS文件系统在被挂载时可以进行扩展。然而,对于XFS文件系统的缩减确实不被支持的。
|
||||||
|
|
||||||
|
要扩展一个现存的XFS文件系统,你可以使用命令行工具xfs_growfs,这在大多数Linux发行版上都默认可用。由于XFS支持在线调整大小,目标文件系统可以挂在,也可以不挂载。
|
||||||
|
|
||||||
|
下面展示了**xfs_growfs**的基本用法:
|
||||||
|
|
||||||
|
![](https://farm6.staticflickr.com/5551/14915082088_b4e29af3cf_z.jpg)
|
||||||
|
|
||||||
|
作为目标XFS文件系统来扩展,你可以指定挂载点、磁盘分区或者逻辑卷(在使用LVM时),使用数据块数量来指定新的XFS文件系统的大小。你可以使用xfs_info命令行工具来检查数据块大小和数量:
|
||||||
|
|
||||||
|
![](https://farm6.staticflickr.com/5584/14915075270_cd272d4468_z.jpg)
|
||||||
|
|
||||||
|
要将XFS文件扩展到1986208:
|
||||||
|
|
||||||
|
$ sudo xfs_growfs /dev/centos/root -D 1986208
|
||||||
|
|
||||||
|
如果你不使用“-D”选项来指定大小,xfs_growfs将会自动扩展XFS文件系统到最大的可用大小。
|
||||||
|
|
||||||
|
$ sudo xfs_growfs /dev/centos/root
|
||||||
|
|
||||||
|
![](https://farm6.staticflickr.com/5569/14914950529_ddfb71c8dd_z.jpg)
|
||||||
|
|
||||||
|
注意,当你扩展一个现存的XFS文件系统时,必须准备事先添加用于XFS文件系统扩展的空间。这虽然是十分明了的事,但是如果在潜在的分区或磁盘卷上没有空闲空间可用的话,xfs_growfs不会做任何事情。同时,如果你尝试扩展XFS文件系统大小到超过磁盘分区或卷的大小,xfs_growfs将会失败。
|
||||||
|
|
||||||
|
![](https://farm4.staticflickr.com/3870/15101281542_98a49a7c3a_z.jpg)
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
via: http://ask.xmodulo.com/expand-xfs-file-system.html
|
||||||
|
|
||||||
|
译者:[GOLinux](https://github.com/GOLinux)
|
||||||
|
校对:[校对者ID](https://github.com/校对者ID)
|
||||||
|
|
||||||
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
Loading…
Reference in New Issue
Block a user