Unable to mount /dev/dsk/c0t0d0s0 from CDROM boot after having damaged root shell

From: peter@akemann.us
Date: Fri Aug 04 2006 - 12:25:24 EDT


Machine: Netra 240

OS: Solaris 8

Original Problem: Root Shell damaged in /etc/passwd

Current Problem: Can't mount /dev/dsk/c0t0d0s0 from CDROM single-user boot

 

I accidentally changed the root shell in /etc/passwd to /sbin/bash (a
non-existent shell). Now I cannot log on as root ("No Shell").

 

Following the advice here
(http://forum.sun.com/jive/thread.jspa?forumID=292&threadID=78298) to fix
the problem, I booted from CD in single-user mode, but I was unable to mount
the file system.

 

Specifically, I tried:

   mount /dev/dsk/c0t0d0s0

and I get the response:

  mount: /dev/dsk/c0t0d0s0 is already mounted

  or allowable number of mount points exceeded

 

Following advice I found elsewhere, I tried:

  fsck /dev/rdsk/c0t0d0s0

and got:

  BAD SUPER BLOCK: MAGIC NUMBER WRONG

  USE AN ALTERNATE SUPER-BLOCK TO SUPPLY NEEDED IN

  eg. fsck [-F ufs] -o b=# [special ...]

  where # is the alternate super block. SEE fsck_ufs(1M).

 

Trying to use newfs to find alternate super-block locations:

  newfs -N /dev/dsk/c0t0d0s0

results in:

  mkfs: bad value for size: 640 must be between 1024 and 640

  mkfs: size reset to default 640

  Warning: inode blocks/cyl group (42) >= data blocks (40) in last

    cylinder group. This implies 640 sector(s) cannot be allocated.

  Too many cylinder groups with 0 sectors;

    try increasing cgsize, or decreasing fssize to 18446744073489350656

 

Now from what I see in the Solaris troubleshooting guide, the BAD SUPER
BLOCK error means the disk is hopelessly corrupted and my only choice is to
reformat it.

 

However, this cannot be the case since I can boot normally, and log in as
any user other than root and all the files appear fine.

 

Is there a way out of this without formatting the drive and re-installing
the OS?

 

Any help would be greatly appreciated.

 

Thank you,

-Peter
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:40:32 EDT