Chinaunix首页 | 论坛 | 博客
  • 博客访问: 375501
  • 博文数量: 78
  • 博客积分: 3274
  • 博客等级: 中校
  • 技术积分: 686
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-06 12:47
文章分类

全部博文(78)

文章存档

2017年(1)

2016年(2)

2015年(2)

2014年(1)

2013年(5)

2012年(22)

2011年(8)

2010年(31)

2009年(6)

分类:

2012-12-05 01:34:53

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.

  1. 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
    #
    
  2. 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

  3. 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::::::
  4. 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

  5. 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     -
    
  6. Unmount the root filesystem, fsck it, and return to the ok prompt:

    # cd /; umount /a; fsck -y /dev/rdsk/c0t0d0s0

    # stop-a
    ok

  7. 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

  8. 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

  9. 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

阅读(479) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~