Saturday, February 27, 2016

dual boot - How can I remove ALL grub2 files and reinstall them? In other words, reset grub2?

I have been using Grub-Customizer ever since I've had Ubuntu, but I've noticed it having more and more issues lately.



About two weeks ago, I reordered the grub entries and put them in sub-menus using grub customizer and saved. It saved like it normally does and reported no errors.



I rebooted to see what it looked like. When my computer boots, it shows me the hardware details before it boots the default EFI. I saw the details, then the screen went black and I saw the details again! It seems to me grub kept rebooting the PC!



I went into the boot menu to load Windows and that worked normally. I created a live Ubuntu USB and booted from it, except, when I saw the grub screen form the USB, I pressed C for a command line. I have Ubuntu installed on sda9, so I typed:




set root=(hd1,9)
linux /vmlinuz root=/dev/sda9
initrd /initrd.img
boot


And yes, I know how the (hd1,9) works, when booting from a USB, the USB is temporarily assigned to sda. Ubuntu booted normally so I logged in and tried several things. I tried restoring backups from /ect/grub.d/backup/, then tried sudo update-grub and got:



Syntax Error in Grub.cfg. Please ensure that there are no errors in /ect/grub.d/* and /default/grub.



Finally, I tried sudo grub-install /dev/sda, and now I can see grub when I start the machine. Now I have another problem. It still shows the same error as before when I type sudo update-grub. I would like to reset grub somehow, is there a way to do this? If not, is there a way to even fix this without losing all my programs (again)? Thanks!



Edit: I just realized that the whole grub.d folder and the grub default file is GONE! What's going on!?!?!

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...