Linux創建和掛載XFS文件系統測試實踐

来源:https://www.cnblogs.com/kerrycode/archive/2018/08/08/9442081.html
-Advertisement-
Play Games

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版的預設文件系統。20005月,Silicon GraphicsGNU通用公共許可證發佈這套系統的源代碼,之後被移植到Linux 內核上。XFS 特別擅長處理大文件,同時提供平滑的數據傳輸。

 

 

XFS相比於其它文件系統(ext3、ext4等)的優缺點:

 

 

XFS是高性能文件系統,由於它的高性能,XFS成為了許多企業級系統的首選,特別是有大量數據,需要結構化伸縮性和穩定性的。例如,RHEL/CentOS 7 Oracle LinuxXFS作為預設文件系統,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
	   

您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • ● 操作系統做什麼 1. 電腦系統有4個組成部分:電腦硬體,操作系統,系統程式與應用程式和用戶。 2. 什麼是操作系統?(不同觀點) 控製程序 操作系統控制和協調不同用戶的各種應用程式之間的硬體使用。(操作系統是管理電腦硬體的程式,為應用程式提供基礎,充當電腦硬體和電腦用戶的中介) 資源管 ...
  • 問題重述: 最近環境中需要使用 fedora 28 來進行遠程桌面,於是就重新配置了一下vnc 在這裡面做一下記錄。 過程: yum 安裝: 工作機上安裝 vncviewer 遠程主機上安裝: vncserver 連接遠程桌面: 連接遠程桌面很簡單,只要使用 vncviewer 主機名:桌面號 畫面 ...
  • 前言 之前討論了進程,瞭解一個進程能做一件事情,如果想同時處理多件事情,那麼需要多個進程,但是進程間很不方便的一點是,進程間的數據交換似乎沒有那麼方便。Linux提供線程功能,能在一個進程中,處理多任務,而且線程之間的數據是完全共用的。 線程也有PCB,它的PCB和進程的PCB結構完全一樣,只是它里 ...
  • 問題重述: 今天,突然找不到vm 的ip 了,但是可以從網卡狀態上看到其 mac 地址,並且確定主機是啟動狀態,網路狀態良好(後來發現因為子網掩碼的問題,導致虛擬機和網關之間不通信,從而導致其他網路的主機不能訪問,這個是另一個問題了。) 所以我們需要通過vm 的mac 地址來獲取到vm 具體的 ip ...
  • 跟著RUNOOB網站的教程學習的筆記 Shell與Shell腳本 Shell是用戶與Linux系統的橋梁。它既是一種命令語言,也是一種程式設計語言。 Shell腳本是一種Shell編寫的腳本程式,其實就是一個包含Shell代碼的文本文件,運行時,會一行一行的運行給文本文件中的命令。 Shell腳本的 ...
  • 事情的來源是,公司要將網站從http升級到https,由於歷史遺留原因,才發現現有的nginx是通過源碼安裝的,並沒有安裝ssl模塊,需要現安裝sll模塊,這個nginx是整個公司最前端的一個代理,涉及到很多部門,因為之前沒有操作過,還是小心點為妙,下麵是在虛擬機上演示的。 1,先安裝後面所需的一些 ...
  • 最近使用靜態地址配置linux, 配置的時候突然不知道配置選項具體內容了,這裡面記錄一下配置:適用於 ipv4 網路 保持更新,轉載請註明出處。 ...
  • 1、定義一些變數在我們代碼開始的部分,先定義一些變數供我們使用。這裡選擇幾個來解析一下。第一個FIL file;這個變數是文件的結構體變數,記錄了我們打開的文件的信息。使用f_open等函數的時候都要用到。第二個Words變數是一個字元串指針,我用這個指針來存儲讀取的字元信息。這裡我們就使用了mal ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...