免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1854 | 回复: 0
打印 上一主题 下一主题

How to backup and how to restore Solstice DiskSuit [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-10-19 21:14 |只看该作者 |倒序浏览
How to backup and how to restore Solstice DiskSuit
Description

Solstice DiskSuite[TM] (SDS) is Sun's volume management software, that can be used to configure software RAID devices. This document provides information on what to backup to save SDS's configuration, and, in the event of a disaster, how to use that information to restore the SDS configuration.
NOTE: This information has been based on SDS 4.2.1. In other versions of the software, the information may differ.
Document Body

There are a number of different aspects to SDS's configuration :
CONFIGURATION INFORMATION
WHERE THIS INFORMATION IS RECORDED

location of metadb
/etc/system and /etc/lvm/mddb.cf
local metadevice configuration
metadb and /etc/lvm/md.cf
metaset's name, hosts, and disks
metadb
metaset's metadevice configuration
metaset's disks' private slice
When a system boots, DiskSuite first needs to determine the location of the metadb. This information is saved on the root disk in /etc/system and /etc/lvm/mddb.cf, e.g. :
/etc/system:
set md:mddb_bootlist1="dad:7:16 dad:7:1050 dad:7:2084"
/etc/lvm/mddb.cf:
#metadevice database location file do not hand edit
#driver minor_t daddr_t checksum
dad 7 16 -278
dad 7 1050 -1312
dad 7 2084 -2346
Once the metadb have been located, they can be accessed to determine the configuration of any local metadevice.
The metadb also contain basic information on any metasets configured. This includes the metaset's name, the names of hosts that can access that metaset, and the disks used within that metaset.
When a disk is added to a metaset, SDS will initialise the disk's VTOC (partition information). The following SunSolve document has more information on this :
Document ID:14861 Title:Solstice DiskSuite[TM] - disks added to diskset get repartitioned automatically
The 'private' slice 7 contains the configuration information for the metadevices created within that metaset.
Different commands change different parts of the configuration :
·  metadb : will change /etc/system and /etc/lvm/mddb.cf. When adding a new metadb, it will also copy all the metadb information into the new metadb.
·  metainit, metareplace, metaclear : will change the configuration information for a metadevice in all of the metadb, and also update /etc/lvm/md.cf accordingly.
·  metaset -s  -a -h  : will update all of the metadb
·  metastat -s  -a  : will repartition the disk, and copy all of the metaset's metadevice configuration into the 'private' region (slice 7)
·  metainit, metareplace, metaclear -s  ... : will change the configuration information for the metaset's metadevice in the 'private' region (slice 7) only
WHAT TO BACKUP :
·  files
/etc/system, /etc/lvm/mddb.cf, /etc/lvm/md.cf
·  metadb raw devices
use dd to backup one of the slices listed in 'metadb'
example:
dd if=/dev/rdsk/c0t0d0s7 of=/opt/sun/sdsbackup/metadb.c0t0d0s7.dd bs=2048k
·  command outputs
“metaset” for disks list in the metaset.
"metastat -p" and "metastat –p -s " for each metaset
HOW TO RECOVER :
·  Recovering /etc/system or /etc/lvm/mddb.cf
If there is a problem with the metadb information in /etc/system ,add the line into /etc/system based on /etc/lvm/mddb.cf.
For example:
/etc/lvm/mddb.cf:
#metadevice database location file do not hand edit
#driver minor_t daddr_t checksum
dad 7 16 -278
dad 7 1050 -1312
dad 7 2084 -2346
Then, you can add the line into /etc/system:
set md:mddb_bootlist1="dad:7:16 dad:7:1050 dad:7:2084"
If there is a problem with /etc/lvm/mddb.cf or both files, they will need to be restored from backup.
·  Recovering metadb
In the event that all copies of the metadb have a problem, use dd to restore the dd backup.
Example:
dd if= /opt/sun/sdsbackup/metadb.c0t0d0s7.dd of=/dev/rdsk/c0t0d0s7 bs=2048k
Alternatively, initialise an empty metadb, and recreate all the local metadevices manually.
·  Recover metadevice configuration.
When metadevice configuration lost, the recover steps should keep in high careful, this may cause data lost. And all recover steps should based on original backup of /etc/lvm/md.cf file or metastat –p’s output.
Example:
# more md.cf (from backup)
# metadevice configuration file
# do not hand edit
d20 -m d21 d22 1
d21 1 1 c0t0d0s1
d22 1 1 c0t1d0s1
d81 -r c2t16d0s2 c2t17d0s2 c2t18d0s2 c2t19d0s2 c2t20d0s2 -i 32b
Recover d20 steps:
# metainit d21 1 1 c0t0d0s1
# metainit d22 1 1 c0t1d0s1
# metainit d20 –m d21
and confirm d20 data correct, if no problem do following:
# metattach d20 d22
If d20 data not ok, then try the other half mirror:
# metaclear d20
# metainit d20 –m d22
and test d20 data again, if confirm data ok:
# metattach d20 d21
Recover d81 (Radi 5)steps:
# metainit d81 –r -k c2t16d0s2 c2t17d0s2 c2t18d0s2 c2t19d0s2 c2t20d0s2 -i 32b
For metaset example:
# metastat –s testset –p (from backup)
d10 -m d11 d12 1
d11 1 1 c0t0d0s0
d12 1 1 c0t1d0s0
Recover d10:
# metainit –s testset d11 1 1 c0t0d0s0
# metainit –s testset d12 1 1 c0t1d0s0
# metainit –s testset d10 –m d11
confirm d10’s data, follow the d20 recover steps.
Important :
1.RAID5 metadevices should be recreated using the metainit "-k" option so that it does not re-initialize the data.
2.Mirror metadevices should be recreated with only one submirror, and once the data is confirmed to be ok, the second submirror can be metattach'ed
·  Recovering metasets
If only one disk in a metaset fails, delete and re-add the disk into the metaset. This will re-initialise the 'private' slice, and copy the metaset's . Then use metareplace to recover any affected metadevices.
If the whole metaset is lost, re-initialise the disks into an empty metaset, and recreate all the metaset's metadevices manually. There is no equivalent of /etc/lvm/md.cf for metasets, so this requires that the output from "metastat -s  -p" has been saved from before the failure.
Important :
1.RAID5 metadevices should be recreated using the metainit "-k" option so that it does not re-initialize the data.
2.Mirror metadevices should be recreated with only one submirror, and once the data is confirmed to be ok, the second submirror can be metattach'ed
·  Recover soft partition
Because soft partition just separate metadevice into little ones, but not cause any data init, just backup all soft partition make command, and after recover the non-softpartition metadevice and use the same commands to recover the soft partitions.



本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/14235/showart_187494.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP