天天看點

存儲那些事兒(二): 下一代Linux檔案系統BTRFS簡介

    btrfs,通常念成 butter fs,better fs 或b-tree fs。下一代的linux檔案系統。

    它基于寫時拷貝(copy-on-write),支援高效的snapshot和clone。它使用b-tree作為存儲的資料結構。在btrfs項目首頁上對自己是這麼描述的:"一個新的針對linux的寫時複制檔案系統,緻力于實施進階的功能,同時關注容錯、修複和管理友善性。"

   它有哪些進階功能呢?下面的feature來自btrfs的項目首頁:http://btrfs.wiki.kernel.org/   

extent based file storage #擴充了

2^64 byte == 16 eib maximum file size #支援16eb的檔案大小, 1pb = 1024 tb, 1eb = 1024 pb

space-efficient packing of small files   #高效支援小檔案, 通過inline files實作的

space-efficient indexed directories       #高效的目錄索引

dynamic inode allocation                       #動态inode配置設定。我們知道,傳統linux檔案系統的inode格式化好後inode的節點數就确定了,也就是說檔案系統的檔案數确定

writable snapshots, read-only snapshots  #支援可讀,可寫的快照

subvolumes (separate internal filesystem roots)  #支援subvolumes,可以了解成在檔案系統上建立子的檔案系統,友善使用者的權限控制

checksums on data and metadata (crc32c)    #支援資料和中繼資料的檢驗,保證資料的正确性

compression (zlib and lzo)                               #支援線上壓縮

integrated multiple device support                     #多裝置支援

file striping, file mirroring, file striping+mirroring, striping with single and dual parity implementations

ssd (flash storage) awareness (trim/discard for reporting free blocks for reuse) and optimizations (e.g. avoiding unnecessary seek optimizations, sending writes in clusters, even if they are from unrelated files. this results in larger write operations and faster write throughput)

efficient incremental backup   #高效的增量備份

background scrub process for finding and fixing errors on files with redundant copies #背景程序自動檢測并修複錯誤

online filesystem defragmentation   #線上的檔案系統碎片管理

offline filesystem check#離線的檔案系統檢查

conversion of existing ext3/4 file systems #ext3/4檔案系統的轉換

seed devices. create a (readonly) filesystem that acts as a template to seed other btrfs filesystems. the original filesystem and devices are included as a readonly starting point for the new filesystem. using copy on write, all modifications are stored on different devices; the original is unchanged.

subvolume-aware quota support #支援subvolume配額,就是支援subvolume的大小限制設定

send/receive of subvolume changesefficient incremental filesystem mirroring

batch, or out-of-band deduplication (happens after writes, not during) #支援寫後的資料消重

以下這些features正在開發,或者計劃中:

very fast offline filesystem check   #快速離線檔案系統檢查

object-level mirroring and striping #對象級别的鏡像和條帶

alternative checksum algorithms    #可選擇的校驗算法

online filesystem check    #線上檔案系統檢查

other compression methods (snappy, lz4)   #其他的壓縮算法

hot data tracking and moving to faster devices (currently being pushed as a generic feature available through vfs): 熱資料轉移到更快的裝置上,比如ssd

in-band deduplication (happens during writes)   #支援寫時資料消重

    既然btrfs的目标是下一代的linux檔案系統,那麼它不單單能作為智能手持裝置的檔案系統,還能作為企業生産環境下的檔案系統。它需要能搭建在衆多的硬體平台上。

    btrfs的實作視圖可以看成需要btree構成的一個森林,使用copy-on-write(cow,寫時複制)作為更新的方法。硬碟的block以extent的形式被管理。

    這篇文章作為該系列文章的開篇,簡單的介紹一下btrfs。接下來的文章我講更詳細的去分享這些feature的具體實作。敬請期待!

尊重原創,轉載請注明出處 anzhsoft: http://blog.csdn.net/anzhsoft/article/details/20359531

繼續閱讀