Lvm
linux ‘mdadm –write-journal’ 和 lvmcache - 它們有什麼關係?
在 linux mdadm 手冊頁中,我看到了“–write-journal”選項。
這與 lvmcache 有何關係,因為 lvmcache 是建立在 dm-cache 之上的?它們是不同的東西還是 lvmcache 在引擎蓋下做了類似“–write-journal”的事情?
謝謝!
RAID 日誌在 md 手冊頁中有更詳細的描述:
RAID456 WRITE JOURNAL Due to non-atomicity nature of RAID write operations, interruption of write operations (system crash, etc.) to RAID456 array can lead to inconsistent parity and data loss (so called RAID-5 write hole). To plug the write hole, from Linux 4.4 (to be confirmed), md supports write ahead journal for RAID456. When the array is created, an addi‐ tional journal device can be added to the array through write-journal option. The RAID write journal works similar to file system journals. Before writing to the data disks, md persists data AND parity of the stripe to the journal device. After crashes, md searches the journal device for incomplete write operations, and replay them to the data disks. When the journal device fails, the RAID array is forced to run in read- only mode.
所以 - 這與
lvmcache
任何形狀或形式無關。lvmcache 旨在通過在 SSD 上記憶體數據來提供更快的讀取速度
md write journal 是一個寫記憶體,它甚至不會讓事情變得更快。它的存在是為了防止數據失去。如果所有 RAID 寫入都必須首先通過它,這對 SSD 來說是一個巨大的負擔——如果這也發生在 RAID 重新同步和增長期間,您將看到在短時間內寫入許多 TB。
這可能是
mdadm
手冊頁提到 SSD 壽命的原因:--write-journal Specify journal device for the RAID-4/5/6 array. The journal device should be a SSD with reasonable lifetime.