Solaris Volume Manager 管理指南

Procedure如何恢复软分区的配置数据

在每个软分区扩展盘区的开头,有一个用于标记软分区扩展盘区的开头的扇区。这些隐藏的扇区称为分区扩展表头。软分区的用户看不到这些标头。如果所有的 Solaris Volume Manager 配置数据已丢失,则可以对磁盘进行扫描以尝试生成配置数据。

不到万不得已,不要使用此过程来恢复所丢失的软分区配置信息。只有当 metadbmd.cf 文件均丢失,而且 md.tab 文件已过时或者已丢失时,才应当使用 metarecover 命令。


注 –

此过程仅适用于恢复软分区信息,而不适用于从丢失其他配置中进行恢复或者恢复其他 Solaris Volume Manager 卷的配置信息。



注 –

如果配置中包括在软分区之上构建的其他 Solaris Volume Manager 卷,则应当在尝试恢复其他卷之前恢复软分区。


有关软分区的配置信息存储在设备上和状态数据库中。由于这两个源都有可能会损坏,因此必须向 metarecover 命令指示哪个源可靠。

首先,使用 metarecover 命令来确定这两个源是否一致。如果它们一致,就不能使用 metarecover 命令进行任何更改。但是,如果 metarecover 命令报告存在不一致,则必须认真检查它的输出,以确定磁盘或状态数据库是否已经损坏。然后,应当使用 metarecover 命令来基于适当的源重新构建配置。

  1. 请阅读软分区的配置指南

  2. 使用 metarecover 命令检查软分区的恢复信息。


    # metarecover component-p -d 
    
    component

    指定原始组件的 cntndnsn 名称

    -p

    指定要重新生成软分区

    -d

    指定要扫描软分区上分区扩展表头的物理片


示例 25–2 从磁盘上的分区扩展表头中恢复软分区


# metarecover c1t1d0s1 -p -d

The following soft partitions were found and will be added to

your metadevice configuration.

 Name            Size     No. of Extents

    d10           10240         1

    d11           10240         1

    d12           10240         1

# metarecover c1t1d0s1 -p -d

The following soft partitions were found and will be added to

your metadevice configuration.

 Name            Size     No. of Extents

    d10           10240         1

    d11           10240         1

    d12           10240         1

WARNING: You are about to add one or more soft partition

metadevices to your metadevice configuration.  If there

appears to be an error in the soft partition(s) displayed

above, do NOT proceed with this recovery operation.

Are you sure you want to do this (yes/no)?yes

c1t1d0s1: Soft Partitions recovered from device.

bash-2.05# metastat

d10: Soft Partition

    Device: c1t1d0s1

    State: Okay

    Size: 10240 blocks

        Device              Start Block  Dbase Reloc

        c1t1d0s1                   0     No    Yes



        Extent              Start Block              Block count

             0                        1                    10240



d11: Soft Partition

    Device: c1t1d0s1

    State: Okay

    Size: 10240 blocks

        Device              Start Block  Dbase Reloc

        c1t1d0s1                   0     No    Yes



        Extent              Start Block              Block count

             0                    10242                    10240



d12: Soft Partition

    Device: c1t1d0s1

    State: Okay

    Size: 10240 blocks

        Device              Start Block  Dbase Reloc

        c1t1d0s1                   0     No    Yes



        Extent              Start Block              Block count

             0                    20483                    10240

在此示例中,在意外删除状态数据库副本之后,从磁盘中恢复三个软分区。