XFS文件系統簡介 維基百科關於XFS的簡介如下: XFS is a high-performance 64-bit journaling file system created by Silicon Graphics, Inc (SGI) in 1993.[6] It was the defaul... ...
XFS文件系統簡介
維基百科關於XFS的簡介如下:
XFS is a high-performance 64-bit journaling file system created by Silicon Graphics, Inc (SGI) in 1993.[6] It was the default file system in SGI's IRIX operating system starting with its version 5.3. XFS was ported to the Linux kernel in 2001; as of June 2014, XFS is supported by most Linux distributions, some of which use it as the default file system.
XFS excels in the execution of parallel input/output (I/O) operations due to its design, which is based on allocation groups (a type of subdivision of the physical volumes in which XFS is used- also shortened to AGs). Because of this, XFS enables extreme scalability of I/O threads, file system bandwidth, and size of files and of the file system itself when spanning multiple physical storage devices. XFS ensures the consistency of data by employing metadata journaling and supporting write barriers. Space allocation is performed via extents with data structures stored in B+ trees, improving the overall performance of the file system, especially when handling large files. Delayed allocation assists in the prevention of file system fragmentation; online defragmentation is also supported. A feature unique to XFS is the pre-allocation of I/O bandwidth at a pre-determined rate; this is suitable for many real-time applications. However, this feature was supported only on IRIX, and only with specialized hardware.
A notable XFS user, NASA Advanced Supercomputing Division, takes advantage of these capabilities deploying two 300+ terabyte XFS filesystems on two SGI Altix archival storage servers, each of which is directly attached to multiple Fibre Channel disk arrays.[7]
百度百科上關於XFS的簡介:
XFS一種高性能的日誌文件系統,最早於1993年,由Silicon Graphics為他們的IRIX操作系統而開發,是IRIX 5.3版的預設文件系統。2000年5月,Silicon Graphics以GNU通用公共許可證發佈這套系統的源代碼,之後被移植到Linux 內核上。XFS 特別擅長處理大文件,同時提供平滑的數據傳輸。
XFS相比於其它文件系統(ext3、ext4等)的優缺點:
XFS是高性能文件系統,由於它的高性能,XFS成為了許多企業級系統的首選,特別是有大量數據,需要結構化伸縮性和穩定性的。例如,RHEL/CentOS 7 和Oracle Linux將XFS作為預設文件系統,SUSE/openSUSE已經為XFS做了長期支持。
XFS有許多獨特的性能提升功能使他從眾多文件系統中脫穎而出,像可伸縮/並行 IO,元數據日誌,熱碎片整理,IO 暫停/恢復,延遲分配等。
XFS 文件系統有一些缺陷,例如它不能壓縮,刪除大量文件時性能低下
創建XFS文件系統
如果系統沒有XFS系統工具集,那就必須必須安裝(命令如下):
#sudo yum install xfsprogs
其實很多Linux系統將XFS作為預設文件系統,所以無需安裝,如下所示, Centos 7.3就無需安裝
[root@mylnx008 ~]# more /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
創建XFS格式分區,如下測試所示, 新增了一個300多G的磁碟
[root@mylnx008 ~]# fdisk -l
Disk /dev/sdb: 323.2 GB, 323196289024 bytes, 631242752 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 /dev/sda: 33.3 GB, 33285996544 bytes, 65011712 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: 0x000c1fec
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 62914559 30944256 83 Linux
Disk /dev/sdc: 145.0 GB, 144955146240 bytes, 283115520 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x034b6e5c
Device Boot Start End Blocks Id System
/dev/sdc1 2048 283113471 141555712 83 Linux
[root@mylnx008 ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xafc7c358.
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-631242751, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-631242751, default 631242751):
Using default value 631242751
Partition 1 of type Linux and of size 301 GiB is set
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
格式化分區為XFS,使用mkfs.xfs命令。如果已有其他文件系統創建在此分區,必須加上"-f"參數來覆蓋它。
[root@mylnx008 ~]# mkfs.xfs -f /dev/sdb
meta-data=/dev/sdb isize=512 agcount=4, agsize=19726336 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=78905344, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=38528, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@mylnx008 ~]# df -T /dev/sdb
Filesystem Type 1K-blocks Used Available Use% Mounted on