LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Win 7 messed up grub, had to reinstall, want to do dual boot right (https://www.linuxquestions.org/questions/linux-newbie-8/win-7-messed-up-grub-had-to-reinstall-want-to-do-dual-boot-right-4175511029/)

SteveH_66 07-14-2014 04:29 AM

Win 7 messed up grub, had to reinstall, want to do dual boot right
 
Hi all, I was dual booting before, Windows 7 and Linux Mint 12, checking out Linux to see if I like it which I did. Well, I am wanting to install Linux Mint 17, but I want to do it right and not run into the same problem I just went through.

Here's what happened: Somehow Win 7 corrupted my grub boot loader, I know it was Win 7 because I haven't used Mint in a couple of weeks. I am having to reinstall both of them, and it was a fight to get them off of there. Mint put grub somewhere it was impossible to track down, and I had to wipe all the partitions to get rid of it.

In doing my research to try to find out the problem, I read in a couple of places that this was a real problem with Mint, and known, especially with Win 7 thrown into the mix - something about where Mint puts the grub boot loader. I can attest to the fact that it was a tough job getting rid of grub cause I basically could not find it and had to reinstall windows 7 with a disk format.

So here's what I want to do. I want to install a distro that is easy to install and user friendly to new users, I liked the looks of Mint but I'm not stuck on it - if there is another distro that will help me avoid this problem in the future, I would be willing to take a look at it. Would prefer one with different desktops available that I can check out. And as I said earlier, fairly user friendly to new users, as I am still not too experienced with Linux. Also, something that is good on a laptop that is 2 or 3 years old.

And are there any suggestions how to do this in a way so that Win 7 can not mess up everything and I have to go through days of reinstalling? I have to keep dual boot, but I don't want this happening again. I thought different partitions, but I don't know enough about Linux to know if this alone would solve the problem. In the Mint forums they stated that Win 7 had to be installed first to avoid this problem, but obviously Windows found a way to mess it up anyway. If the best way is to uninstall Win 7, install Linux first, and then reinstall Windows then I would be willing to do so - I want to avoid this problem again. I want dual boot and a way to make Windows mind it's manners, if this is possible - somehow I have doubts on that score.

Suggestions needed and most wanted. :) Thank you

NGIB 07-14-2014 05:09 AM

If you are installing Windows and Linux in a dual boot, always install Windows first. Windows does not respect any other OS and always assumes it is "king". Once Windows is installed and running, install the Linux distro of choice. When you get to the installation of the bootloader, usually GRUB, tell it you want to install on the MBR of your Windows drive. It will install GRUB to the MBR, detect all available OSs, and all should go well. I've done this 100s of times and it always works as long as Windows is installed and setup first.

syg00 07-14-2014 06:57 AM

All superstition and folklore.

There is *no* requirement to install Win7 before (any) Linux. Sure Win7 will overlay the MBR and (apparently) delete access to Linux, but this is easily fixed from a liveCD and/or chroot. No need to re-install either system.
Deal with the real issue, not with symptoms.

To the OP, go with Mint17 and be happy - and if Win7 screws up the dual-boot, just ask. If I can find a decent how-to online, I'll post here.

NGIB 07-14-2014 06:59 AM

Quote:

Originally Posted by syg00 (Post 5203579)
All superstition and folklore.

There is *no* requirement to install Win7 before (any) Linux. Sure Win7 will overlay the MBR and (apparently) delete access to Linux, but this is easily fixed from a liveCD and/or chroot. No need to re-install either system.
Deal with the real issue, not with symptoms.

To the OP, go with Mint17 and be happy - and if Win7 screws up the dual-boot, just ask. If I can find a decent how-to online, I'll post here.

Not superstition at all. Windows WILL break Grub which then requires repair. Installing Windows first prevents this from happening. What misinformation did I provide?

Experts would not be asking for simple solutions so the simplest solution is to install Windows first.

yancek 07-14-2014 08:40 AM

syg00 said there is no "requirement" windows be installed first. You didn't say it was "required" but easier and I think his point was that it is a simple matter to reinstall Grub after a windows install. In this particular case, the OP hasn't told us what happened to corrupt the bootloader. Also his comment about where "mint puts the bootloader" means he is not familiar with Grub2 as it is the same as used on Ubuntu and numerous other distributions. A simple command: sudo grub-install /dev/sda might have resovled the issue but not enough information was posted to know.

SteveH_66 07-14-2014 11:55 AM

Additional Information
 
OK, I saw the comment about not posting enough information about how Win7 got messed up and took grub down with it. The truth is, after almost 30 years of using computers I still can't tell you all the ways Windows or the program developers for it can do that - I wish I knew them all, I believe I could make a substantial income in the computer field if I could. My first (that I seriously used) computer was a Commodore Colt with dual 5 1/4 floppies, you ran the programs from one and stored the data on the other. Back then I was even a fair hand at bat file scripting.

Anyway, here is what started happening. In Win7, my most noticeable problem was a loss of my wireless capability. Numerous unistall/reintstalls of the proper wireless driver, latest version from the Acer site for my exact model didn't fix it. It was gone, never to be heard from again. So, I was tied to a network cable, something I don't like on a laptop - I actually use them that way, on my lap, and the fewer cables in the way the better.

So, I decided to take a look at Linux again, being frustrated with Win7. Booted up to Linux, but there was a problem, Linux Mint 12 refused my password. Without full drive encryption for serious security, I just use the same password for Linux and Win7 - since everyone knows if you can get your hands on the computer physically then a live disk gives you everything on the hard disk, as far as I know anyway. I run zone alarm firewall & antivirus plus 4 malware programs so I figure I'm about as safe as you can get from the Internet with Win7. So, when Mint refused my password, I started getting a bad feeling about things.

Now at this time, being able to boot Win7 still and Mint 12 coming up but saying incorrect password, and with Win7 suddenly not wanting to run my wireless, I was getting a bad feeling. But still not too worried yet. Downloaded a live disc of Mint 17 KDE, wanted to test some things out. The live disc booted up fine, and under it my wireless worked fine. A couple weeks before this, I got system crashes under Win7 three nights in a row, and the people at sevenforums were trying to help me diagnose that, but they suddenly stopped happening before I could get log captures to post to that forum.

Then, a couple of days ago I got an error message.
error: that partition does not exist.
grub rescue: _
(the error message to the best of my recollection.)

So now, I couldn't boot into either system. The message indicated to me a corrupted GRUB. So, I started researching that message. I did a google search, tried all the suggested methods for restoring the grub with a live CD. None of them worked, and I was sitting there with a system that would only boot to the Mint Live CD. Checked forums and posts and blogs about restoring the GRUB, tried them all, many were repeats of the processes I had already tried from previous posts. Got tired of that, wiped the system and reinstalled Win7 from the disk.

So, now here I am. I have a fresh install of Windows 7, did that first because I plan to dual boot and I had read in numerous posts if you don't put Windows 7 on first, it will hose the GRUB. I am going to put on the bare minimum of what I consider essential programs in Win7 for me, then I am going to get an Image of Win7 so I can restore it more easily in the future. Then, I am going to set up Linux on the system with dual boot. I am actually thinking about installing a couple of distros so I can look at more than one and see if I like one better than the other.

So basically what I am wanting to do now is install a couple of different Linux distros to take a look at, or possibly 2 versions of the same distro with different desktops and try them a while, then switch out to a different one and see if I can find a distro & desktop version that I like. Keep that, and have the other partition for trying other distros I read about and decide to take a look at.

So basically I am wanting to know how to protect the GRUB from Windows 7 in case of a future reinstall of Windows 7. Once I have an image that shouldn't be too hard to do, and I have a feeling I WILL be having to reinstall Win7 again, or move the image over. It was actually overdue for it, I have had problems with Windows 7 for a while now, for example it was taking 5 minutes to boot up from powered down under Windows 7 - booted in about 30-45 seconds under Mint 12. Defragging the disk and the registry under Windows 7 didn't help, still slow boot and a lot of memory tied up under Windows 7.

So as I said, I am basically wanting to find out how to protect the GRUB from Windows 7 reinstall, and if that isn't possible how to easily reinstall it from a backup or something if it does get messed up again. Because I had a couple of fun days trying to FIND the GRUB (never did) or fix it - never could. Thanks

SteveH_66 07-14-2014 12:10 PM

P.S. Thanks for the posts you folks have already made, I did try the methods outlined in the posts I found from a google search. sudo grub-install /dev/sda2 (which showed as the boot sda in a run of fdsk -l I did) didn't work. As I said, none of the fixes I could find worked. If this happens again in the future, I will come here and see if you good folks can help me through a GRUB2 restore. Hopefully I won't face one that hard again lol. :)

NGIB 07-14-2014 12:20 PM

If you install/reinstall Windows it will overwrite the MBR every time. If you plan on doing lots of installs, I highly suggest making yourself a bootable USB drive containing "rescue" software. I use Parted Magic as it has all the tools I need to fix most problems. The Grub Doctor in Parted Magic would have fixed your issues with just a few clicks...

SteveH_66 07-14-2014 12:48 PM

Thanks NGIB, I was looking around at some other posts and I think on the 'trying different distros' thing I am going to go with a suggestion in another post to install VM and test the different flavors that way, less install uninstall. As for Parted Magic, I used Hiren's boot disk and under the Linux option it brought up a version of linux that had Parted Magic if I remember correctly. I couldn't fix it with that, maybe it was an older version of it, or maybe I just wasn't looking in the right spot. Not very familiar with Hiren's either. I will do a search and read up more on Parted Magic, if there is a rescue disk with Parted Magic on it maybe I can figure out how to use it to restore the GRUB. If not I'll be back! With questions :redface: Thanks

NGIB 07-14-2014 12:52 PM

The last free version of Parted Magic was from August 2013 and it included Grub Doctor - it's still available for download on the web - just Google it.

Grub Doctor is very simple - you choose the partition that contains your linux install and it will reinstall Grub to the MBR and your linux /boot directory...

wizard10000 07-14-2014 01:03 PM

Quote:

Originally Posted by syg00 (Post 5203579)
All superstition and folklore.

There is *no* requirement to install Win7 before (any) Linux. Sure Win7 will overlay the MBR and (apparently) delete access to Linux, but this is easily fixed from a liveCD and/or chroot. No need to re-install either system.
Deal with the real issue, not with symptoms.

To the OP, go with Mint17 and be happy - and if Win7 screws up the dual-boot, just ask. If I can find a decent how-to online, I'll post here.

I don't do dual-boot machines any more but it's always been my preference to let the Windows bootloader chainload grub rather than the other way around; that way you can reinstall either OS without trashing the other one. Here's how I do it -
  • Install Linux. Make sure grub installs on the first Linux partition **instead of the MBR**
  • Install Windows.
  • Start Windows and download and run bootpart (XP) or EasyBCD (Vista and later). It will find your Linux installation, copy the Linux boot sector to the root of the Windows drive and create a boot menu entry to call grub.

It's a little bit more work but it pays off if you ever have to reinstall Windows.

edit: You can also create the Linux boot sector image with dd; but bootpart or EasyBCD is considerably easier.

SteveH_66 07-14-2014 01:16 PM

Thanks Wizard10000. I downloaded EasyBCD and another program called Rescatux, going to try to burn both of those and check them out. That operation doesn't sound too complicated, so I might try that. Can I use EasyBCD to uninstall Windows? I've done a lot of re-installs of Windows when it got corrupted, but I can't ever remember uninstalling it. And if something happens and I have to copy the Win7 image back to the system, EasyBCD will allow me to fix the GRUB again? Thanks

wizard10000 07-14-2014 01:20 PM

Quote:

Originally Posted by SteveH_66 (Post 5203757)
Thanks Wizard10000. I downloaded EasyBCD and another program called Rescatux, going to try to burn both of those and check them out. That operation doesn't sound too complicated, so I might try that. Can I use EasyBCD to uninstall Windows? I've done a lot of re-installs of Windows when it got corrupted, but I can't ever remember uninstalling it. Thanks

If grub was installed on the MBR your Windows reinstall trashed it and you'll need to reinstall grub at least; my suggestion is to install grub on the first Linux partition then boot into Windows and run EasyBCD. It'll find grub, make the proper changes to your Windows partition and you'll be able to select Linux from a Windows boot menu.

edit: To answer the question about Windows breaking grub; if grub is not installed on the MBR Windows can't break it; so yes - once you get things running if you need to reinstall Windows you just run EasyBCD afterward. It finds grub, adds it to the Windows boot menu and away you go :)

Good luck!

jross 07-14-2014 02:10 PM

This is not something I know anything about, but I think this video is similar to Wizard10000's method??:

http://youtu.be/xlTgaWs9BD0

yancek 07-14-2014 03:52 PM

Quote:

Then, a couple of days ago I got an error message.
error: that partition does not exist.
grub rescue: _
That error occurs when a partition has been deleted or there have been changes make to partitions or to uuids. If you had a Mint partition and your deleted it or a Mint boot partition and deleted it or formatted it, that would certainly be expected. Don't know what actually happened.

Quote:

I did try the methods outlined in the posts I found from a google search. sudo grub-install /dev/sda2
That won't help. You installed Grub to the partition not the mbr, it might have worked if you changed sda2 to sda but if you did not have the boot files on the Mint partition, that would not work either.

Quote:

Can I use EasyBCD to uninstall Windows?
No. EasyBCD is software used to boot different systems. You don't uninstall operating systems like windows or Linux, you uninstall applications. If you want to get rid of a system, you select its partition and format it and install something else to the same partition. I'm not sure EasyBCD can boot multiple Linux systems but you can chainload other Linux systems from the Linux bootloader. My understanding of EasyBCD is that is a modified version of Grub built to run on windows (Grub4Dos).

If you have to reinstall windows 7, you will probably have to reinstall EasyBCD as it is generally just downloaded and run from within windows. I seem to recall the possibility of putting it on a CD and making it bootable but it has been years since I used it.

I you are going to be trying multiple systems, something like VirtualBox would probably be the easiest and you should not have to worry about corrupting the bootloader.


All times are GMT -5. The time now is 04:23 PM.