Monday, 13 January 2014

SOLARIS10:ROOT PASSWD BREAKING ON SVM ROOT MIRRORING

IN SVM ROOT MIRRORING WE NEED TO EDIT /etc/system , /etc/shadow , /etc/vfstab IF NOT ,EDITD PROPERLY PANIC HAPPENS ,IF U DONOT EDIT ALL FILES IT COURRUPTS ROOT FILE SYSTEM AND CAUSE TO DISASTER (IT HAPPEND) NOW HOW TO RESOLVE SAME ????????

1)connect to RSC console
RSC version 2.2.3 (BD1)
Please login: admin
Please Enter password:
rsc>
rsc> console
{3} ok devfsadm
devfsadm ?
{3} ok devalias
rootdisk                 /pci@9,600000/SUNW,qlc@2/fp@0,0/disk@0,0
mirrdisk                 /pci@9,600000/SUNW,qlc@2/fp@0,0/disk@1,0
disk1                    /pci@9,600000/SUNW,qlc@2/fp@0,0/disk@1,0
disk0                    /pci@9,600000/SUNW,qlc@2/fp@0,0/disk@0,0
disk                     /pci@9,600000/SUNW,qlc@2/fp@0,0/disk@0,0
ide                      /pci@8,700000/ide@6
scsi                     /pci@9,600000/SUNW,qlc@2
cdrom                    /pci@8,700000/ide@6/cdrom@0,0:f
net                      /pci@9,700000/network@2
net1                     /pci@9,600000/network@1
net0                     /pci@9,700000/network@2
flash                    /pci@9,700000/ebus@1/flashprom@0,0
idprom                   /pci@9,700000/ebus@1/i2c@1,2e/idprom@4,a4
nvram                    /pci@9,700000/ebus@1/i2c@1,2e/nvram@4,a4
i2c1                     /pci@9,700000/ebus@1/i2c@1,30
i2c0                     /pci@9,700000/ebus@1/i2c@1,2e
bbc                      /pci@9,700000/ebus@1/bbc@1,0
rsc-console              /pci@9,700000/ebus@1/rsc-console@1,3083f8
rsc-control              /pci@9,700000/ebus@1/rsc-control@1,3062f8
ttya                     /pci@9,700000/ebus@1/serial@1,400000:a
pci9b                    /pci@9,700000
pci9a                    /pci@9,600000
pci8b                    /pci@8,700000
pci8a                    /pci@8,600000
ebus                     /pci@9,700000/ebus@1
name                     aliases

ok power-off
RSC Alert: Host system has shut down.
rsc> console
Validating JTAG integrity...Done
Disabling DAR error circuitry...Done
Clearing DCS error circuitry state...Done
Initializing DTL circuitry state...Done
Initializing CDX via JTAG...Done
;
;
;
2)boot through CDROM
{3} ok boot cdrom -s
Boot device: /pci@8,700000/ide@6/cdrom@0,0:f  File and args: -s
hsfs-file-system
Loading: /platform/sun4u/boot_archive
ramdisk-root ufs-file-system
Loading: /platform/SUNW,Sun-Fire-V490/kernel/sparcv9/unix
Loading: /platform/sun4u/kernel/sparcv9/unix
SunOS Release 5.10 Version Generic_147440-01 64-bit
Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved.
os-io Booting to milestone "milestone/single-user:default".
Configuring devices.
;
;
;
Using RPC Bootparams for network configuration information.
Attempting to configure interface ce1...
Skipped interface ce1
Attempting to configure interface ce0...
Skipped interface ce0
USB keyboard
Requesting System Maintenance Mode
SINGLE USER MODE

3)SET THE TERMINAL VALUES
# clear
# TERM=vt100
# export TERM
# EDITOR=vi
# export EDITOR
# clear
# df -h
Filesystem             size   used  avail capacity  Mounted on
/ramdisk-root:a        203M   181M   2.3M    99%    /
/devices                 0K     0K     0K     0%    /devices
ctfs                     0K     0K     0K     0%    /system/contract
proc                     0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
swap                    31G   344K    31G     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab
swap                    31G   912K    31G     1%    /tmp
/tmp/dev                31G   912K    31G     1%    /dev
fd                       0K     0K     0K     0%    /dev/fd
/devices/pci@8,700000/ide@6/sd@0,0:f
                       2.1G   2.1G     0K   100%    /cdrom
df: cannot statvfs /platform/sun4u-us3/lib/libc_psr.so.1: Operation not applicable
df: cannot statvfs /platform/sun4u-us3/lib/sparcv9/libc_psr.so.1: Operation not applicable
swap                    31G     8K    31G     1%    /tmp/root/var/run

4)TRY TO MOUNT FILE SYSTEMS
# mount /dev/dsk/c3t0d0s0 /mnt
mount: The state of /dev/dsk/c3t0d0s0 is not okay
        and it was attempted to be mounted read/write
mount: Please run fsck and try again
# mount /dev/dsk/c3t1d0s0 /mnt
mount: The state of /dev/dsk/c3t1d0s0 is not okay
        and it was attempted to be mounted read/write
mount: Please run fsck and try again
5)TRY TO EXECUTE FSCK MIN 3 TIMES
# fsck -F ufs /dev/rdsk/c3t0d0s0
** /dev/rdsk/c3t0d0s0
** Last Mounted on /a
** Phase 1 - Check Blocks and Sizes
PARTIALLY TRUNCATED INODE I=5832
SALVAGE? y
;
;
FRAGMENT 180 OUT OF RANGE I=5832 LFN 98408
FRAGMENT 150994944 OUT OF RANGE I=5832 LFN 98576
FRAGMENT 150994944 OUT OF RANGE I=5832 LFN 98608
FRAGMENT 134217728 OUT OF RANGE I=5832 LFN 98640
FRAGMENT 150994944 OUT OF RANGE I=5832 LFN 98672
FRAGMENT 134217728 OUT OF RANGE I=5832 LFN 98704
FRAGMENT 150994944 OUT OF RANGE I=5832 LFN 98736
FRAGMENT 134217728 OUT OF RANGE I=5832 LFN 98768
FRAGMENT 134217728 OUT OF RANGE I=5832 LFN 98800
FRAGMENT 134217728 OUT OF RANGE I=5832 LFN 98832
EXCESSIVE BAD FRAGMENTS I=5832
CONTINUE? y
INCORRECT DISK BLOCK COUNT I=5832 (218560 should be 164336)
CORRECT? y
;
;
** Phase 1b - Rescan For More DUPS
FRAGMENT 24994528 DUP I=5832 LFN 82016
;
;
WARNING: DATA LOSS MAY HAVE OCCURRED DUE TO DUP BLOCKS.
VERIFY FILE CONTENTS BEFORE USING.
FILESYSTEM MAY STILL BE INCONSISTENT.
Log was discarded, updating cyl groups
CORRECT BAD CG SUMMARIES FOR CG 0? y
;
;
;
WARNING: DATA LOSS MAY HAVE OCCURRED DUE TO DUP BLOCKS.
VERIFY FILE CONTENTS BEFORE USING.
FILESYSTEM MAY STILL BE INCONSISTENT.
325491 files, 27099547 used, 3887714 free (26906 frags, 482601 blocks, 0.1% fragmentation)
***** FILE SYSTEM WAS MODIFIED *****
***** FILE SYSTEM IS BAD *****
***** PLEASE RERUN FSCK *****
# fsck -F ufs -y /dev/rdsk/c3t0d0s0
** /dev/rdsk/c3t0d0s0
** Last Mounted on /a
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
UNALLOCATED  I=17470  OWNER=root MODE=0
SIZE=0 MTIME=Jan 13 00:19 2014
NAME=?/boot_archive
REMOVE DIRECTORY ENTRY FROM I=7522?  yes
** Phase 3a - Check Connectivity
** Phase 3b - Verify Shadows/ACLs
** Phase 4 - Check Reference Counts
LINK COUNT FILE I=50321  OWNER=root MODE=100644
SIZE=112304128 MTIME=Jan 13 00:19 2014  COUNT 2 SHOULD BE 1
ADJUST?  yes
** Phase 5 - Check Cylinder Groups
CORRECT BAD CG SUMMARIES FOR CG 0?  yes
CORRECTED SUPERBLOCK SUMMARIES FOR CG 0
CORRECTED SUMMARIES FOR CG 0
FRAG BITMAP WRONG
FIX?  yes
CORRECTED SUPERBLOCK SUMMARIES FOR CG 111
CORRECTED SUMMARIES FOR CG 111
FRAG BITMAP WRONG (CORRECTED)
CORRECTED SUPERBLOCK SUMMARIES FOR CG 452
CORRECTED SUMMARIES FOR CG 452
FRAG BITMAP WRONG (CORRECTED)
CORRECT GLOBAL SUMMARY
SALVAGE?  yes
325491 files, 27099618 used, 3887643 free (26867 frags, 482597 blocks, 0.1% fragmentation)
***** FILE SYSTEM WAS MODIFIED *****

# fsck -F ufs -y /dev/rdsk/c3t0d0s0
** /dev/rdsk/c3t0d0s0
** Last Mounted on /a
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3a - Check Connectivity
** Phase 3b - Verify Shadows/ACLs
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cylinder Groups
325491 files, 27099618 used, 3887643 free (26867 frags, 482597 blocks, 0.1% fragmentation)

6)NOW MOUNTED FILE SYSTEM SUCCESSFULLY
# mount /dev/dsk/c3t0d0s0 /mnt
# cd /mnt
#cd etc
#vi system
==>hash **rootdev:/pseudo/md@0:0,10,blk
#vi vfstab
#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/c1t0d0s1       -       -       swap    -       no      -
/dev/dsk/c3t0d0s0       /dev/rdsk/c3t0d0s0      /       ufs     1       no
-
/devices        -       /devices        devfs   -       no      -
sharefs -       /etc/dfs/sharetab       sharefs -       no      -
ctfs    -       /system/contract        ctfs    -       no      -
objfs   -       /system/object  objfs   -       no      -
swap    -       /tmp    tmpfs   -       yes     -

#umount /mnt
# cd /usr/platform/`uname -i`/lib/fs/ufs
# ls
bootblk
# installboot -F ufs bootblk /dev/rdsk/c3t0d0s0
AGAIN MOUNT FILE SYSTEM AND UPDATE BOOT ARCHIVE
#mount /dev/dsk/c3t0d0s0 /mnt
# bootadm update-archive -v -R /mnt
archive not found: /mnt//platform/sun4u/boot_archive
cannot find: /mnt/etc/cluster/nodeid: No such file or directory
cannot find: /mnt/etc/mach: No such file or directory
Creating boot_archive for /mnt
updating /mnt/platform/sun4u/boot_archive
#init 0
{0} ok boot disk
NOW BOOTED SUCCESSFULLY.

No comments:

Post a Comment