The Linux Community Forum

General Help & Advice => Linux Support => Topic started by: Emegra on May 20, 2013, 10:15:20 pm

Title: Will installing Windows overwrite Grub
Post by: Emegra on May 20, 2013, 10:15:20 pm
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
Title: Re: Will installing Windows overwrite Grub
Post by: SeZo on May 20, 2013, 11:03:17 pm
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
4) Install Mint alongside Win 7 on sdb but skip install grub (or install to sdb if you have to)
5) 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.
Title: Re: Will installing Windows overwrite Grub
Post by: Mark Greaves (PCNetSpec) on May 21, 2013, 12:19:51 am
I can't add anything to that .. that's exactly how I'd do things :)
(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.
Title: Re: Will installing Windows overwrite Grub
Post by: Emegra on May 21, 2013, 06:58:45 am
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
Title: Re: Will installing Windows overwrite Grub
Post by: goldtopia on May 21, 2013, 08:19:26 am
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.
Title: Re: Will installing Windows overwrite Grub
Post by: Mark Greaves (PCNetSpec) on May 21, 2013, 10:21:14 am
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.
Title: Re: Will installing Windows overwrite Grub
Post by: Emegra on May 21, 2013, 01:47:17 pm
Quote
swap the data cables on the drives

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

Quote
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
Title: Re: Will installing Windows overwrite Grub
Post by: Mark Greaves (PCNetSpec) on May 21, 2013, 01:51:37 pm
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:
Code: [Select]
sudo fdisk -l
Title: Re: Will installing Windows overwrite Grub
Post by: Emegra on May 21, 2013, 01:56:37 pm
Quote
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

Quote
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
Title: Re: Will installing Windows overwrite Grub
Post by: Mark Greaves (PCNetSpec) on May 21, 2013, 01:59:32 pm
Okey dokey.
Title: Re: Will installing Windows overwrite Grub
Post by: SeZo on May 21, 2013, 05:35:41 pm
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?
Title: Re: Will installing Windows overwrite Grub
Post by: Emegra on May 21, 2013, 06:01:24 pm
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
Title: Re: Will installing Windows overwrite Grub
Post by: Emegra on May 21, 2013, 06:47:43 pm
Code: [Select]
[email protected] ~ $ 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
[email protected] ~ $


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 ?
Title: Re: Will installing Windows overwrite Grub
Post by: Emegra on May 21, 2013, 06:57:16 pm
Quote
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
Title: Re: Will installing Windows overwrite Grub
Post by: Mark Greaves (PCNetSpec) on May 21, 2013, 07:25:42 pm
Boot to a LiveCD/LiveUSB of Peppermint 3

When at the desktop run these commands in sequence:
Code: [Select]
sudo mount /dev/sda2 /mnt
then
Code: [Select]
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
then
Code: [Select]
sudo chroot /mnt
then
Code: [Select]
grub-install --recheck /dev/sda
then
Code: [Select]
update-grub
now hit Ctrl+D to exit the chroot environment .. now REBOOT to the HDD (not the LiveCD/LiveUSB) to test.
Title: Re: Will installing Windows overwrite Grub
Post by: SeZo on May 21, 2013, 07:31:02 pm
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)
Title: Re: Will installing Windows overwrite Grub
Post by: Mark Greaves (PCNetSpec) on May 21, 2013, 07:38:45 pm
I figured reinstalling GRUB would set the boot flag, and install GRUB again (if necessary) in one go ;)
Title: Re: Will installing Windows overwrite Grub
Post by: SeZo on May 21, 2013, 07:40:56 pm
One way to test it... ;)
Title: Re: Will installing Windows overwrite Grub
Post by: Emegra on May 21, 2013, 08:36:52 pm
Sorted :)

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
Title: Re: Will installing Windows overwrite Grub
Post by: Mark Greaves (PCNetSpec) on May 21, 2013, 08:40:47 pm
Just as a matter of interest, (and as you didn't manually set the boot flag), can you post the output from:
Code: [Select]
sudo fdisk -l
Just so I can be 100% sure reinstalling grub automagically sets the boot flag .. for future reference.
Title: Re: Will installing Windows overwrite Grub
Post by: Emegra on May 21, 2013, 08:42:43 pm
Code: [Select]
[email protected] ~ $ sudo fdisk -l
[sudo] password for graeme:

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
[email protected] ~ $
Title: Re: Will installing Windows overwrite Grub
Post by: Mark Greaves (PCNetSpec) on May 21, 2013, 08:44:05 pm
Hmm .. looks like GRUB doesn't need the boot flag  :o
Title: Re: Will installing Windows overwrite Grub
Post by: Emegra on May 21, 2013, 08:46:32 pm
Quote
Hmm .. looks like GRUB doesn't need the boot flag 

I don't have a clue what you're talking about  ???
Title: Re: Will installing Windows overwrite Grub
Post by: Mark Greaves (PCNetSpec) on May 21, 2013, 09:01:02 pm
After a little reading it seems GRUB completely ignores boot flags .. but in rare cases (as SeZo suggested) some motherboards (mainly intel apparently) will not pass control to a bootloader on a drive that doesn't have the boot flag set.

Nothing for you to worry about unless you plan on removing the Peppermint drive and putting it in another PC with an awkward BIOS ;)
Title: Re: Will installing Windows overwrite Grub
Post by: SeZo on May 21, 2013, 09:12:12 pm
So just to clear that up.
Grub install does not automatically sets the boot flag and the bios ignores it anyway. ???
Title: Re: Will installing Windows overwrite Grub
Post by: Mark Greaves (PCNetSpec) on May 21, 2013, 09:22:33 pm
Nope, installing grub does not appear to set the boot flag, but grub ignores boot flags anyway .. it's just the rare BIOS that needs one.

Quote
If the boot flag is currently on your Ubuntu partition, move it to the new boot partition. This can be done with Gparted or the Disk Utility application.

    Q: Is this really necessary? GRUB and LILO are supposed to ignore the bootable flag

    A: In rare cases, the motherboard BIOS requires a partition with a bootable flag in order to boot from the hard drive. In these cases, GRUB or LILO are not given control even if installed in the MBR.

I read elsewhere that Intel mobo's were known for this ???

Source:
https://help.ubuntu.com/community/CreateBootPartitionAfterInstall

Effectively you're right .. it would probably be best to advise to set the boot flag first, just in case ..
--
Title: Re: Will installing Windows overwrite Grub
Post by: Mark Greaves (PCNetSpec) on May 21, 2013, 09:36:01 pm
@ Emegra

Just to be 100% sure we're all on the same page here .. you did run "sudo fdisk -l" after I asked .. you didn't just copy/paste it from earlier in the topic ?
Title: Re: Will installing Windows overwrite Grub
Post by: Emegra on May 21, 2013, 09:40:21 pm
Quote
Just to be 100% sure we're all on the same page here .. you did run "sudo fdisk -l" after I asked .. you didn't just copy/paste it from earlier in the topic ?

No Mark I ran the command after you asked, I didn't copy it from a previous command.

Would you like me to run it again ?



Graeme
Title: Re: Will installing Windows overwrite Grub
Post by: Mark Greaves (PCNetSpec) on May 21, 2013, 09:42:20 pm
Yes please .. just to be sure :)
Title: Re: Will installing Windows overwrite Grub
Post by: Emegra on May 21, 2013, 09:43:44 pm
OK no problem give me 10 mins or so I'm installing Quickbooks in Win 7 at the moment :)
Title: Re: Will installing Windows overwrite Grub
Post by: Mark Greaves (PCNetSpec) on May 21, 2013, 09:45:51 pm
Tying yourself to proprietary formats again .. once you use Quickbooks (or Sage) you'll never escape it ;)

Or Windows for that matter.

Learn to setup/use GNUcash or Grisbi (if you don't need the full GNUcash) instead

--
Title: Re: Will installing Windows overwrite Grub
Post by: Emegra on May 21, 2013, 09:48:03 pm
Unfortunately I can't completely escape proprietory software, believe me I've tried

Quickbooks is only one example  :(
Title: Re: Will installing Windows overwrite Grub
Post by: Mark Greaves (PCNetSpec) on May 21, 2013, 09:50:39 pm
I'm happy to say after some very frustrating and time consuming work, I'm now COMPLETELY free of all proprietary file formats .. and Windows free :)

[EDIT]

"COMPLETELY free" is probably the wrong phrase .. "COMPLETELY un-reliant" is closer to the mark.

--
Title: Re: Will installing Windows overwrite Grub
Post by: Emegra on May 21, 2013, 09:57:22 pm
[email protected] ~ $ sudo fdisk -l
[sudo] password for graeme:

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
[email protected] ~ $
Title: Re: Will installing Windows overwrite Grub
Post by: Mark Greaves (PCNetSpec) on May 21, 2013, 10:00:39 pm
Thanks .. that confirms it then .. installing GRUB didn't automagically set the boot flag.

But your BIOS doesn't require it set .. and GRUB doesn't need one.
Title: Re: Will installing Windows overwrite Grub
Post by: Emegra on May 21, 2013, 10:12:44 pm
Quote
I'm happy to say after some very frustrating and time consuming work, I'm now COMPLETELY free of all proprietary file formats .. and Windows free

I wish I could say the same, but there are 2 programs preventing me from being Windows free one is Quickbooks which you have to admit is good, I've tried gnu cash but to be honest it doesn't come close at least not for my circumstances and i can't compromise on my business, also another hold Quickbooks has on me is that my accountant uses Quickbooks so whenever he needs to audit my accounts I just give a backup on a pen drive or sometimes email with yousendit

The second one is Autodata which is a vehicle technical data program which is only written for Windows and I need that program

However I'm not a complete wimp i did make a stand, my main parts supplier introduced an online system where i can access their main stores and order parts directly, it worked as a IE plugin, I tried it for a while then told them I will not use it again until they make it compatible with Chromium and coincidently I was told today they're now working on a Chromium plugin


You'd have proud of me Mark :)
Title: Re: Will installing Windows overwrite Grub
Post by: SeZo on May 21, 2013, 10:39:42 pm
Quote
However I'm not a complete wimp i did make a stand, my main parts supplier introduced an online system where i can access their main stores and order parts directly, it worked as a IE plugin, I tried it for a while then told them I will not use it again until they make it compatible with Chromium and coincidently I was told today they're now working on a Chromium plugin

Glad to see that you are making changes for the better
As for Quickbooks, have you tried Business Accountz (http://www.accountz.com/accountz/business-accountz-basic-2012)? It is not free but works on Linux too.
Title: Re: Will installing Windows overwrite Grub
Post by: Emegra on May 21, 2013, 10:54:24 pm
Quote
As for Quickbooks, have you tried Business Accountz? It is not free but works on Linux too.

Thanks for that I had a quick look there and it looks quite good and not too expensive at least not for the basic version the question is just how basic is basic, but it may be worth downloading the trial version and having a proper look I might just do that



thanks




Graeme
Title: Re: Will installing Windows overwrite Grub
Post by: SeZo on May 21, 2013, 11:03:09 pm
Quote
the question is just how basic is basic,

This matrix (http://www.accountz.com/accountz/business-accountz-feature-matrix) might give you some idea.
[EDIT]
Quote
The second one is Autodata which is a vehicle technical data program which is only written for Windows and I need that program

Have you thought about using the online version of Autodata (http://uk.autodata-group.com/products/online/online-3)
Title: Re: Will installing Windows overwrite Grub
Post by: Mark Greaves (PCNetSpec) on May 21, 2013, 11:18:33 pm
GNUcash is amazingly powerful/configurable .. more so than Quickbooks (in my experience), it's just a $%^er to set up and learn in the first place.

[EDIT]

Oh, and don't bother trying to get Autodata to run in WINE .. tried it .. failed.

Weren't Autodata going to do an online version ?

--
Title: Re: Will installing Windows overwrite Grub
Post by: SeZo on May 21, 2013, 11:27:59 pm
See edit above. 8)
Title: Re: Will installing Windows overwrite Grub
Post by: Mark Greaves (PCNetSpec) on May 21, 2013, 11:48:55 pm
That'd be a "yes" then ;)
Title: Re: Will installing Windows overwrite Grub
Post by: Emegra on May 22, 2013, 06:57:34 am
Just had a look at the matrix SeZo posted, first drawback with the basic is it doesn't print invoices second is it doesn't manage customers or suppliers, these things alone are imperative, so I would need the professional or enterprise version which would still be incompatible with my accountants system

Quote
Oh, and don't bother trying to get Autodata to run in WINE .. tried it .. failed.

I know I tried it as well, Quickbooks won't run in Wine either but I've been on to the Intuits forums and it looks like they might consider porting to Linux in the near future

Quote
GNUcash is amazingly powerful/configurable .. more so than Quickbooks (in my experience), it's just a $%^er to set up and learn in the first place.

I have looked at GNUcash but I too found it difficult to set up and understand I also found it messy with files all over the hard drive

Quote
Weren't Autodata going to do an online version ?

Yes and I'm currently looking into that, it works on a subscription basis and it's very expensive

SimplePortal 2.3.3 © 2008-2010, SimplePortal