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 )
linux /vmlinuz root=/dev/sdXY ro
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/*