歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Red Hat Enterprise Linux 5.5上使用XFS 文件系統

Red Hat Enterprise Linux 5.5上使用XFS 文件系統

日期:2017/2/28 16:32:45   编辑:Linux教程

要在Red Hat Enterprise Linux 5.5上使用xfs 文件系統,必須借助CentOS 5.5 對於版本的一些軟件包。比如kmod-xfs,這個軟件包是用來添加xfs.ko這個模塊,使 5.5內核支持xfs 文件系統。我的內核是自己編譯的,所以xfs已經編譯在內核中,不需要kmod-xfs 這個軟件包。

廢話不說了,詳細步驟如下,下載需要軟件包:

wget ftp://ftp.chg.ru/pub/Linux/CentOS/5.4/extras/SRPMS/xfsprogs-2.9.4-1.el5.centos.src.rpm
wget http://rpm.pbone.net/index.php3/stat/26/dist/43/size/586492/name/xfsdump-2.2.46-1.el5.centos.src.rpm
wget ftp://ftp.chg.ru/pub/Linux/CentOS/5.4/extras/SRPMS/dmapi-2.2.8-1.el5.centos.src.rpm
rpm -ivh xfsprogs-2.9.4-1.el5.centos.src.rpm
rpm -ivh xfsdump-2.2.46-1.el5.centos.src.rpm
rpm -ivh dmapi-2.2.8-1.el5.centos.src.rpm

編譯:
rpmbuild -ba /usr/src/RedHat/SPECS/xfsprogs.spec
rpmbuild -ba /usr/src/redhat/SPECS/xfsdump.spec
rpmbuild -ba /usr/src/redhat/SPECS/dmapi.spec

安裝:
rpm -ivh /usr/src/redhat/RPMS/x86_64/xfsprogs-2.9.4-1.x86_64.rpm
rpm -ivh /usr/src/redhat/RPMS/x86_64/xfsprogs-devel-2.9.4-1.x86_64.rpm
rpm -ivh /usr/src/redhat/RPMS/x86_64/dmapi-2.2.8-1.x86_64.rpm
rpm -ivh /usr/src/redhat/RPMS/x86_64/dmapi-devel-2.2.8-1.x86_64.rpm
rpm -ivh /usr/src/redhat/RPMS/x86_64/xfsdump-2.2.46-1.x86_64.rpm

就會有 mkfs.xfs fsck.xfs xfsdump xfsrestore 這兩個命令

然後格式化硬盤:

mkfs.xfs -f -d agcount=4 -l size=128m -i size=512 /dev/vg_root/lv_www

-i 默認值為 256
-l 的默認值為 10m
agcount 默認自動分配
-l lazy-count=value
This changes the method of logging various persistent counters in the superblock. Under metadata intensive workloads, these counters are updated and logged frequently enough that the superblock updates become a serialisation point in the filesystem. The value can be either 0 or 1.
With lazy-count=1, the superblock is not modified or logged on every change of the persis-tent counters. Instead, enough information is kept in other parts of the filesystem to be able to maintain the persistent counter values without needed to keep them in the superblock. This gives significant improvements in performance on some configurations. The default value is 0 (off) so you must specify lazy-count=1 if you want to make use of this feature.

修改/etc/fstab

/dev/vg_root/lv_www /www xfs defaults,nobarrier,logbufs=8,logbsize=32k 1 2
nobarrier
Many hardware RAID have a persistent write cache which preserves it across power failure, interface resets, system crashes, etc. Using write barriers in this instance is not recommended and will in fact lower performance. Therefore, it is recommended to turn off the barrier support and mount the filesystem with "nobarrier". But take care about the hard disk write cache, which should be off.
logbufs=value
Set the number of in-memory log buffers. Valid numbers range from 2-8 inclusive. The default value is 8 buffers for filesystems with a blocksize of 64K, 4 buffers for filesystems with a blocksize of 32K, 3 buffers for filesystems with a blocksize of 16K, and 2 buffers for all other configurations. Increasing the number of buffers may increase performance on some workloads at the cost of the memory used for the additional log buffers and their associated control structures.
logbsize=value
Set the size of each in-memory log buffer. Valid sizes are 16384 (16K) and 32768 (32K). The default value for machines with more than 32MB of memory is 32768, machines with less memory use 16384 by default.

Copyright © Linux教程網 All Rights Reserved