閱讀286 返回首頁    go 阿裏雲 go 技術社區[雲棲]


存儲那些事兒(二): 下一代Linux文件係統BTRFS簡介

    BTRFS,通常念成 Butter FS,Better FS 或B-tree FS。下一代的Linux文件係統。

    它基於寫時拷貝(copy-on-write),支持高效的snapshot和clone。它使用b-tree作為存儲的數據結構。在BTRFS項目主頁上對自己是這麼描述的:"一個新的針對Linux的寫時複製文件係統,致力於實施高級的功能,同時關注容錯、修複和管理方便性。"

   它有哪些高級功能呢?下麵的feature來自BTRFS的項目主頁:https://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 changes
    • Efficient 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: https://blog.csdn.net/anzhsoft/article/details/20359531


最後更新:2017-04-03 12:55:21

  上一篇:go 網絡子係統86_inet協議族-l4向下(一)
  下一篇:go 動態規劃-jobdu-1547:出入棧