實戰LVCB的恢復
有關LVCB的背景知識,請參考AIX的相關資料。我在這裡就不囉嗦了。首先建立一個LV並在上面建立FS,建好後的情況如下:
/dev/sjhlv 0.08 0.08 1% 6 1% /lvcbtest
#lsvg -l sjhvg
sjhvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
sjhlv jfs2 10 10 1 open/syncd /lvcbtest
loglv02 jfs2log 1 1 1 open/syncd N/A
sjhvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
sjhlv jfs2 10 10 1 open/syncd /lvcbtest
loglv02 jfs2log 1 1 1 open/syncd N/A
#cd /lvcbtest
#ls
config.xml lost+found webAppConfig.xml
config.xml lost+found webAppConfig.xml
man getlvcb
Manual entry for getlvcb not found or not installed.
#getlvcb -TA sjhlv
AIX LVCB
intrapolicy = m
copies = 1
interpolicy = m
lvid = 00c2c87200004c00000001203c5bee8a.1
lvname = sjhlv
label = /lvcbtest
machine id = 2C8724C00
number lps = 10
relocatable = y
strict = y
stripe width = 0
stripe size in exponent = 0
type = jfs2
upperbound = 32
fs = vfs=jfs2:log=/dev/loglv02:options=rw:account=false
time created = Wed Mar 25 14:03:55 2009
time modified = Sat Apr 11 09:46:45 2009
Manual entry for getlvcb not found or not installed.
#getlvcb -TA sjhlv
AIX LVCB
intrapolicy = m
copies = 1
interpolicy = m
lvid = 00c2c87200004c00000001203c5bee8a.1
lvname = sjhlv
label = /lvcbtest
machine id = 2C8724C00
number lps = 10
relocatable = y
strict = y
stripe width = 0
stripe size in exponent = 0
type = jfs2
upperbound = 32
fs = vfs=jfs2:log=/dev/loglv02:options=rw:account=false
time created = Wed Mar 25 14:03:55 2009
time modified = Sat Apr 11 09:46:45 2009
--以上簡單的列了一下FS中的檔案,同時給出了lvcb的內容作為以下實驗的參考。
dd if=/dev/zero of=/dev/sjhlv bs=512 count=1 --破壞lvcb的內容。
1+0 records in
1+0 records out
#getlvcb -TA sjhlv
intrapolicy =
copies = 0
interpolicy =
lvid =
lvname =
label =
machine id =
number lps = 0
relocatable =
strict =
stripe width = 0
stripe size in exponent = 0
type =
upperbound = 0
fs =
time created = time modified =
intrapolicy =
copies = 0
interpolicy =
lvid =
lvname =
label =
machine id =
number lps = 0
relocatable =
strict =
stripe width = 0
stripe size in exponent = 0
type =
upperbound = 0
fs =
time created = time modified =
--此時lvcb的內容被清空了。
#cd /lvcbtest
#ls
config.xml lost+found webAppConfig.xml
#more config.xml
Provides the following main targets:
#umount /lvcbtest
#mount /lvcbtest
#cd /lvcbtest
#ls
config.xml lost+found webAppConfig.xml
--從上面的輸出我們可以看到雖然lvcb被清空,但LV及其上的FS都沒有問題,依然可以正常使用。
下面我們開始對LVCB的內容進行恢復:
#echo "AIX LVCB\0" | dd of=/dev/sjhlv bs=1 count=9
9+0 records in
9+0 records out
9+0 records in
9+0 records out
--這一步是必須的,否則會報這樣的錯:
#synclvodm -vP sjhvg sjhlv
synclvodm: Physical volume data updated.
0516-622 synclvodm: Warning, cannot write lv control block data.
synclvodm: Logical volume sjhlv updated.
#getlvcb -TA sjhlv
AIX LVCB
intrapolicy =
copies = 0
interpolicy =
lvid =
lvname =
label =
machine id =
number lps = 0
relocatable =
strict =
stripe width = 0
stripe size in exponent = 0
type =
upperbound = 0
fs =
time created = time modified =
AIX LVCB
intrapolicy =
copies = 0
interpolicy =
lvid =
lvname =
label =
machine id =
number lps = 0
relocatable =
strict =
stripe width = 0
stripe size in exponent = 0
type =
upperbound = 0
fs =
time created = time modified =
--把邏輯卷標誌寫到從邏輯捲開始的9個位元組中。
#synclvodm -vP sjhvg sjhlv
synclvodm: Physical volume data updated.
synclvodm: Logical volume sjhlv updated.
#getlvcb -TA sjhlv
AIX LVCB
intrapolicy = m
copies = 1
interpolicy = m
lvid = 00c2c87200004c00000001203c5bee8a.1
lvname = sjhlv
label =
machine id =
number lps = 10
relocatable = y
strict = y
stripe width = 0
stripe size in exponent = 0
type = jfs2
upperbound = 32
fs =
time created = time modified = Sat Apr 11 10:34:11 2009
synclvodm: Physical volume data updated.
synclvodm: Logical volume sjhlv updated.
#getlvcb -TA sjhlv
AIX LVCB
intrapolicy = m
copies = 1
interpolicy = m
lvid = 00c2c87200004c00000001203c5bee8a.1
lvname = sjhlv
label =
machine id =
number lps = 10
relocatable = y
strict = y
stripe width = 0
stripe size in exponent = 0
type = jfs2
upperbound = 32
fs =
time created = time modified = Sat Apr 11 10:34:11 2009
--用VGDA的資料同步ODM,ODM多的VGDA不管,不更新。然後會把ODM庫中關於這個LV的引數寫入LV卷頭4KB中。最後我們看到一些資訊還是沒有恢復,比如:label = ,machine id = ,fs =等。LVCB的資訊存在三份,分別在lv的頭部,VGDA,ODM。我猜測VGDA,ODM只含有LVCB的部分資訊。透過這個命令可以看到vgda的內容:#readvgda -v /dev/hdisk5 我們只看sjhlv的資訊:
********** Logical Volume: sjhlv ***********
lve.lvname: 0
lve.maxsize: 512
lve.lv_state: 1
lve.mirror: 1
lve.mirror_policy: 2
lve.num_lps: 10
lve.permissions: 1
lve.bb_relocation: 1
lve.write_verify: 2
lve.mirwrt_consist: 1
lve.stripe_exp: 0
lve.striping_width: 0
lve.lv_avoid: 0
lve.child_minor_num: 0
lve.lvname: 0
lve.maxsize: 512
lve.lv_state: 1
lve.mirror: 1
lve.mirror_policy: 2
lve.num_lps: 10
lve.permissions: 1
lve.bb_relocation: 1
lve.write_verify: 2
lve.mirwrt_consist: 1
lve.stripe_exp: 0
lve.striping_width: 0
lve.lv_avoid: 0
lve.child_minor_num: 0
#chfs -a log=/dev/loglv02 /lvcbtest
#getlvcb -TA sjhlv
AIX LVCB
intrapolicy = m
copies = 1
interpolicy = m
lvid = 00c2c87200004c00000001203c5bee8a.1
lvname = sjhlv
label =
machine id = 2C8724C00
number lps = 10
relocatable = y
strict = y
stripe width = 0
stripe size in exponent = 0
type = jfs2
upperbound = 32
fs = vfs=jfs2:log=/dev/loglv02:options=rw:account=false
time created = time modified = Sat Apr 11 10:40:50 2009
--用chfs命令按照ODM資料庫中的其它內容,進行恢復。到現在位置還有label,time created條目沒有恢復。
#putlvcb -L /lvcbtest sjhlv
[test1:/]#getlvcb -TA sjhlv
AIX LVCB
intrapolicy = m
copies = 1
interpolicy = m
lvid = 00c2c87200004c00000001203c5bee8a.1
lvname = sjhlv
label = /lvcbtest
machine id = 2C8724C00
number lps = 10
relocatable = y
strict = y
stripe width = 0
stripe size in exponent = 0
type = jfs2
upperbound = 32
fs = vfs=jfs2:log=/dev/loglv02:options=rw:account=false
time created = time modified = Sat Apr 11 10:58:16 2009
[test1:/]#getlvcb -TA sjhlv
AIX LVCB
intrapolicy = m
copies = 1
interpolicy = m
lvid = 00c2c87200004c00000001203c5bee8a.1
lvname = sjhlv
label = /lvcbtest
machine id = 2C8724C00
number lps = 10
relocatable = y
strict = y
stripe width = 0
stripe size in exponent = 0
type = jfs2
upperbound = 32
fs = vfs=jfs2:log=/dev/loglv02:options=rw:account=false
time created = time modified = Sat Apr 11 10:58:16 2009
--The putlvcb command writes the control block information into block 0 of the
logical volume lvname. Only the fields specified are written. putlvcb can be
used to write a new control block or update an existing one.直接修改LVCB的條目。time created條目依然沒有恢復,暫時不管它。
logical volume lvname. Only the fields specified are written. putlvcb can be
used to write a new control block or update an existing one.直接修改LVCB的條目。time created條目依然沒有恢復,暫時不管它。
#varyoffvg sjhvg
#exportvg sjhvg
#exportvg sjhvg
--OK,我們現在在其他機器上importvg試試看,這個LV有沒有問題。
#importvg -y sjhvg hdisk7
sjhvg
sjhvg
#mount /lvcbtest
#cd /lvcbtest
#ls
config.xml lost+found webAppConfig.xml
#more config.xml
#cd /lvcbtest
#ls
config.xml lost+found webAppConfig.xml
#more config.xml
Provides the following main targets:
* installService: Installs Apache as service (on Windows only). Input
properties are:
#getlvcb -AT sjhlv
AIX LVCB
intrapolicy = m
copies = 1
interpolicy = m
lvid = 00c2c87200004c00000001203c5bee8a.1
lvname = sjhlv
label = /lvcbtest
machine id = 2C8724C00
number lps = 10
relocatable = y
strict = y
stripe width = 0
stripe size in exponent = 0
type = jfs2
upperbound = 32
fs = vfs=jfs2:log=/dev/loglv02:options=rw:account=false
time created = time modified = Sat Apr 11 10:58:16 2009
#lslv sjhlv
LOGICAL VOLUME: sjhlv VOLUME GROUP: sjhvg
LV IDENTIFIER: 00c2c87200004c00000001203c5bee8a.1 PERMISSION: read/write
VG STATE: active/complete LV STATE: opened/syncd
TYPE: jfs2 WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 8 megabyte(s)
COPIES: 1 SCHED POLICY: parallel
LPs: 10 PPs: 10
STALE PPs: 0 BB POLICY: relocatable
INTER-POLICY: minimum RELOCATABLE: yes
INTRA-POLICY: middle UPPER BOUND: 32
MOUNT POINT: /lvcbtest LABEL: /lvcbtest
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?: NO
--經測試一切OK。
我們繼續搞破壞。
#dd if=/dev/zero of=/dev/sjhlv bs=512 count=1
1+0 records in
1+0 records out
1+0 records in
1+0 records out
#getlvcb -AT sjhlv
intrapolicy =
copies = 0
interpolicy =
lvid =
lvname =
label =
machine id =
number lps = 0
relocatable =
strict =
stripe width = 0
stripe size in exponent = 0
type =
upperbound = 0
fs =
time created = time modified =
--上面這個過程是在本機上繼續上次破壞的操作。
下面的操作是在異機恢復lvcb。注意異機的ODM庫已經沒有sjhvg的任何資訊。
#importvg -y sjhvg hdisk7
0516-622 synclvodm: Warning, cannot write lv control block data.
sjhvg
0516-622 synclvodm: Warning, cannot write lv control block data.
sjhvg
--無法得到此LV的資訊,因為資訊在LVCB上。
#lsvg -l sjhvg
sjhvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
sjhlv 10 10 1 closed/syncd N/A
loglv02 jfs2log 1 1 1 closed/syncd N/A
sjhvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
sjhlv 10 10 1 closed/syncd N/A
loglv02 jfs2log 1 1 1 closed/syncd N/A
--LV能看到。
#mount /lvcbtest
mount: /lvcbtest is not a known file system
mount: /lvcbtest is not a known file system
--但無法mount FS
#getlvcb -AT sjhlv
intrapolicy =
copies = 0
interpolicy =
lvid =
lvname =
label =
machine id =
number lps = 0
relocatable =
strict =
stripe width = 0
stripe size in exponent = 0
type =
upperbound = 0
fs =
time created = time modified =
intrapolicy =
copies = 0
interpolicy =
lvid =
lvname =
label =
machine id =
number lps = 0
relocatable =
strict =
stripe width = 0
stripe size in exponent = 0
type =
upperbound = 0
fs =
time created = time modified =
--什麼資訊都沒有。
開始按照本機的恢復方法在異機恢復lvcb的內容
#echo "AIX LVCB\0" | dd of=/dev/sjhlv bs=1 count=9
9+0 records in
9+0 records out
9+0 records in
9+0 records out
#getlvcb -AT sjhlv
AIX LVCB
intrapolicy =
copies = 0
interpolicy =
lvid =
lvname =
label =
machine id =
number lps = 0
relocatable =
strict =
stripe width = 0
stripe size in exponent = 0
type =
upperbound = 0
fs =
time created = time modified =
AIX LVCB
intrapolicy =
copies = 0
interpolicy =
lvid =
lvname =
label =
machine id =
number lps = 0
relocatable =
strict =
stripe width = 0
stripe size in exponent = 0
type =
upperbound = 0
fs =
time created = time modified =
#synclvodm -vP sjhvg sjhlv
synclvodm: Physical volume data updated.
synclvodm: Logical volume sjhlv updated.
synclvodm: Physical volume data updated.
synclvodm: Logical volume sjhlv updated.
#getlvcb -AT sjhlv
AIX LVCB
intrapolicy = m
copies = 1
interpolicy = m
lvid = 00c2c87200004c00000001203c5bee8a.1
lvname = sjhlv
label =
machine id =
number lps = 10
relocatable = n
strict = y
stripe width = 0
stripe size in exponent = 0
type =
upperbound = 32
fs =
time created = time modified = Sat Apr 11 11:53:09 2009
#chfs -a log=/dev/loglv02 /lvcbtest
chfs: No record matching '/lvcbtest' was found in /etc/filesystems.
--我把本機/etc/filesystems中關於lvcbtest的資訊copy到異機。內容如下:
/lvcbtest:
dev = /dev/sjhlv
vfs = jfs2
log = /dev/loglv02
mount = false
check = false
options = rw
account = false
#chfs -a log=/dev/loglv02 /lvcbtest --需要注意lv不要與異機的lv同名。
#getlvcb -AT sjhlv
AIX LVCB
intrapolicy = m
copies = 1
interpolicy = m
lvid = 00c2c87200004c00000001203c5bee8a.1
lvname = sjhlv
label =
machine id = 2C8724C00
number lps = 10
relocatable = n
strict = y
stripe width = 0
stripe size in exponent = 0
type =
upperbound = 32
fs = vfs=jfs2:log=/dev/loglv02:options=rw:account=false
time created = time modified = Sat Apr 11 13:26:28 2009
AIX LVCB
intrapolicy = m
copies = 1
interpolicy = m
lvid = 00c2c87200004c00000001203c5bee8a.1
lvname = sjhlv
label =
machine id = 2C8724C00
number lps = 10
relocatable = n
strict = y
stripe width = 0
stripe size in exponent = 0
type =
upperbound = 32
fs = vfs=jfs2:log=/dev/loglv02:options=rw:account=false
time created = time modified = Sat Apr 11 13:26:28 2009
#putlvcb -L /lvcbtest sjhlv
#getlvcb -AT sjhlv
AIX LVCB
intrapolicy = m
copies = 1
interpolicy = m
lvid = 00c2c87200004c00000001203c5bee8a.1
lvname = sjhlv
label = /lvcbtest
machine id = 2C8724C00
number lps = 10
relocatable = n
strict = y
stripe width = 0
stripe size in exponent = 0
type =
upperbound = 32
fs = vfs=jfs2:log=/dev/loglv02:options=rw:account=false
time created = time modified = Sat Apr 11 13:35:27 2009
#getlvcb -AT sjhlv
AIX LVCB
intrapolicy = m
copies = 1
interpolicy = m
lvid = 00c2c87200004c00000001203c5bee8a.1
lvname = sjhlv
label = /lvcbtest
machine id = 2C8724C00
number lps = 10
relocatable = n
strict = y
stripe width = 0
stripe size in exponent = 0
type =
upperbound = 32
fs = vfs=jfs2:log=/dev/loglv02:options=rw:account=false
time created = time modified = Sat Apr 11 13:35:27 2009
--type的資訊無法恢復。time created的資訊也無法恢復。
#mount /lvcbtest
#cd /lvcbtest
ls
config.xml lost+found webAppConfig.xml
#more config.xml
#mount /lvcbtest
#cd /lvcbtest
ls
config.xml lost+found webAppConfig.xml
#more config.xml
Provides the following main targets:
* installService: Installs Apache as service (on Windows only). Input
properties are:
--在異機恢復完成。在本機恢復LVCB的type資訊是可以恢復的,我猜測因為ODM庫有LVCB的部分資訊,而同時VGDA也沒有LVCB關於type的條目資訊。
由於本人水平有限,錯誤之處,還望大家多多指點。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/196700/viewspace-1223835/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- innobackupex備份恢復實戰
- RMAN異地恢復實戰
- Oracle 9I恢復實戰Oracle
- Oracle 10G恢復實戰Oracle 10g
- PG 資料庫恢復實戰資料庫
- Oracle 10G恢復實戰1Oracle 10g
- 28_bbed實戰(1)_delete操作恢復delete
- 實戰:xfs檔案系統的備份和恢復
- Kubernetes備份恢復之velero實戰
- RMAN實戰系列之二:用RMAN實現災難恢復
- oracle實驗記錄 (恢復-完全恢復)Oracle
- oracle實驗記錄 (恢復-rman恢復)Oracle
- RMAN恢復實踐
- oracle實驗記錄 (恢復-不完全恢復)Oracle
- 一步一步學RMAN第九篇 實戰rman恢復(1)丟失控制檔案的恢復
- NoSQL 資料庫案例實戰 -- MongoDB資料備份、恢復SQL資料庫MongoDB
- 備份恢復原理的實踐
- oracle實驗記錄 (恢復-rman基於控制檔案的恢復)Oracle
- Oracle恢復實驗(一)Oracle
- Oracle恢復實驗(二)Oracle
- Oracle恢復實驗(三)Oracle
- Oracle恢復實驗(四)Oracle
- RMAN恢復實踐(轉)
- oracle實驗記錄 (恢復-恢復未備份的資料檔案)Oracle
- 【備份與恢復】控制檔案的恢復(不完全恢復)
- Oracle 表級的快速恢復(實習)Oracle
- 【實戰】使用“基表修改法”恢復被“set unused”方式誤刪除的列
- Oracle10g 10.2.0.5 RAC一次恢復ORC、votedisk實戰Oracle
- 【備份恢復】Oracle 資料備份與恢復微實踐Oracle
- rman恢復--丟失控制檔案的恢復
- 恢復之非歸檔模式下的恢復模式
- 【實戰】使用“基表修改法”恢復被“set unused”方式誤刪除的列(續)
- Oracle常規恢復的實驗測試Oracle
- oracle實驗記錄 (恢復-使用resetlogs open前備份恢復)Oracle
- MySQL運維實戰之備份和恢復(8.1)xtrabackup全量備份MySql運維
- 【恢復】Redo日誌檔案丟失的恢復
- 【Oracle 恢復表空間】 實驗Oracle
- MySQL備份與恢復——實操MySql