HOWTO: Restore GRUB with Knoppix
Re-installing Windows for the umpteenth time? If you also have Linux installed on your system, you probably just lost GRUB again for the umpteenth time as well. Windows will never be considerate of the other operating systems it shares space with. You’ll have to come up with another plan. The best way is to beat Windows at it own game. Windows installs code to the MBR that simply seeks out the partition marked as active/boot and passes control to the boot loader located there. To cope with Windows, install GRUB to a partition, not the Master Boot Record.
- Download Knoppix and burn it to a CD
- Boot Knoppix
- When you get to the KDE desktop, open a terminal (command line)
- Type
sudo grub
to get into the grub terminal - Type
find /boot/grub/stage1
to get a list of locations where your grub files reside - Pick a location and type
root (hdx,y)
, where x and y should match one of the options given to you by the previous command - Type
setup (hdx,y)
- Launch the GParted Partition editor with
sudo gparted
- Right-click on the partition where /boot is located and select
Manage Flags
- Click on
boot
and close all windows to back out (the change is immediate)
When you reboot from the hard drive, your GRUB setup should be back.
Notes:
- If you’re prepping for a Windows install and are using a live Ubuntu install to do this, you’ll have to issue the command twice — it’s a known bug
- If you want to re-install Windows’ MBR boot code, use
fdisk /mbr
in Windows under an Administrative Console (use Shift + Ctrl) - In Windows, you can use FDISK under and Administrative Console to change the partition that’s marked as Active.
mertin 9:56 pm on December 2, 2012 Permalink |
you really made me sweat. There’s an error in your instructions. The last command would be
setup (hdX) (without comma, second parameter)
BrainwreckedTech 7:55 pm on January 12, 2013 Permalink |
The point of the article was to beat Windows at its own game. Using hdX will install GRUB to the Master Boot Record. Using hdX,Y will install GRUB to a partition. By installing GRUB to the partition, all you have to do is change which partition is bootable whenever you re-install Windows.
Benno 7:14 am on December 3, 2012 Permalink |
Have you checked your guide b4 publishing ir? Don’t think so. First, Knoppix has no GParted and second, grub does NOT understand ‘sudo gparted’, you’d have to ‘quit’ grub to re-enter bash. But then again, gparted is not even on Knoppix. Anyway, you must mention WHICH Knoppix version…lol Damn! haha so that’s a no go for getting the boot flags fixed….wow….hold on here, who am I trying to help? XD
BrainwreckedTech 7:51 pm on January 12, 2013 Permalink |
It’s not that I don’t check. When I write these articles, I perform the steps one at a time and jot down notes on what I am doing. So there’s your room for mistakes — even if I’m copying and pasting into a text editor, there’s a human involved in the process. For all I know, I had to get up and go to the bathroom in the middle of writing this article. Or answer a phone call. Feel better?
However, KNOPPIX still has GParted. Yes, it is on the CD version, too. So I missed ONE step. But I don’t think I came off as much a fool as you have. Who were you trying to help? Yourself. And you failed.
Isaac 3:08 am on July 15, 2013 Permalink |
Hi there!
I recently installed Knoppix 7.2 on my HD (on a separate extended partition) (along with Windows 8) and GRUB was installed on the MBR (the other option was to not install GRUB). It went along just fine (GRUB saw Knoppix and Windows) and booting to Knoppix succeeds.
However, when I choose Windows, BOOTMGR is missing comes up (rootnoverify (hd0,1) ) chainloader +1
It only works when I manually edit it to hd0,0 (to let it point to the system reserved driver where the windows boot files are).
Since I want my computer to start up normally without the need for extra keypresses, I restored the Windows MBR using fixmbr from the recovery environment.
I then re-installed Knoppix on the HD and this time chose to not install GRUB on the MBR. Here’s my question:
1.) How do I let the Windows environment see Knoppix?
I came across this website: http://apcmag.com/how-to-dual-boot-windows-8-and-linux.htm but it mentions installing GRUB to root or /boot partition. I’m stumped because I was not given that option when installing Knoppix. It only asked my if I wanted to install GRUB on the MBR or not.
Any help/advice would be appreciated. I’m sort of new to Linux. Thanks!