http://www.web008.net

设置为XFS文件系统,Linux创制和挂载XFS文件系统一测量试验试履行

XFS文件系统简介

一 XFS文件系统简介

XFS是高性能文件系统,SGI为他们的IRIX平台而设计。自从2001年移植到Linux内核上,由于它的高性能,XFS成为了许多企业级系统的首选,特别是有大量数据,需要结构化伸缩性和稳定性的。例如,RHEL/CentOS 7 和Oracle Linux将XFS作为默认文件系统,SUSE/openSUSE已经为XFS做了长期支持。
XFS有许多独特的性能提升功能使他从众多文件系统中脱颖而出,像可伸缩/并行 IO,元数据日志,热碎片整理,IO 暂停/恢复,延迟分配等。

 

二 安装XFS系统工具集

Debian, Ubuntu , Linux Mint系统:

$ sudo apt-get install xfsprogs
Fedora, CentOS, RHEL系统:

$ sudo yum install xfsprogs
其他版本Linux:

$ sudo pacman -S xfsprogs

维基百科关于XFS的简介如下:

三创建分区

  1. 查看下是否有分区
    <code><p>
    root@HWPKI-TEST-98:~# fdisk -l
    Disk /dev/sda: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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 identifier: 0x00083283
    Device Boot Start End Blocks Id System
    /dev/sda1 * 2048 968601599 484299776 83 Linux
    /dev/sda2 968603646 976771071 4083713 5 Extended
    /dev/sda5 968603648 976771071 4083712 82 Linux swap / Solaris
    Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes
    255 heads, 63 sectors/track, 364801 cylinders, total 5860533168 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 identifier: 0x3ab14c4d
    Device Boot Start End Blocks Id System
    </p></code>

  2. 开始分区
    <code>
    root@HWPKI-TEST-98:~# fdisk /dev/sdb
    WARNING: The size of this disk is 3.0 TB (3000592982016 bytes).
    DOS partition table format can not be used on drives for volumes
    larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID
    partition table format (GPT)
    The device presents a logical sector size that is smaller than
    the physical sector size. Aligning to a physical sector (or optimal
    I/O) size boundary is recommended, or performance may be impacted.
    Command (m for help):
    </code>

  3. 输入m,查看命令:
    <code>
    Command (m for help): m
    Command action
    a toggle a bootable flag
    b edit bsd disklabel
    c toggle the dos compatibility flag
    d delete a partition
    l list known partition types
    m print this menu
    n add a new partition
    o create a new empty DOS partition table
    p print the partition table
    q quit without saving changes
    s create a new empty Sun disklabel
    t change a partition's system id
    u change display/entry units
    v verify the partition table
    w write table to disk and exit
    x extra functionality (experts only)

Command (m for help):
</code>

  1. 输入n新建一个分区,输入p 建立分区,输入分区编号 1
    然后一路默认
  2. 输入w保存

 

四 格式化分区

1.格式化分区为XFS,使用mkfs.xfs命令。如果已有其他文件系统创建在此分区,必须加上"-f"参数来覆盖它。
sudo mkfs.xfs -f /dev/sdb1
2.格式化后分区来挂载。假设/mnt是XFS本地挂载点。使用下述命令挂载
sudo mount -t xfs /dev/sdb1 /mnt
3.验证XFS挂载是否成功:
df -Th /storage
4.如果你想要启动时自动挂载XFS分区在/storage上,加入下列行到/etc/fstab:
/dev/sdb1 /storage xfs defaults 0 0

参考文章:
Linux有问必答-如何创建和挂载XFS文件系统
linux 硬盘分区,分区,删除分区,格式化,挂载,卸载笔记

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就无需安装

郑重声明:本文版权归美高梅163888所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。