Solaris10创建本地盘镜像

镜像规划

镜像名源盘子镜像名源盘分区名镜像盘子镜像名镜像盘分区名挂载点
d10d11c1t0d0s0d12c1t1d0s0/
d20d21c1t0d0s1d22c1t1d0s1swap

state database replica存放在两块盘的slice 7上。

1. 将源盘分区表同步到镜像盘上

root@node1:/ #> prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2

2. 创建metadb数据库,分别存放在两块盘的slice7上

root@node1:/ #> metadb -a -c 3 -f c1t0d0s7 c1t1d0s7

root@node1:/ #> metadb -i
        flags           first blk       block count
     a        u         16              8192            /dev/dsk/c1t0d0s7
     a        u         8208            8192            /dev/dsk/c1t0d0s7
     a        u         16400           8192            /dev/dsk/c1t0d0s7
     a        u         16              8192            /dev/dsk/c1t1d0s7
     a        u         8208            8192            /dev/dsk/c1t1d0s7
     a        u         16400           8192            /dev/dsk/c1t1d0s7
r - replica does not have device relocation information
o - replica active prior to last mddb configuration change
u - replica is up to date
l - locator for this replica was read successfully
c - replica's location was in /etc/lvm/mddb.cf
p - replica's location was patched in kernel
m - replica is master, this is replica selected as input
W - replica has device write errors
a - replica is active, commits are occurring to this replica
M - replica had problem with master blocks
D - replica had problem with data blocks
F - replica had format problems
S - replica is too small to hold current data base
R - replica had device read errors

3. 创建root分区的子镜像

root@node1:/ #> metainit -f d11 1 1 c1t0d0s0
d11: Concat/Stripe is setup
root@node1:/ #> metainit -f d12 1 1 c1t1d0s0
d12: Concat/Stripe is setup

4. 创建root分区镜像

root@node1:/ #> metainit d10 -m d11
d10: Mirror is setup

5. 执行metaroot修改vfstab记录

root@node1:/ #> metaroot d10

root@node1:/ #> more /etc/vfstab
#device         device          mount           FS      fsck    mount   mount
#to mount       to fsck         point           type    pass    at boot options
#
fd      -       /dev/fd fd      -       no      -
/proc   -       /proc   proc    -       no      -
/dev/dsk/c1t0d0s1       -       -       swap    -       no      -
/dev/md/dsk/d10 /dev/md/rdsk/d10        /       ufs     1       no      -
/devices        -       /devices        devfs   -       no      -
ctfs    -       /system/contract        ctfs    -       no      -
objfs   -       /system/object  objfs   -       no      -
swap    -       /tmp    tmpfs   -       yes     -
root@node1:/ #>

6. 重启系统

root@node1:/ #> shutdown -i6 -g0 -y

Shutdown started.    Wed Nov 23 15:34:19 CST 2011

Changing to init state 6 - please wait
Broadcast Message from root (pts/1) on node1 Wed Nov 23 15:34:19...
THE SYSTEM node1 IS BEING SHUT DOWN NOW ! ! !
Log off now or risk your files being damaged

7. 创建swap的子镜像和镜像

root@node1:/ #> metainit -f d21 1 1 c1t0d0s1
d21: Concat/Stripe is setup
root@node1:/ #> metainit -f d22 1 1 c1t1d0s1
d22: Concat/Stripe is setup
root@node1:/ #> metainit d20 -m d21
d20: Mirror is setup

8. 手工修改vfstab文件

修改前:

root@node1:/ #> more /etc/vfstab
#device         device          mount           FS      fsck    mount   mount
#to mount       to fsck         point           type    pass    at boot options
#
fd      -       /dev/fd fd      -       no      -
/proc   -       /proc   proc    -       no      -
/dev/dsk/c1t0d0s1       -       -       swap    -       no      -
/dev/md/dsk/d10 /dev/md/rdsk/d10        /       ufs     1       no      -
/devices        -       /devices        devfs   -       no      -
ctfs    -       /system/contract        ctfs    -       no      -
objfs   -       /system/object  objfs   -       no      -
swap    -       /tmp    tmpfs   -       yes     -

修改后:

root@node1:/ #> more /etc/vfstab
#device         device          mount           FS      fsck    mount   mount
#to mount       to fsck         point           type    pass    at boot options
#
fd      -       /dev/fd fd      -       no      -
/proc   -       /proc   proc    -       no      -
/dev/md/dsk/d20       -       -       swap    -       no      -
/dev/md/dsk/d10 /dev/md/rdsk/d10        /       ufs     1       no      -
/devices        -       /devices        devfs   -       no      -
ctfs    -       /system/contract        ctfs    -       no      -
objfs   -       /system/object  objfs   -       no      -
swap    -       /tmp    tmpfs   -       yes     -

9. 重启系统

root@node1:/ #> shutdown -i6 -g0 -y

Shutdown started.    Wed Nov 23 15:34:19 CST 2011

Changing to init state 6 - please wait
Broadcast Message from root (pts/1) on node1 Wed Nov 23 15:34:19...
THE SYSTEM node1 IS BEING SHUT DOWN NOW ! ! !
Log off now or risk your files being damaged

10. 附加镜像盘所有分区的子镜像

root@node1:/ #> metattach d10 d12

d10: submirror d12 is attached

root@node1:/ #> metattach d20 d22

d20: submirror d22 is attached

同步在后台自动运行。可用metastat检查同步情况

root@node1:/ #> metastat
d20: Mirror
    Submirror 0: d21
      State: Okay
    Submirror 1: d22
      State: Resyncing
    Resync in progress: 69 % done
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 16790400 blocks (8.0 GB)

d21: Submirror of d20
    State: Okay
    Size: 16790400 blocks (8.0 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t0d0s1          0     No            Okay   Yes

d22: Submirror of d20
    State: Resyncing
    Size: 16790400 blocks (8.0 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t1d0s1          0     No            Okay   Yes

d10: Mirror
    Submirror 0: d11
      State: Okay
    Submirror 1: d12
      State: Resyncing
    Resync in progress: 3 % done
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 269684352 blocks (128 GB)

d11: Submirror of d10
    State: Okay
    Size: 269684352 blocks (128 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t0d0s0          0     No            Okay   Yes

d12: Submirror of d10
    State: Resyncing
    Size: 269684352 blocks (128 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t1d0s0          0     No            Okay   Yes

Device Relocation Information:
Device   Reloc  Device ID
c1t1d0   Yes    id1,sd@n5000cca000902554
c1t0d0   Yes    id1,sd@n5000cca0008f8bd8

11. 将set md:mirrored_root_flag = 1加入到/etc/system中。设置此参数可以使SVM启动时忽略Quorum规则,避免当Quorum<=50%时,系统无法启动到多用户模式。(SUN不建议设置此参数)

转载于:https://www.cnblogs.com/cqubityj/archive/2011/11/23/2260540.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值