reiserfs 日誌結構

2021-04-29 18:19:01 字數 1193 閱讀 7303

1. 日誌的結構

reiserfs的日誌由一組連續的塊組成,並且是固定大小的8192 + 1塊 , 結構如下:

transaction0 | transaction1 | transaction2 | ....| transactionn | journal header

2. journal header是日誌的頭部,大小是12個位元組,並且固定佔據乙個塊, 結構如下 :

name

size

description

last flush id

4the transaction id of the last fully flushed transaction

unflushed offset

4the offset (in blocks) of the next transaction in the journal

mount id

4the mount id of the flushed transaction

3. 乙個transation記錄一次原子的檔案系統操作, 乙個trasaction 由三部分組成:

a. 描述塊 (description block)

b. 一組連續的對映塊

c. 提交塊 (commit block)

4. description block 的結構如下:

5. 結合3,4解釋下如何記錄一次操作.

假如有一次操作,改變了塊 10001,  20001, 30001,40001 , 用乙個trasaction 來記錄這次操作,則:

transaction id : ***x

len : 4 (記錄了四個塊的操作)

mount id: ***x

real blocks: 10001, 20001,30001,40001

magic : reiserlb

緊跟著 description block 後面有4個 real block (假設分別為 8001,8002,8003,8004), 分別記錄了 塊 10001,20001,30001,40001的資訊。

當這個提交這個 transaction時:

塊8001的內容寫到塊10001;

塊8002的內容寫到塊20001;

塊8003的內容寫到塊30001;

塊8004的內容寫到塊40001;

然後標誌這個transation完成.

reiserfs分割槽配置

一 更新包 rpm uvh yum install kmod reiserfs reiserfs utils y 二 centos下reiserfs的管理工具 yum y install gcc automake make tar xzvf reiserfsprogs 3.x.0j.tar.gz c...

恢復reiserfs檔案系統

執行 code dmesg grep reiserfs grep partition 檢視你的 reiserfs 檔案系統是那個版本的 在後面要用到 然後用 code fsck.reiserfs check dev partition 修復,如果報錯不能修復 就 code fsck.reiserfs...

資料結構 演算法日誌

演算法培訓第一周內容 day1 鍊錶 課件 srct certi 8.第三期pro培訓 培訓課件 day1 鍊錶 習題 poj 3481day2 棧,佇列 課件 srct certi 8.第三期pro培訓 培訓課件 day2 棧,佇列 習題 進製轉換 srct certi 8.第三期pro培訓 培訓...