免费注册 查看新帖 |

Chinaunix

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

Performing maintenance when booted from cdrom [复制链接]

论坛徽章:
2
双鱼座
日期:2014-02-23 12:10:03操作系统版块每日发帖之星
日期:2015-12-17 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-03-18 20:46 |只看该作者 |倒序浏览

Introduction
If the system has to be booted from a cdrom or from the network ("boot cdrom" or "boot net") in order to perform maintenance, the operator needs to adjust for the existence of a mirrored operating system. Because these alternate boot devices do not include the drivers necessary for disksuite, they cannot be used to operate on state database replicas and Disksuite metadevices. This raises subtle issues addressed below.
Typically, the administrator is often under pressure while performing these types of maintenance. Because simple mistakes at this stage can render the system unusable, it is important that the process be well documented and tested prior to using it in production. Fortunately, this process is simpler than that for Veritas volume manager because there are no "de-encapsulation" issues to address.
Booting from cdrom with DiskSuite mirrored devices
In the example below, the server pegasus has two internal disks (c0t0d0 and c0t1d0) under Disksuite control. The operating system is mirrored between the two devices, with slices five and six on each disk employed for state database replicas. Assume that the administrator has forgotten the root password on this server, and needs to boot from cdrom in order to edit the shadow file.

  • Insert the Solaris operating system CD into the cdrom drive and boot from it into single-user mode:
    ok boot cdrom -s
    Initializing Memory
    Rebooting with command: boot cdrom -s
    Boot device: /pci@1f,4000/scsi@3/disk@6,0:f  File and args: -s
    SunOS Release 5.8 Version Generic_108528-07 64-bit
    Copyright 1983-2001 Sun Microsystems, Inc.  All rights reserved.
    Configuring /dev and /devices
    Using RPC Bootparams for network configuration information.
    Skipping interface hme0
    INIT: SINGLE USER MODE
    #

  • Fsck and mount the root disk's "/" partition in order to edit the /etc/shadow file:
    # fsck -y /dev/rdsk/c0t0d0s0
    # mount /dev/dsk/c0t0d0s0 /a

  • Remove the encrypted password from the /a/etc/shadow file:
    # TERM=vt100; export TERM
    # vi /a/etc/shadow
    For example, if the entry for the root user looks like the following:
    root:NqfAn3tWOy2Ro:6445::::::
    Change it so that is looks as follows:
    root::6445::::::

  • Comment out the rootdev entry from the /a/etc/system file:
    # vi /a/etc/system
    For example, change the line:
    rootdev:/pseudo/md@0:0,0,blk
    to
    * rootdev:/pseudo/md@0:0,0,blk

  • Update the /a/etc/vfstab file so that it references simple disk slices instead of disksuite metadevices. Note that you only have to change those enties that correspond to operating system slices.
    For example, one would change the following /a/etc/vfstab file:
    #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/d1      -                  -       swap    -       no      -
    /dev/md/dsk/d0      /dev/md/rdsk/d0    /       ufs     1       no      logging
    /dev/md/dsk/d4      /dev/md/rdsk/d4    /var    ufs     1       no      logging
    swap                -                  /tmp    tmpfs   -       yes     -
    to: #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/c0t0d0s1   -                  -       swap    -       no      -
    /dev/dsk/c0t0d0s0   /dev/rdsk/c0t0d0s0 /       ufs     1       no      logging
    /dev/dsk/c0t0d0s4   /dev/rdsk/c0t0d0s4 /var    ufs     1       no      logging
    swap                -                  /tmp    tmpfs   -       yes     -

  • Unmount the root filesystem, fsck it, and return to the ok prompt:
    # cd /; umount /a; fsck -y /dev/rdsk/c0t0d0s0
    # stop-a
    ok

  • Boot from c0t0d0 into single user mode. It is important to boot just to single user mode so that DiskSuite does not start automatically:
    ok boot -sw

  • When prompted for the root password, just press the ENTER key. Once at the shell prompt, clear the metadevices that referenced the filesystems that you updated in the /a/etc/vfstab file above:
    # metaclear -f -r d0 d1 d4
    Now would be an appropriate time to create a new password for the root account, via the passwd root command

  • Exit from single user mode and continue the boot process.
    # exit
    The system should now boot cleanly, but will now be running on a single disk, and would not survive the failure of that disk. In order to restore operating system redundancy, follow the procedure for
    Mirroring the operating system


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

    本版积分规则 发表回复

      

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

    清除 Cookies - ChinaUnix - Archiver - WAP - TOP