免费注册 查看新帖 |

Chinaunix

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

[求助]两块磁盘作了镜像,现在我想取消镜像怎么办? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-03-16 08:46 |只看该作者 |倒序浏览
我在使用
#metattach d0 d20
之后出现提示:metattach:testserver:d20次镜像太小,不能附加


为什么会出现这样的提示?
怎么解决?


ps:我想把现在的镜像删除,怎么做呀?

论坛徽章:
0
2 [报告]
发表于 2006-03-16 08:52 |只看该作者
metaclear d0

论坛徽章:
0
3 [报告]
发表于 2006-03-16 11:10 |只看该作者
好像不行呀!

论坛徽章:
0
4 [报告]
发表于 2006-03-16 11:25 |只看该作者
-f

metaclear – delete active metadevices and hot spare pools
/usr/sbin/metaclear -h
/usr/sbin/metaclear [-s setname] -a [-f]
/usr/sbin/metaclear component
/usr/sbin/metaclear [-s setname] [-f] metadevice... hot_spare_pool...
/usr/sbin/metaclear [-s setname] -r [-f] metadevice... hot_spare_pool...
/usr/sbin/metaclear [-s setname] -p component
/usr/sbin/metaclear [-s setname] -p metadevice
The metaclear command deletes the specified metadevice or hot_spare_pool., or purges all soft partitions from the designated component. Once a metadevice or hot spare pool is deleted, it must be re-created using metainit before it can be used again.
Any metadevice currently in use (open) cannot be deleted. Root privileges are required for all of the following options except -h.

-a
Deletes all metadevices and configured hot spare pools in the set named by -s, or the local set by default.

-f
Deletes (forcibly) a metadevice that contains a subcomponent in an error state.

-h
Displays usage message.

-p
Deletes (purges) all soft partitions from the specified metadevice or component.

-r
Recursively deletes specified metadevices and hot spare pools, but does not delete metadevices on which others depend.

-s
setname Specifies the name of the diskset on which metaclear will work. Using the -s option causes the command to perform its administrative function within the specified diskset. Without this option, the command performs its function on local metadevices and/or hot spare pools.
metadevice ... Specifies the name(s) of the metadevice(s) to be deleted. component Specifies the c*d*t*s* name(s) of the components containing soft partitions to be deleted. hot_spare_pool ... Specifies the name(s) of the hot spare pools to be deleted in the form hspnnn, where nnn is a number in the range 000-999.

EXAMPLE 1 Deleting Various Devices

The following example deletes a metadevice named d10.
# metaclear /dev/md/dsk/d10

The following example deletes all local metadevices and hot spare pools on the system.
# metaclear -a

The following example deletes a mirror, d20, with an submirror in an error state.
# metaclear -f d20

The following example deletes a hot spare pool, hsp001.
# metaclear hsp001

The following example deletes a soft partition, d23.
# metaclear d23

The following example purges all soft partitions on the slice c2t3d5s2 if those partitions are not being used by other metadevices or are not open.
# metaclear -p c2t3d5s2

The following example purges soft partitions from a metadevice.
# metaclear -p d2
d3: Soft Partition is cleared
d4: Soft Partition is cleared
d5: Soft Partition is cleared
The following exit values are returned:
0 Successful completion.
>0 An error occurred.
See attributes(5) for descriptions of the following attributes:

[ 本帖最后由 wuqing 于 2006-3-16 11:27 编辑 ]

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
5 [报告]
发表于 2006-03-16 13:44 |只看该作者
用metadetach命令先把镜像拆开,然后把/etc/vfstab 中的mount点换成原始分区再重新启动机器就行了。
是否用metaclear清除设置看自己的想法,都没关系,要是以后还想再使用镜像功能,就把镜像拆开就行了,后面的都不用做,要是想彻底点,把亚设备也都清了。

论坛徽章:
71
15-16赛季CBA联赛之同曦
日期:2018-08-23 15:41:42辰龙
日期:2014-08-15 09:07:43狮子座
日期:2014-06-03 13:55:33亥猪
日期:2014-06-02 11:17:08巨蟹座
日期:2014-05-06 10:02:03午马
日期:2014-05-04 08:18:27亥猪
日期:2014-04-29 11:11:32技术图书徽章
日期:2014-04-24 15:51:26技术图书徽章
日期:2014-04-17 11:01:53辰龙
日期:2014-04-15 12:45:46亥猪
日期:2014-04-11 09:06:23射手座
日期:2014-04-01 15:28:10
6 [报告]
发表于 2006-03-16 21:50 |只看该作者
以下是我经过1天呕心沥血,做实验总结出来的成果:
                          解镜像


案例:一台SUN480,两块硬盘c1t0d0s2,c1t1d0s2。文件系统/和/zcbuff用disksuite做了镜像;
c1t0d0s0和c1t1d0s0为/分区,做了镜像d1,c1t0d0s7和c1t1d0s7为/zcbuff,做了镜像d7.

#metastat d7
d7: Mirror
    Submirror 0: d17
      State: Okay
    Submirror 1: d27
      State: Okay
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 20972736 blocks
d17: Submirror of d7
    State: Okay
    Size: 20972736 blocks
    Stripe 0:
        Device              Start Block  Dbase State        Hot Spare
        c1t0d0s7                   0     No    Okay
d27: Submirror of d7
    State: Okay
    Size: 20972736 blocks
    Stripe 0:
        Device              Start Block  Dbase State        Hot Spare
        c1t1d0s7                   0     No    Okay
# metastat d1
d1: Mirror
    Submirror 0: d11
      State: Okay
    Submirror 1: d21
      State: Okay
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 20972736 blocks
d11: Submirror of d1
    State: Okay
    Size: 20972736 blocks
    Stripe 0:
        Device              Start Block  Dbase State        Hot Spare
        c1t0d0s0                   0     No    Okay
d21: Submirror of d1
    State: Okay
    Size: 20972736 blocks
    Stripe 0:
        Device              Start Block  Dbase State        Hot Spare
        c1t1d0s0                   0     No    Okay

以下步骤对镜像D7进行解镜像:
(1)#metadetach d7 d27
d7: submirror d27 is detached
(2)修改vfstab文件
把/dev/md/dsk/d7  /dev/md/rdsk/d7  /zcbuff ufs 2  yes -        改为
/dev/dsk/c1t0d0s7  /dev/rdsk/c1t0d0s7  /zcbuff ufs  2   yes     -
(3)重新启动机器
(4)#metaclear –r d7
  d7: Mirror is cleared
d17: Concat/Stripe is cleared
# metaclear d27
d27: Concat/Stripe is cleared
(5)解镜像成功。
以下步骤对镜像d1进行解镜像:
(1)# metadetach d1 d21
d1: submirror d21 is detached
(2) metaroot /dev/dsk/c1t0d0s0
(3)重新启动机器reboot
(4) # metaclear -r d1
d1: Mirror is cleared
d11: Concat/Stripe is cleared
(5)# metaclear d21
d21: Concat/Stripe is cleared
root@s1 #
解完成

论坛徽章:
0
7 [报告]
发表于 2006-03-16 22:57 |只看该作者

简单的东西

没有重新启动的话就metatool,把所有的景象都删除了就ok哦.(在图形模式下)

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
8 [报告]
发表于 2006-03-17 11:26 |只看该作者
六楼的实践不错,我的帖子忘了说要是拆root的话要运行metaroot的步骤,这个步骤也可以通过修改/etc/system文件中相关步骤来实现
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP