Lost Root, what to do

Abdullah Ramazanoglu ar018 at yahoo.com
Wed Apr 6 21:58:28 UTC 2005

Leaf wrote:
> On Wednesday 06 April 2005 11:29, Abdullah Ramazanoglu wrote:

> Well I did as you suggested, rebooted and had many errors trying to login
> (can't start dcop, something about it and dhcppc 0, x server grumbles and
> finally KDE failed to start followed by an error about Konserve).  I went
> back and found group.bak and something else I now forget.  Used those
> backups, still failed.

I went the same route as you and managed to recover root. Here is the
detailed account of what I've done. Perhaps the culprit is in some minor
detail, so you can see where our methods differ.

0. Backed up with:  cp -a /etc/{passwd,shadow,group} /root

1. Went to Kuser and deleted root. Kuser didn't mind accepting my request
and happily deleted root (a bug, IMHO). It asked whether to delete also the
home dir (/root) and mailbox (/var/mail/root).

2. In another pop-up dialog it asked whether to delete the user's private
group (root). I let it delete also the root group.

3. System busted. Nothing sudo related works. Rebooted again into Kubuntu,
without a root, to test and proliferate the situation if/where applicable.

4. Rebooted into Kanotix (where Kubuntu root partition already mounted
as /mnt/hda2), opened 2 root konsole sessions, one in /mnt/hda2/etc
(Kubuntu) other in /mnt/hda2/root (backups) and copy-pasted these lines
from backup to the real files (yours should also be the same, so you
shouldn't need a backup; just copy-paste from here):

Top line of passwd;

Top line of shadow;

Top line of group;

Saved and rebooted into Kubuntu. Now all is working well, as before.

P.S: If you had deleted /root directory, then you also need to recreate it
(just an empty dir with "mkdir /root" should suffice, IMHO). You can
alternatively both recreate it and initially populate it with "cp
-a /etc/skel /root" (assuming there is no /root directory). I guess it's
not the pristine /root you got at fresh install but it should do. I can
also send you a root.tgz with superfluous files stripped.

Abdullah Ramazanoglu
aramazan ÄT myrealbox D0T cöm

More information about the kubuntu-users mailing list