Ifthe lost disk is the “file 1 block 1″ disk then scan every AU of the bad disk till you find a headerwhich claims to be FILE_DIRECTORY (KFBTYP_FILEDIR).
如果通过grep没有找到f1b1,就需要查找所有的AU.直到找到file directory。
Onceyou find that you can set f1b1locn to that AU number and continue… If the file directory cannotbe found anywhere then we have no choice but to re-create the diskgroup andrestore from a backup.
5. Edit the fix.txt and change thefollowing fields to the proper values (use the ASM alert log for reference):
kfdhdb.dsknum
kfdhdb.dskname
kfdhdb.fgname
修改相关的参数值
Example:
Check the alert log for proper names:
NOTE: cache opening disk 0 of grp 1:DATA_0000 path:/ocfs02/asm/data01
NOTE: cache opening disk 1 of grp 1:DATA_0001 path:/ocfs02/asm/data02
NOTE: cache opening disk 2 of grp 1:DATA_0002 path:/ocfs02/asm/data03
Old values from fix.txt:
kfdhdb.dsknum:1 ; 0x024: 0x0001
kfdhdb.grptyp:1 ; 0x026: KFDGTP_EXTERNAL
kfdhdb.hdrsts:3 ; 0x027: KFDHDR_MEMBER
kfdhdb.dskname:DATA_0001 ; 0x028: length=9
kfdhdb.grpname:DATA ; 0x048: length=4
kfdhdb.fgname:DATA_0001 ; 0x068: length=9
New values from fix.txt:
kfdhdb.dsknum:2 ; 0x024: 0x0002
kfdhdb.grptyp:1 ; 0x026: KFDGTP_EXTERNAL
kfdhdb.hdrsts:3 ; 0x027: KFDHDR_MEMBER
kfdhdb.dskname:DATA_0002 ; 0x028: length=9
kfdhdb.grpname:DATA ; 0x048: length=4
kfdhdb.fgname:DATA_0002 ; 0x068: length=9
6. Find the diskdirectory by dumping aunum=2 and blknum=2 for the disk with f1b1:
根据file directory查找disk directory,命令如下:
kfed read aunum=2 blknum=2 | more
Example:
$ kfed read /ocfs02/asm/data01 aunum=2blknum=2 | more
kfffde[0].xptr.au: 2 ; 0x4a0: 0x00000002
kfffde[0].xptr.disk: 2 ; 0x4a4: 0x0002
kfffde[0].xptr.flags: 0 ; 0x4a6: L=0 E=0D=0 S=0
kfffde[0].xptr.chk: 42 ; 0x4a7: 0x2a
kfffde[1].xptr.au: 4294967295; 0x4a8:0xffffffff
kfffde[1].xptr.disk: 65535 ; 0x4ac: 0xffff
kfffde[1].xptr.flags: 0 ; 0x4ae: L=0 E=0D=0 S=0
kfffde[1].xptr.chk: 42 ; 0x4af: 0x2a
Afterthe initial file directory header, you will see the extent map. If thediskgroup is external redundancy then each entry refers to an extent of thefile. For normal redundancy, every pair is a extent set, similarly for highredundancy [012] form the extent set. Here we see thedisk directory is at au = 2 in disk number = 2.
In this example, it turned out to bein that location on the second AU, but it is not guaranteed that it will alwaysbe there.
7. Once the diskdirectory location is found, find the info for your disk number.
一旦确定了disk directory 的位置,就可以查看disk number 的信息。命令如下:
kfedread aunum=2 blknum=0 | more
Example:
kfed read /ocfs02/asm/data02 aunum=2blknum=0 | more
Various kfddde refer to the disk directory entries.Only entries with entry.incarn numbers shouldA=1 are allocated entries. You might find entries with dskname populated, butif A=0 then it means that entry was deleted.
8. Now go back to fix.txt and adjust thecrestmp.hi and crestmp.lo to match what the disk directory shows. Ifit is already the same then leave it.
Ifthe diskgroup fails to mount at this point, you may want to either considerre-creating the diskgroup and restoring or engaging BDE to assist.
Youmay also want to try clearing the first 4k of the disk with dd then do a kfedmerge again in case there are any extra characters causing problems (MAKE SURE YOU HAVE A BACKUP OF THE FIRST 4K FIRST):