免费注册 查看新帖 |

Chinaunix

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

如何创建并管理root分区镜像 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-01-20 09:59 |只看该作者 |倒序浏览

如何创建并管理root分区镜像
Solaris的root分区是整个系统的核心部分,因为跟系统运行相关的大部分数据都处于这个分区,如果这个分区被破坏,整个系统将无法正常使用。因此,创建一个root分区的镜像非常重要,本文将重点介绍如何创建并管理root分区的镜像。
首先需要使用命令format->disk->partition来确保附属盘和主盘拥有相同的label。我操作的一台Sparc机器使用以上命令后的输出如下:
format> partition
PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
! - execute , then return
quit
partition> 0
Part Tag Flag Cylinders Size Blocks
0 root wm 259 - 3251 5.82GB (2993/0/0) 12211440
将附属root盘添加到主root盘所在的存储池中。
# zpool attach rpool c1t1d0s0 c2t0d0s0
确保使用installboot来使c2t0d0s0可启动,可以使用zpool status rpool来查看附属盘的状态。
接下来安装启动块:
SPARC# installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c2t0d0s0
x86# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c2t0d0s0
现在就可以来确认是否可以使用附属盘来启动了。
当root池中的一个镜像盘出问题,你可以用一块新盘来替代然后再卸下问题盘,具体步骤如下:
如果你的系统支持热插拔,就可以直接对被破坏的盘进行替换,否则就必须先使系统离线然后将被破坏的盘分离出来。
# zpool offline rpool c1t0d0s0
# cfgadm -c unconfigure c1::dsk/c1t0d0
替换被破坏的盘并重新配置让zfs知道
# cfgadm -c configure c1::dsk/c1t0d0
# zpool replace rpool c1t0d0s0
使配置好的新硬盘处于online状态
# zpool online rpool c1t0d0s0


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

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP