Chinaunix首页 | 论坛 | 博客
  • 博客访问: 567343
  • 博文数量: 113
  • 博客积分: 3322
  • 博客等级: 少校
  • 技术积分: 1565
  • 用 户 组: 普通用户
  • 注册时间: 2006-01-04 11:38
文章分类

全部博文(113)

文章存档

2012年(21)

2010年(92)

分类:

2010-03-02 10:47:45

以下的信息可以让我们了解如何备份VXVM在所有磁盘在私有分区上的配置信

息和其他有关用于在丢失配置信息或者其他错误的时候的一些恢复信息。

分别把下面命令的输出保存到各自相应的文件中,便于以后恢复时使用。:

1.  # vxdisk list     (这个命令包含了da (比如c0t0d0)和dm (比如 disk01) 之

间记录的对应关系)

2.  # vxdisk -q list | awk '{print $1}' | xargs vxdisk list     (这个包含了任何

一个磁盘的详细信息。)

3.        # vxdisk -q list | awk '{if ($2 != "simple") print "/dev/rdsk/"$1}' | xargs
prtvtoc     (这个输出显示了任何一个磁盘上的VTOC )

对于磁盘组中的任何磁盘需要做下面的工作。如果VXVM的版本是3.x 及其以

后的版本(4.X不需要这样操作可以直接通过vxconfigbackupd来自动执行,

也可以通过 vxconfigbackup手工执行)执行4b,其他的则执行4a

4a. # vxprint -g disk_group_name -hmvps   (这个包含了指定磁盘组包含的

所有的卷,plex,和子磁盘的详细信息。)

4b. # vxprint -g disk_group_name -rhmvps  (这个包含了指定磁盘组包含的

所有的卷,plex,和子磁盘的详细信息。)

(注vxprint参数的含义:

-v
Display only volumes for display. This restricts the records matched with search patterns. Also, the default selection of all records in the database is then restricted to all volumes. If a name operand names a plex or subdisk, then a diagnostic is written to the standard error.

-p
Display only plexes.

-s
Display only subdisks.

-h
List complete hierarchies below selected records. For volumes, this list includes all associated plexes and subdisks. For plexes, this list includes all associated subdisks. Hierarchies are separated in the output by a blank line. Each object listed occupies its own line. The order of output is a volume name, followed by one associated plex, followed by all of the subdisks for that plex, followed by another associated plex, followed by all of the subdisks for the second plex, and so on.

-m
Display all information about each selected record in a format that is useful as input to both the vxmake utility and to awk(1) scripts. The format used is the vxmake description format. In addition to record information, the list of plex or subdisk records associated with selected volume or plex records is displayed. Each field is output on a separate line, indented by a single tab. Values for fields that contain comment-style strings are always preceded by one double-quote character.



理想的情况是在每次备份库修改以后都备份以上的输出信息。对于备份并不需要

设置cron这样的工作。

看下面的例子, (VxVM 2.x):

# vxdisk list > vxdisk_list

# vxdisk -q list | awk '{print $1}' | xargs vxdisk list > vxdisk_list_detail

# vxdisk -q list | awk '{if ($2 != "simple") print "/dev/rdsk/"$1}' | xargs prtvtoc > prtvtoc_all_disk

# vxprint -g datadg -hmvps > vxprint_datadg_config


下面的这个例子, (VxVM 3.x):


# vxdisk list > vxdisk_list

# vxdisk -q list | awk '{print $1}' | xargs vxdisk list > vxdisk_list_detail

# vxdisk -q list | awk '{if ($2 != "simple") print "/dev/rdsk/"$1}' | xargs prtvtoc > prtvtoc_all_disk

# vxprint -g datadg -rhmvps > vxprint_datadg_config

在一些非rootdg磁盘组的配置库出现故障或者错误的时候,(比如:所有的import

磁盘组时出错误)这就要求你重新建立磁盘组的全部配置库,通过这些输出信息

可以重新建立磁盘组。(注意如果想要磁盘组可以import步骤1并不是必须的)


1.        根据vxdisk list的输出信息重新初始化(或者重建)磁盘组。要去定设备名

(设备访问名(da)和设备逻辑名(dm))的对应关系于vxdisk list输出完全一致。

# vxdg init disk_group_name  dm_name_1=da_name_1  dm_name_2=da_name_2  ...

例如,

# vxdg init datadg d1=c1t1d1 d2=c1t1d2 ...

对于磁盘组中有大量磁盘的使用:

# vxdg init datadg `awk '{if ($4 == "datadg") print $3"="$1}' vxdisk_list`

对于这个步骤有些多样的情况需要注意。例如,如果2个da的名字(比如:c1t1d1

和c1t1d2)对应的map发生交换则如果da名字和dm名字对应并没有升级,

所以vxdisk list的输出有可能导致潜在的风险。在这里如果磁盘的私有分区并没

有删除或者损毁,则详细的vxdisk list输出是很有帮助的。磁盘ID能够从任何

一个磁盘的磁盘私有分区上获得。(比如vxdisk list  c1t1d1 和c1t1d2)同时
也能够用于对比vxdisk list输出的保留信息,因此,更加便于恢复的正确性。

如果这个步骤并没有成功,或者在这里有一些信息值得怀疑,需要找客户支持中

心了,因为重新初始化磁盘,需要十分注意和小心。I

2. 如果步骤1成功了,则可以使用vxprint命令的输出来执行vxmake了。 I

# vxmake -g disk_group_name -d config_file_name

例如,

# vxmake -g datadg -d vxprint_datadg_config

这里就是恢复磁盘组的原始配置了。

3. 如果步骤2成功了,这可以启动所有的卷了。 vxvol -g disk_group_name

startall 或者启动一个单一的卷 vxvol -g disk_group_name start

volume_name. 现在这个时候需要检查卷上的数据是否正确。如果卷是文件系

统在mount文件系统前使用fsck检查文件系统。如果卷上的数据是非文件系统

使用一个合适的方法来检查数据的完整性。比如:oracle的裸卷要在数据库中检

查数据的合适性。

一般的配置发生改变是由于卷管理的设备发生属性或者状态的改变,这个包括磁

盘组,卷,plex,子磁盘等等。(比如:在磁盘组中增加或者删除磁盘,改变卷

的大小等等)
阅读(997) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~