Update Grub In Another filesystem

bootgrub

My cloud server hosted in Rackspace stopped working after I installed some GUI application in Ubuntu 12.04 which automatically installed it's dependency package ubuntu-desktop (or some other similar (GUI) package).

Actually, that happened 2 weeks ago.

But today is the first time I'm rebooting my server after ubuntu-desktop (or a similar package) was installed, and I realized the webserver cannot boot as it does not have enough RAM to load the GUI (and it doesn't have a graphical device neither) – It frezes after printing "Loading Boot screen" (or something like that) into the terminal.

To fix it, I have access to Rescue Mode in Rackspace, where I can access the filesystem of my server without actually booting it, so I can tweak configs here and there before turning it on.

I did some research and saw that I can force console mode changing Grub configuration from GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" to GRUB_CMDLINE_LINUX_DEFAULT="text". But this change requires running update-grub which I can't, because I can only access the server filesystem, but not log into it to run commands.

Do you guys understand my problem? Am I clear enough? Sorry about my bad English, i'm still learning it.

So, here's my question:

How can I update grub without being logged in a server? Is that even possible? If not, is there any other way to force boot into text mode by only tweaking configuration files and thus not having to log into the server?

Thanks.

Best Answer

Yay!

I got it to work by manually editing /boot/grub/grub.cfg on the mounted filesystem and replacing the single occurrence of "quiet splash" to "text". That way, update-grub was not needed.

It's not an elegant solution, but it worked.

Now I'm able to connect normally through SSH to my server again. I'll later run update-grub so I can make sure this manual file edit won't have any side effects.

So, here's what I learned today: don't install a GUI on those cheap low performance cloud servers because they won't have enough resources to boot, making things difficult to fix.