How to drop to root shell prompt in recovery mode

3 risposte [Ultimo contenuto]
yeehi
Offline
Iscritto: 06/02/2012

I left a parsing error in /etc/sudoers

Now I can't use sudo, as there is no valid sudoers file. I have gone into recovery mode but I need to drop to root shell prompt. I don't have a su password. How do I get the root prompt?

Thank you!

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

You had better boot a live system and, mount the local root file system, 'chroot' in it and use visudo to edit the sudoers. For instance, if the root partition is /dev/sda1, I would try, from the live system:
$ sudo mount /dev/sda1 /mnt
$ sudo chroot /mnt
# EDITOR=nano; visudo

Good luck with that.

yeehi
Offline
Iscritto: 06/02/2012

Thanks, Magic Banana.

I tried that sudo mount /dev/sda1 /mnt and got an error message:

deleted i-node reference

By the way, for some reason when I tried booting from a live CD on a usb stick, I only reached a command prompt interface. There was no GUI. Previously, when I tried out Trisquel this way on the USB stick, prior to actually installing Trisquel, I got the usual GUI.

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

That is all very weird. Booting the live system has nothing to do with problems on the installed system (it should even work without a hard disk). I hope I am wrong but it looks like part of your hardware is dying...