1. 程式人生 > >Centos 6.9 Install XFS--parted

Centos 6.9 Install XFS--parted

安裝xfs parted
yum install xfsprogs xfsdump parted -y

大容量分割槽,建立一個分割槽表
parted /dev/sdb     //為/dev/sdb硬碟分割槽                                                      
(parted) mklabel                                                          
New disk label type? gpt                                                  
Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to
continue?
Yes/No? yes

檔案系統和分割槽
(parted) mkpart                                                           
Partition name?  []? xfs                                                     
File system type?  [ext2]? xfs                                            
Start? 0      0為分割槽開始 分割槽結束 -1為全部硬碟空間                                                          
End? 3299G
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? i


print命令列印分割槽資訊
(parted) print                                                            
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 3299GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number  Start   End     Size    File system  Name  Flags
 1      17.4kB  3299GB  3299GB                       

rm命令刪除分割槽
(parted)rm 1

(parted) quit   退出
                                 
格式化分割槽
mkfs.xfs -f /dev/sdb1

建立掛載目錄
mkdir -p /home/xfs

掛載硬碟到目錄
mount /dev/sdb1 /home/xfs

檢視硬碟號
blkid /dev/sdb1
/dev/sdb1: UUID="493b0f40-093c-47e0-8d48-3f169191ad9d" TYPE="xfs"

配置開機自動掛載
vi /etc/fstab
新增開機掛載目錄
UUID=493b0f40-093c-47e0-8d48-3f169191ad9d /home/xfs xfs defaults 0 1

重啟伺服器
reboot

檢視掛載目錄
df -TH

寫效能測試
time dd if=/dev/zero of=/home/xfs/ceshi.txt bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.0377968 s, 2.8 GB/s
real    0m0.040s
user    0m0.000s
sys    0m0.040s

讀效能測試
time dd if=/home/xfs/ceshi.txt  of=/dev/null  bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.0146221 s, 7.2 GB/s
real    0m0.015s
user    0m0.000s
sys    0m0.015s