免费注册 查看新帖 |

Chinaunix

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

(原创) 利用lucreate克隆V880的系统盘详细过程 [复制链接]

论坛徽章:
2
IT运维版块每日发帖之星
日期:2016-03-19 06:20:00数据库技术版块每日发帖之星
日期:2016-07-05 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-06-20 16:43 |只看该作者 |倒序浏览
今天有同事重装了V880+S10,重新克隆了系统盘,建议先升级OS kernel patch到最新版本.

1、将目标盘的分区信息设置与原系统一样(目标c0t1d0s2);

root@v880-2 # prtvtoc /dev/rdsk/c0t0d0s2 |fmthard -s - /dev/rdsk/c0t1d0s2

2、执行复制

root@v880-2 # lucreate -c S10_org -m /:/dev/dsk/c0t1d0s0:ufs -m -:/dev/dsk/c0t1d0s1:swap  \
root@v880-2 >-m /globaldevices:/dev/dsk/c0t1d0s5:ufs \
root@v880-2 > -n BE_new

解释:m 是mountpoint 具体看man lucreate
      

3、查看复制是否完整

root@v880-2 # lustatus
Boot Environment           Is       Active Active    Can    Copy      
Name                       Complete Now    On Reboot Delete Status   
-------------------------- -------- ------ --------- ------ ----------
S10_org                    yes      yes    yes       no     -         
BE_new                     yes      no     no        yes    -         

检查Is Complete列下的目标盘项是不是为yes,如不是则表明复制没有完成或不完整,其它项请查看man lustatus


4、激活目标盘,测试是否可以启动

root@v880-2 # luactivate BE_new


**********************************************************************

The target boot environment has been activated. It will be used when you
reboot. NOTE: You MUST NOT USE the reboot, halt, or uadmin commands. You
MUST USE either the init or the shutdown command when you reboot. If you
do not use either init or shutdown, the system will not boot using the
target BE.

**********************************************************************

In case of a failure while booting to the target BE, the following process
needs to be followed to fallback to the currently working boot environment:

1. Enter the PROM monitor (ok prompt).

2. Change the boot device back to the original boot environment by typing:

     setenv boot-device
/pci@8,600000/SUNW,qlc@2/fp@0,0/disk@w21000000876c1c54,0:a

3. Boot to the original boot environment by typing:

     boot

**********************************************************************

Activation of boot environment <BE_new> successful.


5、用命令启动服务器(注意不能用reboot, halt, or uadmin命令重启)

  root@v880-2 # init 6

6、检查是否从目标盘启动(与format输出比较)

root@v880-2 # prtpicl -v |grep bootpath

以上步骤在V880上操作成功完成.

论坛徽章:
2
双鱼座
日期:2014-02-23 12:10:03操作系统版块每日发帖之星
日期:2015-12-17 06:20:00
2 [报告]
发表于 2007-06-20 17:21 |只看该作者
不错,收藏先。。。。。

论坛徽章:
0
3 [报告]
发表于 2007-06-20 19:47 |只看该作者
It is easy to create a new boot environment, but the BEs are not esay to use
if you customer is not familiar with Solaris Live Upgrade.

If there is something wrong with the two BEs, you could be unable to
activate the alternate BE or to repair them. In that case, you might want to remove
all BEs and make the system back to the original status.

However, I have not seen a Sun doc on how to remove a primary BE from Solaris.

[ 本帖最后由 susbin 于 2007-6-20 21:27 编辑 ]

论坛徽章:
2
IT运维版块每日发帖之星
日期:2016-03-19 06:20:00数据库技术版块每日发帖之星
日期:2016-07-05 06:20:00
4 [报告]
发表于 2007-06-21 09:15 |只看该作者
在这里我的想法是克隆一个系统盘.尤其光纤硬盘.当然想使用live upgrade,则需要做更多的准备,包括升级到什么版本,该升级哪些包等.
当做完升级或想做的事后,用luactivate激活目标盘后,然后用init ot shutdown重启机器,即实现了用目标启动.
当想回到原来的启动环境时,其实在用luactivate时屏幕有提示如下:
*********************************************************************

The target boot environment has been activated. It will be used when you
reboot. NOTE: You MUST NOT USE the reboot, halt, or uadmin commands. You
MUST USE either the init or the shutdown command when you reboot. If you
do not use either init or shutdown, the system will not boot using the
target BE.

**********************************************************************

In case of a failure while booting to the target BE, the following process
needs to be followed to fallback to the currently working boot environment:

1. Enter the PROM monitor (ok prompt).

2. Change the boot device back to the original boot environment by typing:

     setenv boot-device
/pci@8,600000/SUNW,qlc@2/fp@0,0/disk@w21000000876c1c54,0:a

3. Boot to the original boot environment by typing:

     boot

**********************************************************************

或者从目标启动后,运行luactivate命令重新激活原来的系统盘,用命令init or shutdown即可恢复到原来的系统盘.

每次成功创建了一个BE后,在/etc/lutab将增加一行,当觉得不想要时,个人觉得可以简单地移除这个文件就行了.

个人认为对于简单地复制系统盘来说操作还是非常简单的.也不需要安装额外的软件包,复制完后也不需要做任何配置文件的修改,在需要时在ok 修改一下boot-device的路径,或者直接boot diskx就行了.

[ 本帖最后由 bencyber 于 2007-6-21 09:30 编辑 ]

论坛徽章:
0
5 [报告]
发表于 2007-06-21 09:24 |只看该作者
不错,好东西

论坛徽章:
0
6 [报告]
发表于 2007-06-21 09:37 |只看该作者
速度快不快? 跟 DD \ SDS \ flarcreate 相比速度怎样?

论坛徽章:
0
7 [报告]
发表于 2007-06-23 09:20 |只看该作者
"每次成功创建了一个BE后,在/etc/lutab将增加一行,当觉得不想要时,个人觉得可以简单地移除这个文件就行了."

我原来也是像楼主这么想的,可是看到 /etc/lu 下被 lucreate 新建的这些文件,就觉得不是那么简单了。

# pwd
/etc/lu
# ls -l | grep Jun
-rw-r--r--   1 root     other        417 Jun  4 13:02 ICF.1
-rw-r--r--   1 root     other        448 Jun  4 13:12 ICF.2
drwxr-xr-x   2 root     sys          512 Jun  4 13:09 compare
-rw-r--r--   1 root     other       1761 Jun  4 13:02 ludb.global.xml
-rw-r--r--   1 root     other        286 Jun  4 13:12 ludb.local.xml
drwxr-xr-x   2 root     sys          512 Jun  4 13:02 tmp
-rw-r--r--   1 root     other        136 Jun  4 13:12 vtoc.1
-rw-r--r--   1 root     other        136 Jun  4 13:12 vtoc.2
#

论坛徽章:
0
8 [报告]
发表于 2007-06-25 11:15 |只看该作者
呵呵 努力,各位老大继续研究~

论坛徽章:
2
IT运维版块每日发帖之星
日期:2016-03-19 06:20:00数据库技术版块每日发帖之星
日期:2016-07-05 06:20:00
9 [报告]
发表于 2007-06-26 09:41 |只看该作者
原帖由 susbin 于 2007-6-23 09:20 发表
"每次成功创建了一个BE后,在/etc/lutab将增加一行,当觉得不想要时,个人觉得可以简单地移除这个文件就行了."

我原来也是像楼主这么想的,可是看到 /etc/lu 下被 lucreate 新建的这些文件,就觉得不是 ...

你非常仔细,看得挺认真!

不过在这里,我想的就是复制系统盘,那些文件的内容也是关于这个硬盘的分区信息,还是校验信息,以及在升级过程中需要读取的内容.如果就是单一复制系统盘,我还是坚持我的看法.

这个命令的目的主要是用于live升级OS.这不过是其中的一种用法.

论坛徽章:
0
10 [报告]
发表于 2007-06-29 04:24 |只看该作者
前天掉电,一个 V250 出问题,刚好用来做个实验:

从CD 启动, 用备用盘替换坏掉的系统盘 (c0t0d0s0), 拆除镜像,再做两处改动:

# mv /a/etc/lutab /a/etc/lutab-saved
# mv /a/etc/lu /a/etc/lu-saved
# reboot
...

系统可以正常启动。

# lustatus
ERROR: No boot environments are configured on this system
ERROR: cannot determine list of all boot environment names
#

# cd /etc
# mv lutab-saved lutab
# mv lu-saved lu
#
# lustatus
Boot Environment           Is       Active Active    Can    Copy      
Name                       Complete Now    On Reboot Delete Status   
-------------------------- -------- ------ --------- ------ ----------
d0_0518                    yes      yes    yes       no     -         
t10s3_0604                 yes      no     no        yes    -         
#

# lufslist t10s3_0604
               boot environment name: t10s3_0604

Filesystem              fstype    device size Mounted on          Mount Options
----------------------- -------- ------------ ------------------- --------------
/dev/md/dsk/d3          swap                ? -                   -
/dev/dsk/c0t10d0s3      ufs       18339594240 /                   logging
/dev/md/dsk/d6          ufs       18339594240 /usr/local          logging
/dev/md/dsk/d9          ufs       18339594240 /web.logs           logging
/dev/dsk/c0t1d0s1       ufs       18339594240 /backup           logging
/dev/dsk/c0t1d0s3       ufs       18339594240 /u01                logging
/dev/dsk/c0t2d0s1       ufs       18339594240 /u03                logging
/dev/dsk/c0t2d0s3       ufs       18339594240 /system.bak         logging
/dev/dsk/c0t9d0s1       ufs       18339594240 /access.logs        logging
#
# lufslist d0_0518
ERROR: mount: No such device or address
mount: Cannot open /dev/md/dsk/d0ERROR: cannot mount mount point </.alt.tmp.b-Ntb.mnt> device </dev/md/dsk/d0>
ERROR: cannot mount root device </dev/md/dsk/d0> to mount point </.alt.tmp.b-Ntb.mnt> for boot environment <d0_0518>
ERROR: cannot determine file system configuration for boot environment <d0_0518>
ERROR: cannot determine file system list of boot environment <d0_0518>
#

# mv lutab lutab-saved
# mv lu lu-saved
#
# lustatus
ERROR: No boot environments are configured on this system
ERROR: cannot determine list of all boot environment names
#
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP