Debian – Need to edit boot.lst from busybox

bootbusyboxdebian

I have just managed to break my Debian install.

I was having problems with a kernel update, and had to edit menu.lst to get it to install. I have managed to typo and set the boot device to /dev/xvda11 instead of /dev/xvda1

Now, every time I boot I get dropped back to the BusyBox shell.

This would be fine if I could press e when grub was loading, but this is an "in the cloud" server, and I have access to an "emergency console" but it doesn't let me view anything until after the grub loading stage. This also means that live CD's are out.

Can anyone tell me how I can edit the boot device from within BusyBox? I have tried mounting /dev/xvda1 (mount /dev/xvda1 /tmp/) but get an unknown file or folder error (this happens whatever folder I try to mount to, I have even tried creating new folders).

Thanks.

Edit: I can get a partial dmesg which I've uploaded here http://i.stack.imgur.com/FRV5w.jpg

Best Answer

To fix this, you need to mount the boot drive (in my case I had to use -o ext2; if you have a different file system obviously substitute that there).

Now just edit /boot/grub/menu.lst (the text editor in BusyBox is vi) and change the drive listed to boot from.

Save and reboot (and cross your fingers)!