Solaris Volume Manager Administration Guide

Example—Recovering the root (/) RAID 1 (Mirror) Volume

In the following example, root (/) is mirrored with a two-way mirror, d0. The root (/) entry in the /etc/vfstab file has somehow reverted back to the original slice of the file system, but the information in the /etc/system file still shows booting to be from the mirror d0. The most likely reason is that the metaroot command was not used to maintain the /etc/system and /etc/vfstab files, or an old copy of the/etc/vfstab file was copied back.

The incorrect /etc/vfstab file would look something like the following:

#device        device          mount          FS      fsck   mount    mount
#to mount      to fsck         point          type    pass   at boot  options
#
/dev/dsk/c0t3d0s0 /dev/rdsk/c0t3d0s0  /       ufs      1     no       -
/dev/dsk/c0t3d0s1 -                   -       swap     -     no       -
/dev/dsk/c0t3d0s6 /dev/rdsk/c0t3d0s6  /usr    ufs      2     no       -
#
/proc             -                  /proc    proc     -     no       -
swap              -                  /tmp     tmpfs    -     yes      -

Because of the errors, you automatically go into single-user mode when the system is booted:


ok boot
...
configuring network interfaces: hme0.
Hostname: lexicon
mount: /dev/dsk/c0t3d0s0 is not this fstype.
setmnt: Cannot open /etc/mnttab for writing

INIT: Cannot create /var/adm/utmp or /var/adm/utmpx

INIT: failed write of utmpx entry:"  "

INIT: failed write of utmpx entry:"  "

INIT: SINGLE USER MODE

Type Ctrl-d to proceed with normal startup,
(or give root password for system maintenance): <root-password>

At this point, root (/) and /usr are mounted read-only. Follow these steps:

  1. Run the fsck command on the root (/) mirror.


    Note –

    Be careful to use the correct volume for root.



    # fsck /dev/md/rdsk/d0
    ** /dev/md/rdsk/d0
    ** Currently Mounted on /
    ** Phase 1 - Check Blocks and Sizes
    ** Phase 2 - Check Pathnames
    ** Phase 3 - Check Connectivity
    ** Phase 4 - Check Reference Counts
    ** Phase 5 - Check Cyl groups
    2274 files, 11815 used, 10302 free (158 frags, 1268 blocks,
    0.7% fragmentation)
  2. Remount root (/) read/write so you can edit the /etc/vfstab file.


    # mount -o rw,remount /dev/md/dsk/d0 /
    mount: warning: cannot lock temp file </etc/.mnt.lock>
  3. Run the metaroot command.


    # metaroot d0
    

    This command edits the /etc/system and /etc/vfstab files to specify that the root (/) file system is now on volume d0.

  4. Verify that the /etc/vfstab file contains the correct volume entries.

    The root (/) entry in the /etc/vfstab file should appear as follows so that the entry for the file system correctly references the RAID 1 volume:

    #device           device              mount    FS      fsck   mount   mount
    #to mount         to fsck             point    type    pass   at boot options
    #
    /dev/md/dsk/d0    /dev/md/rdsk/d0     /        ufs     1      no      -
    /dev/dsk/c0t3d0s1 -                   -        swap    -      no      -
    /dev/dsk/c0t3d0s6 /dev/rdsk/c0t3d0s6  /usr     ufs     2      no      -
    #
    /proc             -                  /proc     proc    -      no      -
    swap              -                  /tmp      tmpfs   -      yes     -
  5. Reboot the system.

    The system returns to normal operation.