5 Replies Latest reply on Nov 27, 2012 8:58 AM by 907795

    How to Delete and Reset a Lost Root Password on a System With a Mirrored ??

      hi All,

      we are experiencing problem,lost root password on Solaris 10 Sparc T5120, with mirror root,
      and we found the solution from Metalink.oracle.com, has anyone have try this??

      here list capture the file system :

      Filesystem size used avail capacity Mounted on
      */dev/md/dsk/d10 2.0G 349M 1.6G 18% /*
      */dev/md/dsk/d40 9.8G 563M 9.2G 6% /usr*
      */dev/md/dsk/d30 9.8G 1.4G 8.4G 15% /var*
      */dev/md/dsk/d50 7.9G 310M 7.5G 4% /opt*
      */dev/md/dsk/d600 3.8G 4.3M 3.8G 1% /home*
      */dev/md/dsk/d602 471M 20M 404M 5% /app/controlm*
      */dev/md/dsk/d601 471M 251M 173M 60% /app/ctsa*
      */dev/md/dsk/d604 4.9G 1.1G 3.8G 23% /app/oramon*
      */dev/md/dsk/d603 20G 11G 8.2G 58% /app/oracle*
      */dev/md/dsk/d606 39G 10.0G 29G 26% /proj/iprdb01/orafra/iprod01p*

      here the step :
      Solstice DiskSuite[TM] Software: How to Delete and Reset a Lost Root Password on a System With a Mirrored Root Disk [ID 1010755.1]


      Steps to Follow
      How to delete and reset a lost root password on a system with a mirrored root disk.

      1) Insert the Solaris[TM] Operating System CD-ROM into the CD-ROM drive.
      2) Once the CD-ROM is in the drive, perform a stop-a. This brings the system down to the "ok" prompt.
      3) From the "ok" prompt, perform a single-user boot from the Solaris OS CD-ROM.
      ok boot cdrom -s
      4) At the "#" prompt, determine which disk is the system's boot disk (containing the root file system). There are several Oracle architectures and various configurations of systems when it concerns a boot disk. As a general rule, most boot disks are attached to controller 0 (c0). Usually, their SCSI target is
      either 3 (t3) or 0 (t0). However, Oracle machines are very flexible, and the boot disk could be at a different location. If you are not sure which disk is your boot disk, perform the following steps to determine the location of the boot device:

      a) # eeprom boot-device
      The output might appear to be simple, such as "disk" or "disk1" or more complicated, such as a pathname "/iommu/sbus/espdma@4,8400000/...../sd@3,0:a".
      b) Make note of the boot-device. If the boot-device is a pathname, it is beyond the scope of this information to provide the location of the customized boot disk. However, for most configurations,
      finding the customized boot disk is an easy task. The "Format" command shows all available disks:

      Searching for disks...done
      (enter its number): c) Enter d to exit format.

      Now, you will have an idea what disks are on the system. Therefore, if the boot-device is "disk" and format shows "c0t0d0" (on some systems "c0t3d0") then that is the boot device. If boot-device
      shows "disk1" and format shows "c0t1d0," then that is the boot device. If format shows multiple disks, then based on what the "eeprom boot-device" command shows, the system's boot disk would be:
      boot-device format
      disk c0t0d0 or c0t3d0 (machine dependent)
      disk1 c1t0d0
      disk2 c0t2d0
      disk3 c0t3d0 or c0t0d0 (machine dependent)
      and so on ....

      5) Because the system was not brought down gracefully (no root password means having to use the Stop-a keystroke to "crash" the system), you need to run "fsck" to clean the root partition (slice). The fsckalso confirms that you selected the proper slice.

      # fsck /dev/rdsk/c1t0d0s0
      where the X and Y are determined by the previous procedure. It is also possible to have a root partition which is not on slice 0 (s0), but, again, that is not a standard configuration.

      The output of "fsck" looks like this:
      ** /dev/rdsk/c1t0d0s0
      ** last mounted on /
      ** Phase 1 .....
      The second line in the output of "fsck" ("** Last mounted on /") confirms that this is the correct root filesystem partition. Answer "y" to any questions fsck asks. There shouldn't be too many items
      needing repair. If there are, there is a possibility of a corrupted root filesystem. After fsck is finished, mount the root partition:

      # mount /dev/dsk/c1t0d0s0 /a

      Again, X and Y are the same as for the fsck command.

      For example:
      # mount /dev/dsk/c1t0d0s0 /a

      6) From the root prompt, set the proper TERM type command (such as vt100, dtterm, sun, and so on)
      by entering this command:

      # TERM=sun; export TERM

      7) Use the VI text editor to edit the /etc/shadow file:
      # vi /a/etc/shadow

      8) The first line of the /etc/shadow file is the one you want to modify.

      It looks like this:

      9) Delete every character between the first and second colons in the first line of the file. When you finish deleting the characters, the line should look like this:


      10) Press the Escape key, then enter the following to save the file and exit vi:


      11) Use the VI text editor to edit the /etc/system file andremove the "rootdev" line shown below:
      # vi /a/etc/system
      Don't comment out the "rootdev" line. Actually remove it.

      12) In the /a/etc/vfstab file, replace the lines for the system filesystem meta-devices with their underlying partitions. For example, change lines from

      /dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no -
      /dev/dsk/c1t0d0s0 /dev/rdsk/c1t0d0s0 / ufs 1 no -

      ONLY change the lines for root (/) and the filesystems that were affected by the actions you took in step 1 of this procedure. All other metadevices may stay as is in this file.

      13) Unmount root, check the root filesystem, and then stop the system:
      # cd /
      # umount /a
      # fsck /dev/rdsk/c1t0d0s0
      # stop-a

      14) Boot to single-user mode:
      ok boot -sw
      If the system does not boot to single user mode, you might have made a mistake in the previous steps.

      15) Because the root password was cleared in an earlier step, press Return when prompted for the the root password. Once you are in single-user mode, you must clear the metamirrors and all the sub-mirrors for the root filesystem. For example, if root (/) is d0, run the following command:

      # metaclear -f -r d0

      Running the metaclear command not only clears the metamirror but also clears the submirrors that are part of this mirror.

      16) When the metamirror is cleared, continue the boot up to multiuser mode by either pressing CTRL-D or by entering the following:

      # exit

      Now everything should be as it was, except that the system partition is on the underlying partition and isn't mirrored. You will simply need to re-create the metadevices for the root mirror as you had originally.

      many thanks