Linux 6.2 的 Btrfs 改進

Hacker News 上看到 Btrfs 的改善消息:「Btrfs With Linux 6.2 Bringing Performance Improvements, Better RAID 5/6 Reliability」,對應的討論在「 Btrfs in Linux 6.2 brings performance improvements, better RAID 5/6 reliability (phoronix.com)」這邊。

因為 ext4 本身很成熟了,加上特殊的需求反而會去用 OpenZFS,就很久沒關注 Btrfs 了,這次看到 Btrfs 在 Linux 6.2 上的改進剛好可以重顧一下情況。

看起來是針對 RAID 模式下的改善,包括穩定性與效能,不過看起來是針對 RAID5 的部份多一點。

就目前的「情勢」看起來,Btrfs 之所以還是有繼續被發展,主要還是因為 OpenZFS 的授權條款是 CDDL,與 Linux kernel 用的 GPLv2 不相容,所以得分開維護。

但 OpenZFS 這邊的功能性與成熟度還是比 Btrfs 好不少,以現階段來說,如果架構上可以設計放 OpenZFS 的話應該還是會放 OpenZFS...

ZFS 租用服務

看到「zfs.rent」這個網站:

We have a couple of ZFS-based NAS systems. We wanted a simple cloud service so we could run:

$ zfs send -v -R -I pool/snapshot_034 pool/snapshot_042 |\
    ssh marvin@marvin.zfs.rent zfs recv -v -Fu pool/snapshots

看起來是用 Linux 上的 OpenZFS 架的,每個 instance 提供 4GB RAM,這個部份應該還好,但只提供 1TB 的流量 (上傳與下載都要算),這部份看起來就有點不太夠用了,以這種服務來說蠻容易踩到 overcharge 的部份。

作業系統的部份可以選擇 Ubuntu 20.04 或是 CentOS 8.2。

以架構上來說可以當作是某種特化的 VPS (底層的 raw disk 直接掛上來),以這個角度來看的話,機器部份的費用看起來還好,但頻寬部份會拉高整體成本。

這個服務看起來比較像是噱頭吧,看看就好...

Ubuntu 搞定 ZFS 授權問題,將直接納入系統中使用

Canonical 的人 (Ubuntu 背後的公司) 跟律師研究後決定採用 .ko 的方式 (就像 nvidia.ko 的方式) 納入 ZFS,讓 Ubuntu 的人可以更方便使用,而不是像現在要另外手動做不少步驟:「ZFS Licensing and Linux」。

依照 Canonical 的研究,CDDL (ZFS) 與 GPLv2 (Linux) 的授權方式不同,所以可以找到方法交叉避開衝突:

While the CDDL and GPLv2 are both "copyleft" licenses, they have different scope. The CDDL applies to all files under the CDDL, while the GPLv2 applies to derivative works.

The CDDL cannot apply to the Linux kernel because zfs.ko is a self-contained file system module -- the kernel itself is quite obviously not a derivative work of this new file system.

And zfs.ko, as a self-contained file system module, is clearly not a derivative work of the Linux kernel but rather quite obviously a derivative work of OpenZFS and OpenSolaris. Equivalent exceptions have existed for many years, for various other stand alone, self-contained, non-GPL kernel modules.

至於這種說法是不是成立,至少在還沒上法院認證前也還不知道... 不過看起來 Canonical 是頗有自信,打算將 ZFS 弄進 Ubuntu,上面有不少好用的東西...

Linux 上跑 ZFS

Linux 上可以跑 ZFS 的消息已經一陣子了,但在「71 TiB DIY NAS Based on ZFS on Linux」這篇看到有人跳下去玩還是覺得很特別... (大多還是看到 FreeBSD 或是 Oracle 的系統)

用的是 Debian Wheezy,文章裡沒提到是不是跑 OpenZFS,不過我猜應該是...

跑出來的效能相當好:

With a storage capacity four times higher than the original and an incredible read (2.5 GB/s)/write (1.9 GB/s) performance, it's a worthy successor.

約 6012 歐元,大約 23.5 萬台幣。

OpenZFS 成立...

好幾個新聞來源都有看到 OpenZFS 成立:「OpenZFS Project Launches, Uniting ZFS Developers」(Slashdot)、「OpenZFS launch announcement」。

OpenZFS 的正式公告在「Announcement」這邊,雖然沒有明講是要脫離 Oracle 的控制,但宣示對社群更公開這點其實就很清楚了 (To encourage open communication about ongoing efforts to improve open source OpenZFS, ...)。

隔壁棚 Oracle 前員工 (現在在 Fusion-io) 弄出來的 Btrfs 的進展也不差,兩邊都在進步...