1833382 Members
3711 Online
110052 Solutions
New Discussion

root-not identified

 
nitin1
New Member

root-not identified

Hi ,
My /etc/passwd is missing ....how can i get the system recognize root. ??

3 REPLIES 3
Armin Feller
Honored Contributor

Re: root-not identified

Boot the system from Core-OS-CD and run recovery-shell:

Step 1. Load files
Select one of the above: l
Enter the filename(s) to load:
ioscan tar frecover

Step 2. chroot_lvmdisk
Enter x. Exit to shell
type 'menu' to return to the menu environment
# chroot_lvmdisk

If successful, enter the chroot command:
cd /ROOT
chroot /ROOT /sbin/sh
If the chroot command fails, go to Step 3. Restore The Data
If the chroot command succeeds, lets activate and mount /vg00 filesystems

Step 3. /etc/passwd is missing from root. chroot failed, /dev/rmt/0m not installed

CD /ROOT
tar xvf /dev/rmt/c2t0BESTn /etc/passwd
x /etc/passwd 2012 bytes 49 tape blocks

Step 4: Exit from Recovery shell
When exiting the recovery shell you should unmount and deactivate all
Filesystems and Volume Groups. Exit back to the CD and choose the
reboot option, e.g.

CD /
umount -a
vgchange -a n /dev/vg00
exit
menu
option b. - reboot
Michael Tully
Honored Contributor

Re: root-not identified

If you don't have a backup copy (/etc/passwd.*) and you are logged in as root, then you can either get it from backup tape, or if in desperate need a default one from /usr/newconfig/etc/passwd

DO NOT REBOOT your system without having a valid /etc/passwd file.
Anyone for a Mutiny ?
harry d brown jr
Honored Contributor

Re: root-not identified

Follow Michael's advice but without an /etc/passwd you aren't going to be able to do much! I don't even think you can create a file without the system being able to identify root!


Try this:

echo "root::0:3::/:/sbin/sh" >/etc/passwd
echo "daemon::1:5::/:/sbin/sh" >>/etc/passwd
echo "bin:*:2:2::/usr/bin:/sbin/sh" >>/etc/passwd
echo "sys:*:3:3::/:" >>/etc/passwd
echo "adm::4:4::/var/adm:/sbin/sh" >>/etc/passwd
echo "uucp::5:3::/var/spool/uucppublic:/usr/lbin/uucp/uucico" >>/etc/passwd
echo "lp::9:7::/var/spool/lp:/sbin/sh" >>/etc/passwd

then find /etc/passwd on taqpe and restore it!

live free or die
harry
Live Free or Die