第一步:创建asm磁盘
查看磁盘情况
SQL> col name for a40
set line 200
col path format a60
select name,path,state,HEADER_STATUS from v$asm_disk;
SQL> SQL> SQL>
NAME PATH STATE HEADER_STATU
---------------------------------------- ------------------------------------------------------------ -------- ------------
/dev/asmdisk/asm-disk1 NORMAL MEMBER
/dev/asmdisk/asm-disk2 NORMAL CANDIDATE
DATA1 AFD:DATA1 NORMAL MEMBER
SQL> select group_number,disk_number,name,failgroup from v$asm_disk;
GROUP_NUMBER DISK_NUMBER NAME FAILGROUP
------------ ----------- ---------------------------------------- ------------------------------
0 0
0 1
1 0 DATA1 DATA1
创建磁盘组
SQL> create diskgroup tt external redundancy disk '/dev/asmdisk/asm-disk2';
Diskgroup created.
SQL> select name,path,state,HEADER_STATUS from v$asm_disk;
NAME PATH STATE HEADER_STATU
---------------------------------------- ------------------------------------------------------------ -------- ------------
/dev/asmdisk/asm-disk1 NORMAL MEMBER
DATA1 AFD:DATA1 NORMAL MEMBER
TT_0000 /dev/asmdisk/asm-disk2 NORMAL MEMBER
SQL> select group_number,disk_number,name,failgroup from v$asm_disk;
GROUP_NUMBER DISK_NUMBER NAME FAILGROUP
------------ ----------- ---------------------------------------- ------------------------------
0 0
1 0 DATA1 DATA1
2 0 TT_0000 TT_0000
查看磁盘头:
[grid@test ~]$ kfed read /dev/asmdisk/asm-disk2 aus=1M blkn=0
kfbh.endian: 1 ; 0x000: 0x01
kfbh.hard: 130 ; 0x001: 0x82
kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
kfbh.datfmt: 1 ; 0x003: 0x01
kfbh.block.blk: 0 ; 0x004: blk=0
kfbh.block.obj: 2147483648 ; 0x008: disk=0
kfbh.check: 1327320159 ; 0x00c: 0x4f1d4c5f
kfbh.fcn.base: 0 ; 0x010: 0x00000000
kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
kfbh.spare1: 0 ; 0x018: 0x00000000
kfbh.spare2: 0 ; 0x01c: 0x00000000
kfdhdb.driver.provstr: ORCLDISK ; 0x000: length=8
kfdhdb.driver.reserved[0]: 0 ; 0x008: 0x00000000
kfdhdb.driver.reserved[1]: 0 ; 0x00c: 0x00000000
kfdhdb.driver.reserved[2]: 0 ; 0x010: 0x00000000
kfdhdb.driver.reserved[3]: 0 ; 0x014: 0x00000000
kfdhdb.driver.reserved[4]: 0 ; 0x018: 0x00000000
kfdhdb.driver.reserved[5]: 0 ; 0x01c: 0x00000000
kfdhdb.compat: 186647040 ; 0x020: 0x0b200200
kfdhdb.dsknum: 0 ; 0x024: 0x0000
kfdhdb.grptyp: 1 ; 0x026: KFDGTP_EXTERNAL
kfdhdb.hdrsts: 3 ; 0x027: KFDHDR_MEMBER
kfdhdb.dskname: TT_0000 ; 0x028: length=7
kfdhdb.grpname: TT ; 0x048: length=2
kfdhdb.fgname: TT_0000 ; 0x068: length=7
kfdhdb.siteguid[0]: 0 ; 0x088: 0x00
kfdhdb.siteguid[1]: 0 ; 0x089: 0x00
kfdhdb.siteguid[2]: 0 ; 0x08a: 0x00
kfdhdb.siteguid[3]: 0 ; 0x08b: 0x00
kfdhdb.siteguid[4]: 0 ; 0x08c: 0x00
kfdhdb.siteguid[5]: 0 ; 0x08d: 0x00
kfdhdb.siteguid[6]: 0 ; 0x08e: 0x00
kfdhdb.siteguid[7]: 0 ; 0x08f: 0x00
kfdhdb.siteguid[8]: 0 ; 0x090: 0x00
kfdhdb.siteguid[9]: 0 ; 0x091: 0x00
kfdhdb.siteguid[10]: 0 ; 0x092: 0x00
kfdhdb.siteguid[11]: 0 ; 0x093: 0x00
kfdhdb.siteguid[12]: 0 ; 0x094: 0x00
kfdhdb.siteguid[13]: 0 ; 0x095: 0x00
kfdhdb.siteguid[14]: 0 ; 0x096: 0x00
kfdhdb.siteguid[15]: 0 ; 0x097: 0x00
kfdhdb.ub1spare[0]: 0 ; 0x098: 0x00
kfdhdb.ub1spare[1]: 0 ; 0x099: 0x00
kfdhdb.ub1spare[2]: 0 ; 0x09a: 0x00
kfdhdb.ub1spare[3]: 0 ; 0x09b: 0x00
kfdhdb.ub1spare[4]: 0 ; 0x09c: 0x00
kfdhdb.ub1spare[5]: 0 ; 0x09d: 0x00
kfdhdb.ub1spare[6]: 0 ; 0x09e: 0x00
kfdhdb.ub1spare[7]: 0 ; 0x09f: 0x00
kfdhdb.ub1spare[8]: 0 ; 0x0a0: 0x00
kfdhdb.ub1spare[9]: 0 ; 0x0a1: 0x00
kfdhdb.ub1spare[10]: 0 ; 0x0a2: 0x00
kfdhdb.ub1spare[11]: 0 ; 0x0a3: 0x00
kfdhdb.ub1spare[12]: 0 ; 0x0a4: 0x00
kfdhdb.ub1spare[13]: 0 ; 0x0a5: 0x00
kfdhdb.ub1spare[14]: 0 ; 0x0a6: 0x00
kfdhdb.ub1spare[15]: 0 ; 0x0a7: 0x00
kfdhdb.crestmp.hi: 33168938 ; 0x0a8: HOUR=0xa DAYS=0x11 MNTH=0x7 YEAR=0x7e8
kfdhdb.crestmp.lo: 2931100672 ; 0x0ac: USEC=0x0 MSEC=0x143 SECS=0x2b MINS=0x2b
kfdhdb.mntstmp.hi: 33168938 ; 0x0b0: HOUR=0xa DAYS=0x11 MNTH=0x7 YEAR=0x7e8
kfdhdb.mntstmp.lo: 2940670976 ; 0x0b4: USEC=0x0 MSEC=0x1c5 SECS=0x34 MINS=0x2b
kfdhdb.secsize: 512 ; 0x0b8: 0x0200
kfdhdb.blksize: 4096 ; 0x0ba: 0x1000
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000
kfdhdb.mfact: 113792 ; 0x0c0: 0x0001bc80
kfdhdb.dsksize: 5120 ; 0x0c4: 0x00001400
kfdhdb.pmcnt: 2 ; 0x0c8: 0x00000002
kfdhdb.fstlocn: 1 ; 0x0cc: 0x00000001
kfdhdb.altlocn: 2 ; 0x0d0: 0x00000002
kfdhdb.f1b1locn: 2 ; 0x0d4: 0x00000002
kfdhdb.redomirrors[0]: 0 ; 0x0d8: 0x0000
kfdhdb.redomirrors[1]: 0 ; 0x0da: 0x0000
kfdhdb.redomirrors[2]: 0 ; 0x0dc: 0x0000
kfdhdb.redomirrors[3]: 0 ; 0x0de: 0x0000
kfdhdb.dbcompat: 168820736 ; 0x0e0: 0x0a100000
kfdhdb.grpstmp.hi: 33168938 ; 0x0e4: HOUR=0xa DAYS=0x11 MNTH=0x7 YEAR=0x7e8
kfdhdb.grpstmp.lo: 2931001344 ; 0x0e8: USEC=0x0 MSEC=0xe2 SECS=0x2b MINS=0x2b
kfdhdb.vfstart: 0 ; 0x0ec: 0x00000000
kfdhdb.vfend: 0 ; 0x0f0: 0x00000000
kfdhdb.spfile: 0 ; 0x0f4: 0x00000000
kfdhdb.spfflg: 0 ; 0x0f8: 0x00000000
kfdhdb.flags: 0 ; 0x0fc: 0x00000000
kfdhdb.f1b1fcn.base: 0 ; 0x100: 0x00000000
kfdhdb.f1b1fcn.wrap: 0 ; 0x104: 0x00000000
kfdhdb.ip[0]: 0 ; 0x108: 0x00
kfdhdb.ip[1]: 127 ; 0x109: 0x7f
kfdhdb.ip[2]: 0 ; 0x10a: 0x00
kfdhdb.ip[3]: 0 ; 0x10b: 0x00
kfdhdb.modstmp: 1721227432 ; 0x10c: 0x6697d8a8
kfdhdb.checklbl: 0 ; 0x110: 0x00
kfdhdb.verlbl: 0 ; 0x111: 0x00
kfdhdb.ub2spare: 0 ; 0x112: 0x0000
kfdhdb.sitelbl: ; 0x114: length=0
kfdhdb.fglbl: ; 0x124: length=0
kfdhdb.vsnnum: 318767104 ; 0x144: 0x13000000
可以看到磁盘信息完整。
查看磁盘组的兼容性信息
SQL> select name,state,allocation_unit_size,compatibility from v$asm_diskgroup;
NAME STATE ALLOCATION_UNIT_SIZE COMPATIBILITY
---------------------------------------- ----------- -------------------- ------------------------------------------------------------
QQ DISMOUNTED 0 0.0.0.0.0
DATA MOUNTED 4194304 19.0.0.0.0
TT MOUNTED 1048576 11.2.0.2.0
可以看到TT 的兼容性是11.2
第二步:fdisk 破坏磁盘
首先 卸载磁盘
SQL> alter diskgroup TT dismount;
Diskgroup altered.
fdisk 破坏磁盘
asm-disk2对应的是sdd磁盘
[root@test rules.d]# fdisk /dev/sdd
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xbb8996e7.
Command (m for help): p
Disk /dev/sdd: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xbb8996e7
Device Boot Start End Blocks Id System
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-10485759, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-10485759, default 10485759):
Using default value 10485759
Partition 1 of type Linux and of size 5 GiB is set
Command (m for help): p
Disk /dev/sdd: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xbb8996e7
Device Boot Start End Blocks Id System
/dev/sdd1 2048 10485759 5241856 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
lsblk 查看磁盘信息
[root@test rules.d]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 80G 0 disk
?sda1 8:1 0 1G 0 part /boot
?sda2 8:2 0 79G 0 part
?rhel-root 253:0 0 50G 0 lvm /
?rhel-swap 253:1 0 3.9G 0 lvm [SWAP]
?rhel-home 253:2 0 25.1G 0 lvm /home
sdb 8:16 0 20G 0 disk
sdc 8:32 0 2G 0 disk
sdd 8:48 0 5G 0 disk
?sdd1 8:49 0 5G 0 part
sr0 11:0 1 1024M 0 rom
可以看到sdd已经被分区了
查看asm磁盘信息
[root@test rules.d]# ll /dev/asmdisk/asm-disk*
lrwxrwxrwx 1 root root 6 Jul 17 10:52 /dev/asmdisk/asm-disk1 -> ../sdc
lrwxrwxrwx 1 root root 7 Jul 17 10:55 /dev/asmdisk/asm-disk2 -> ../sdd1 --》asm-disk2指向了sdd1,原来是sdd
现在我们观察磁盘的破坏情况:
kfbh.type: 0 ; 0x002: KFBTYP_INVALID
i=0,j=0
kfbh.type: 2 ; 0x002: KFBTYP_FREESPC
i=1,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
i=2,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
i=3,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
i=4,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
i=5,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
i=6,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
i=7,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
i=8,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
i=9,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
可以看到fdisk分区不格式化的情况下只有磁盘头被破坏了
我们知道,asm 从11.1.0.7 开始磁盘头会自动备份到AU1的倒数第二个asm元数据块中,知道au块大小和asm元数据块大小后就能找到这个块的编号
[grid@test ~]$ kfed read /dev/sdd aus=1M blkn=254 aun=1 |more
kfbh.endian: 1 ; 0x000: 0x01
kfbh.hard: 130 ; 0x001: 0x82
kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
kfbh.datfmt: 1 ; 0x003: 0x01
kfbh.block.blk: 254 ; 0x004: blk=254
kfbh.block.obj: 2147483648 ; 0x008: disk=0
kfbh.check: 1327320225 ; 0x00c: 0x4f1d4ca1
kfbh.fcn.base: 0 ; 0x010: 0x00000000
kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
kfbh.spare1: 0 ; 0x018: 0x00000000
kfbh.spare2: 0 ; 0x01c: 0x00000000
或者,直接搜一下
for (( j=0; j alter diskgroup TT mount
2024-07-17T11:11:37.514860-04:00
NOTE: cache registered group TT 2/0x66BFAAC5
NOTE: cache began mount (first) of group TT 2/0x66BFAAC5
NOTE: Assigning number (2,0) to disk (/dev/asmdisk/asm-disk2)
2024-07-17T11:11:37.581355-04:00
cluster guid (779587564ff57f3fbfa7240135ffdf89) generated for PST Hbeat for instance 1
2024-07-17T11:11:43.588192-04:00
NOTE: GMON heartbeating for grp 2 (TT)
GMON querying group 2 at 35 for pid 25, osid 54128
2024-07-17T11:11:43.589298-04:00
NOTE: cache is mounting group TT created on 2024/07/17 10:43:43
NOTE: cache opening disk 0 of grp 2: TT_0000 path:/dev/asmdisk/asm-disk2
NOTE: 07/17/24 11:11:43 TT.F1X0 found on disk 0 au 2 fcn 0.0 datfmt 1
2024-07-17T11:11:43.589772-04:00
NOTE: cache mounting (first) external redundancy group 2/0x66BFAAC5 (TT)
NOTE: cache recovered group 2 to fcn 0.3
NOTE: redo buffer size is 256 blocks (1056768 bytes)
2024-07-17T11:11:43.604247-04:00
NOTE: LGWR attempting to mount thread 1 for diskgroup 2 (TT)
NOTE: LGWR found thread 1 closed at ABA 2.1 lock domain=0 inc#=0 instnum=1
NOTE: LGWR mounted thread 1 for diskgroup 2 (TT)
2024-07-17T11:11:43.608994-04:00
NOTE: LGWR opened thread 1 (TT) at fcn 0.3 ABA 3.2 lock domain=2 inc#=0 instnum=1 gx.incarn=1723837125 mntstmp=2024/07/17 11:11:43.605000
2024-07-17T11:11:43.609228-04:00
NOTE: cache mounting group 2/0x66BFAAC5 (TT) succeeded
NOTE: cache ending mount (success) of group TT number=2 incarn=0x66bfaac5
2024-07-17T11:11:43.661086-04:00
NOTE: Instance updated compatible.asm to 11.2.0.2.0 for grp 2 (TT).
2024-07-17T11:11:43.661843-04:00
NOTE: Instance updated compatible.rdbms to 10.1.0.0.0 for grp 2 (TT).
2024-07-17T11:11:43.663327-04:00
SUCCESS: diskgroup TT was mounted
2024-07-17T11:11:43.691534-04:00
SUCCESS: alter diskgroup TT mount
2024-07-17T11:11:43.751339-04:00
NOTE: diskgroup resource ora.TT.dg is online
NOTE: diskgroup resource ora.TT.dg is updated
再次尝试分区格式化后是否能够挂载
首先 dismount磁盘
SQL> alter diskgroup TT dismount;
Diskgroup altered.
然后fdisk 分区格式化磁盘
分区
[root@test rules.d]# fdisk /dev/sdd
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xca04d013.
Command (m for help): p
Disk /dev/sdd: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xca04d013
Device Boot Start End Blocks Id System
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-10485759, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-10485759, default 10485759):
Using default value 10485759
Partition 1 of type Linux and of size 5 GiB is set
Command (m for help): p
Disk /dev/sdd: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xca04d013
Device Boot Start End Blocks Id System
/dev/sdd1 2048 10485759 5241856 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
格式化磁盘
[root@test rules.d]# mkfs.ext4 /dev/sdd1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
327680 inodes, 1310464 blocks
65523 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1342177280
40 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
这个时候查看磁盘信息
[grid@test ~]$ kfed read /dev/sdd aus=1M blkn=0 aun=0
kfbh.endian: 0 ; 0x000: 0x00
kfbh.hard: 0 ; 0x001: 0x00
kfbh.type: 0 ; 0x002: KFBTYP_INVALID
kfbh.datfmt: 0 ; 0x003: 0x00
kfbh.block.blk: 0 ; 0x004: blk=0
kfbh.block.obj: 0 ; 0x008: file=0
kfbh.check: 0 ; 0x00c: 0x00000000
kfbh.fcn.base: 0 ; 0x010: 0x00000000
kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
kfbh.spare1: 0 ; 0x018: 0x00000000
kfbh.spare2: 0 ; 0x01c: 0x00000000
000000000 00000000 00000000 00000000 00000000 [................]
Repeat 26 times
0000001B0 00000000 00000000 CA04D013 20000000 [............... ]
0000001C0 B4830021 08008CA8 F8000000 0000009F [!...............]
0000001D0 00000000 00000000 00000000 00000000 [................]
Repeat 1 times
0000001F0 00000000 00000000 00000000 AA550000 [..............U.]
000000200 00000000 00000000 00000000 00000000 [................]
Repeat 223 times
KFED-00322: invalid content encountered during block traversal: [kfbtTraverseBlock][Invalid OSM block type][][0]
此时磁盘已经是损坏的了,我们分析下损坏程度
kfbh.type: 0 ; 0x002: KFBTYP_INVALID
i=0,j=0
kfbh.type: 2 ; 0x002: KFBTYP_FREESPC
i=1,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
i=2,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
i=3,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
i=4,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
i=5,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
i=6,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
i=7,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
i=8,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
i=9,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
i=10,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
i=11,j=0
kfbh.type: 0 ; 0x002: KFBTYP_INVALID
i=55,j=3
kfbh.type: 0 ; 0x002: KFBTYP_INVALID
i=56,j=3
au0只有asm 磁盘头被损坏,但是au1 au2 au3 等被损坏了很多信息
[grid@test ~]$ kfed repair /dev/sdd aus=1M
KFED-00320: invalid block num1 = [254], num2 = [1], error = [endian_kfbh]
修复报上述错误
for (( j=0; j select name,path,state,HEADER_STATUS from v$asm_disk;
NAME PATH STATE HEADER_STATU
---------------------------------------- ------------------------------------------------------------ -------- ------------
/dev/asmdisk/asm-disk1 NORMAL MEMBER
DATA1 AFD:DATA1 NORMAL MEMBER
TT_0000 /dev/asmdisk/asm-disk2 NORMAL MEMBER
[root@test rules.d]# fdisk /dev/sdd
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xe7340cc0.
Command (m for help): p
Disk /dev/sdd: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xe7340cc0
Device Boot Start End Blocks Id System
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-10485759, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-10485759, default 10485759):
Using default value 10485759
Partition 1 of type Linux and of size 5 GiB is set
Command (m for help): p
Disk /dev/sdd: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xe7340cc0
Device Boot Start End Blocks Id System
/dev/sdd1 2048 10485759 5241856 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@test rules.d]# mkfs.xfs /dev/sdd1
meta-data=/dev/sdd1 isize=512 agcount=4, agsize=327616 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=1310464, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
分区格式化后:
[grid@test ~]$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 80G 0 disk
?sda1 8:1 0 1G 0 part /boot
?sda2 8:2 0 79G 0 part
?rhel-root 253:0 0 50G 0 lvm /
?rhel-swap 253:1 0 3.9G 0 lvm [SWAP]
?rhel-home 253:2 0 25.1G 0 lvm /home
sdb 8:16 0 20G 0 disk
sdc 8:32 0 2G 0 disk
sdd 8:48 0 5G 0 disk
?sdd1 8:49 0 5G 0 part
sr0 11:0 1 1024M 0 rom
loop0 7:0 0 4.3G 0 loop /mnt
SQL> select name,path,state,HEADER_STATUS from v$asm_disk;
NAME PATH STATE HEADER_STATU
---------------------------------------- ------------------------------------------------------------ -------- ------------
/dev/asmdisk/asm-disk1 NORMAL MEMBER
/dev/asmdisk/asm-disk2 NORMAL CANDIDATE
DATA1 AFD:DATA1 NORMAL MEMBER
查询损坏情况:
kfbh.type: 0 ; 0x002: KFBTYP_INVALID
i=0,j=0
kfbh.type: 2 ; 0x002: KFBTYP_FREESPC
i=1,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
i=2,j=0
kfbh.type: 3 ; 0x002: KFBTYP_ALLOCTBL
i=255,j=0
kfbh.type: 83 ; 0x002: *** Unknown Enum ***
i=0,j=1
kfbh.type: 51 ; 0x002: *** Unknown Enum ***
i=1,j=1
kfbh.type: 51 ; 0x002: *** Unknown Enum ***
i=2,j=1
kfbh.type: 66 ; 0x002: *** Unknown Enum ***
i=3,j=1
kfbh.type: 83 ; 0x002: *** Unknown Enum ***
i=0,j=1
kfbh.type: 51 ; 0x002: *** Unknown Enum ***
i=1,j=1
kfbh.type: 51 ; 0x002: *** Unknown Enum ***
i=2,j=1
kfbh.type: 66 ; 0x002: *** Unknown Enum ***
i=3,j=1
kfbh.type: 0 ; 0x002: KFBTYP_INVALID
i=4,j=1
kfbh.type: 0 ; 0x002: KFBTYP_INVALID
其他au问题不大,测试恢复
[grid@test ~]$ kfed repair /dev/sdd aus=1M
不报错,但是mount磁盘报错
SQL> alter diskgroup TT mount;
alter diskgroup TT mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15017: diskgroup "TT" cannot be mounted
ORA-15040: diskgroup is incomplete