HELP ! Passwd & Shadow file corrupted

HELP ! Passwd & Shadow file corrupted

Post by Dave » Fri, 11 Oct 2002 03:37:17



Netra T1 200 with Solaris 8 02/02 installed, w/o cdrom attached, two
internal
disks are mirrored using SDS4.2.1 and /usr is partitioned. Both passwd and
shadow were corrupted and no previous backup, opasswd or oshadow were
damaged too.

As a result, the system is not able to be coming up, it reports:
! no such user as root, adm, sys,lp, etc.

I tried to boot into single user mode from install server:
 boot net -s mount /dev/dsk/c0t0d0s0 /a
then, created the passwd from scratch: root::0:1:root user:/:/sbin/sh
(only this single entry, I think it is sufficient to bring the system up.)

But after reboot, it reports: missing or bad passwd entry for root.

I booted into single mode from net again, found that the passwd file was
empty, where is the entry I entered before?

Is it because the root file system is managed by volumn manager? or I
did not mount as read-write mode? or I should recreate the shadow file as
well and how to sync from passwd to shadow file?

Please advise me on the correct steps to take in this case. Your help in
this matter will be greatly appreciated.

 
 
 

HELP ! Passwd & Shadow file corrupted

Post by Rev. Don Koo » Fri, 11 Oct 2002 11:59:01



> Netra T1 200 with Solaris 8 02/02 installed, w/o cdrom attached, two
> internal
> disks are mirrored using SDS4.2.1 and /usr is partitioned. Both passwd and
> shadow were corrupted and no previous backup, opasswd or oshadow were
> damaged too.

> As a result, the system is not able to be coming up, it reports:
> ! no such user as root, adm, sys,lp, etc.

> I tried to boot into single user mode from install server:
>  boot net -s mount /dev/dsk/c0t0d0s0 /a
> then, created the passwd from scratch: root::0:1:root user:/:/sbin/sh
> (only this single entry, I think it is sufficient to bring the system up.)

> But after reboot, it reports: missing or bad passwd entry for root.

> I booted into single mode from net again, found that the passwd file was
> empty, where is the entry I entered before?

> Is it because the root file system is managed by volumn manager? or I
> did not mount as read-write mode? or I should recreate the shadow file as
> well and how to sync from passwd to shadow file?

> Please advise me on the correct steps to take in this case. Your help in
> this matter will be greatly appreciated.

        You said that the disks are mirrored.  You have to boot both halfs of
the mirror and change the password file entry on each one.  When you
just change it on one side of the mirror, the system re-syncs the next
time you try to boot and your changes are erased.

                        Hope this helps,
                                Don

--
***********************      You a bounty hunter?
* Rev. Don McDonald   *      Man's gotta earn a living.
* Baltimore, MD       *      Dying ain't much of a living, boy.
***********************             "Outlaw Josey Wales"

 
 
 

HELP ! Passwd & Shadow file corrupted

Post by Paul Robertso » Fri, 11 Oct 2002 22:57:07


Quote:

> Is it because the root file system is managed by volumn manager? or I
> did not mount as read-write mode? or I should recreate the shadow file as
> well and how to sync from passwd to shadow file?

> Please advise me on the correct steps to take in this case. Your help in
> this matter will be greatly appreciated.

Dave,

As someone else mentioned, when you booted from the net and made
changes to c0t0d0, your changes were not propagated to the mirror. I'd
suggest that you make the changes to c0t0d0 and reboot off just
c0t0d0.  Then you can go through the process of re-mirroring to the
mirror device.

Though it is possible to edit the requisite files on both halves of
the mirror, I'm not certain it will always work for you, since
Disksuite mirrors blocks, and not files.

Specifically:

 1) boot net -s (or "boot cdrom -s")

 2) fsck -y /dev/rdsk/c0t0d0s0

 3) mount /dev/dsk/c0t0d0s0 /mnt

 4) vi /mnt/etc/system

    Comment out (with a *) the md entries stating that / is a
    metadevice:


 5) vi /mnt/etc/vfstab

    Change the metadevice names (/dev/md/dsk/...) back to their normal
    slices on c0t0d0 (/dev/dsk/...).

 6) Make the required changes to the /mnt/etc/passwd and
    /mnt/etc/shadow.

 7) umount /mnt

 8) fsck -y /dev/rdsk/c0t0d0s0 (and any other ufs filesystem slices
    that are part of the operating system e.g. /var, /opt, etc)

 9) reboot

Once the system boots cleanly off the c0t0d0 device, go through the
process of metaclearing all the old metadevices (you can retain the
state database replicas). Finally, do the normal disksuite mirror from
c0t0d0 to the mirror "from scratch".

I hope that helps.

Cheers,

Paul
--
Paul Robertson

 
 
 

1. Problem with corrupted passwd and shadow files

Netra T1 200 with Solaris 8 installed, w/o cdrom attached, two internal
disks are mirrored using SDS4.2.1 and /usr is partitioned. Both passwd and
shadow were corrupted and no previous backup.

As a result, the system is not able to be coming up, it reports: ! no such
user as root, adm, sys,lp, etc.

I tried to boot into single user mode from install server: boot net -s mount
/dev/dsk/c0t0d0s0 /a

then, create the passwd from scratch: root::0:1:root user:/:/sbin/sh (only
this single entry, I think it is sufficient to bring the system up.)

But after reboot, it reports: missing or bad passwd entry for

I booted into single mode from net again, found that the passwd file was
empty, is it because the root file system is managed by volumn manager? or I
did not mount as read-write mode? or I should recreate the shadow file as
well?

Please advise. Your help in this matter will be greatly appreciated.

2. Free: Make 3D scan from real object to virtual object

3. Corrupted PASSWD, SHADOW, GROUP files

4. Linux Print Server

5. I cannot get Shadow-3.3.1 to create shadow passwd file

6. Can't upgrade Sparc 10 to Solaris 2.6

7. Convert NIS passwd back to standard /etc/passwd & /etc/shadow

8. Connect PC like consol serial

9. 4.1.x passwd -> 2.x passwd & shadow

10. shadow files getting wiped out (standard passwd/shadow)

11. Passwd file corrupt Please Help

12. HELP! Corrupted /etc/passwd file on Solaris x86

13. Help, Sun passwd file corrupt