STUCK ON THE GRUB TERMINAL -ubuntu

This past weekend while debugging my openerp module i changed permissions of my etc folder recurssively by mistake using chmod -R 777 /etc, when my computer restarted i could not use sudo anymore and could not start my openerp server. After trying options in recovery mode to no avail i resolved to formatting the whole machine fortunately my USB could not boot and i had to go back to recovery mode where after trying alot of commands with my colleague Rayyidh we ended up in the grub Terminal 😦 i knew it was the end of my database and projects but this is how we sorted it.
To recover from the GRUB i user the following code.
set prefix=(hdX,Y)/boot/grub ( where X and Y are your boot partitons )
set root=(hdX,Y)
insmod /boot/grub/linux.mod
linux /vmlinuz root=/dev/sdXY ro
initrd /initrd.img
boot

To get my sudo back i changed sudoer file permissions with the following code
chown root:root /etc/sudoers
chmod 440 /etc/sudoers
chown -R root:root /etc/sudoers.d
chmod 755 /etc/sudoers.d
chmod 440 /etc/sudoers.d/*

Thanks to the contributions on ubuntu forum
http://ubuntuforums.org/showthread.php?t=1772599
http://ubuntuforums.org/showthread.php?t=1406568

Advertisements