First bad root shell, now can't mount /dev/dsk/c0t0d0s0 from CDROM boot
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) and now I cannot log in as root.
Following the advice here to fix the problem (http://forum.sun.com/jive/thread.jspa?forumID=292&threadID=78298), 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 alternatesuper block. SEE fsck_ufs(1M).
Trying to use newfs to find alternate super-block locations:
newfs -N /dev/dsk/c0t0d0s0
results in:
mkfs: bad valuefor size: 640 must be between 1024 and 640
mkfs: size reset todefault 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?

