Will installing Windows overwrite Grub

Hi Guys

I have 2 hard drives installed on my PC sdb(360GB) has WinXP & Linux Mint 14 sda (40GB) has Peppermint 3

I’ve completely wiped sdb in preparation to Install Windows 7 alongside Mint 15 when it’s released, so I’m now ready to install Windows 7 but my problems is I don’t know what drive Grub is installed on and my fear is that if I go ahead and install Windows 7 on sdb will it overwrite Grub preventing me from booting into Peppermint on sda ?

Any help would be much appreciated

Many thanks

Graeme

If I am getting this right, then in your current arrangement Peppermint (on drive sda1) controls grub.
Installing Win7 on drive sdb1 will over write grub on sda1.
I would suggest to approach it like this:

  1. Disconnect all drives, except sdb
  2. Move sdb to be the first drive
  3. Install Windows 7 to sdb (it will re-partition it)
  4. Move sdb to be in the second position
  5. Reconnect sda (to first position) and run update-grub in Peppermint to pick up Win7
  6. Install Mint alongside Win 7 on sdb but skip install grub (or install to sdb if you have to)
  7. Update grub in Peppermint to pick up Mint

Make sure that when connecting the drives they go to the correct position so they are detected in the correct order in the bios.

I can’t add anything to that … that’s exactly how I’d do things :slight_smile:
(ie. don’t have the Linux drive attached during Windows installation … then use GRUB to chainload Windows after adding the Linux drive back in and making sure it’s the primary boot device)

But rest assured, GRUB is easy to reinstall even if you do manage to overwrite it … or you could add Peppermint/Mint to the Win7 bootloader with EasyBCD.

I’m sure this will come as no surprise to you (it certainly doesn’t surprise me) but I’ve screwed it up

Before installing Win 7 I disconnected the Peppermint drive the installation went perfectly once installed I switched off the PC and reconnectd the Peppermint drive but now I have no grub menu and it will only boot into Windown even if I hit escape to get me into the boot options menu and select the Peppermint drive it skips that drive and boots into Windows.

I ran a live session and all the Peppermint system files appear to be there so I don’t think I’ve wiped it

Any help would be much appreciated

Graeme

The easiest would be to have different OSs’ on separate hard disc caddies which are interchangeable. But that just my opinion. It saves a lot of aggro. No emulators, no dual booting. Thats if you have a desk top computer.

You’ve probably changed the boot order of the drives … either:-

a) swap the data cables on the drives
or
b) go into your BIOS and make sure the Peppermint drive is set as the primary boot device.

swap the data cables on the drives

unfortunately that’s not an option as one drive is SATA and the other IDE

go into your BIOS and make sure the Peppermint drive is set as the primary boot device.

I’m sure it already is set that way but I’ll double check when I get home but i didn’t think that would matter if I try directly booting the Peppermint drive via the bootloader

Graeme

I thought you said you hadn’t access to the GRUB bootloader ?

Or do you mean if you use the boot device selection screen to select the Linux drive it STILL doesn’t display GRUB ?

[EDIT]

Can you boot to a LiveCD/LiveUSB and post the output from:

sudo fdisk -l
Or do you mean if you use the boot device selection screen to select the Linux drive it STILL doesn't display GRUB ?

Yes that’s what I mean

Can you boot to a LiveCD/LiveUSB and post the output from: Code: [Select] sudo fdisk -l

I’m at work just now but I’ll do that when I get home

Many thanks

Graeme

Okey dokey.

Is it possible that you might have had Peppermint’s grub installed to sdb in your original setup?
If that is the case then you will have to reinstall grub (from a live cd) to sda.
Also which drive is on IDE and which is on SATA?

Hi SeZo

You could be right but what I can’t understand is that Peppermint booted ok after I had completely re-formatted the other drive (sdb) which I imagine would have wiped Grub if it was installed on that drive

The SATA Drive is sdb (360GB) which now has Windows 7 installed

The IDE Drive is sda (40GB) which has Peppermint installed which I can’t now boot into since installing Windows 7 on sdb

peppermint@peppermint ~ $ sudo fdisk -l

Disk /dev/sda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders, total 78165360 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000bd46b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1        73990142    78163967     2086913    5  Extended
/dev/sda2            2048    73988095    36993024   83  Linux
/dev/sda5        73990144    78163967     2086912   82  Linux swap / Solaris

Partition table entries are not in disk order

Disk /dev/sdb: 360.1 GB, 360080695296 bytes
255 heads, 63 sectors/track, 43777 cylinders, total 703282608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000001

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048   703277504   351637728+   7  HPFS/NTFS/exFAT
peppermint@peppermint ~ $ 

If I’m understanding this right then SeZo was correct because it looks to me like grub is installed on sdb (Windows 7 partition), how can this be ?

The easiest would be to have different OSs' on separate hard disc caddies which are interchangeabl e. But that just my opinion. It saves a lot of aggro. No emulators, no dual booting. Thats if you have a desk top computer.

Sorry Bill I missed your post

I don’t have caddies i could use but to be honest there’s normally no hassle with dual booting unless you screw it up like I’ve managed to do but I am supremely confident the supergurus on here will sort it out for me

Thanks for your input

Graeme

Boot to a LiveCD/LiveUSB of Peppermint 3

When at the desktop run these commands in sequence:

sudo mount /dev/sda2 /mnt

then

for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done

then

sudo chroot /mnt

then

grub-install --recheck /dev/sda

then

update-grub

now hit Ctrl+D to exit the chroot environment … now REBOOT to the HDD (not the LiveCD/LiveUSB) to test.

GRUB replaces the default Master Boot Record (MBR) with its own code. Deleting or formatting partitions will not touch that part of the disk.
Looking at the output it looks like that your sda has not got the boot flag set, hence it is not bootable from the bios.
First of all you need to set that with gparted from the live cd.
The next step (as Mark said) would be to install grub to sda (chroot into peppermint)

I figured reinstalling GRUB would set the boot flag, and install GRUB again (if necessary) in one go :wink:

One way to test it… :wink:

Sorted :slight_smile:

Thanks so much guys

For your information after running Marks terminal commands the PC naturally booted straight into Windows (no grub menu) so I changed the boot order in the bios to boot the peppermint drive first it then booted into the grub menu with Peppermint as the default, so once again nothing more to do other than to thank you guys for another job well done and mark this solved.

Many Thanks

Graeme

Just as a matter of interest, (and as you didn’t manually set the boot flag), can you post the output from:

sudo fdisk -l

Just so I can be 100% sure reinstalling grub automagically sets the boot flag … for future reference.