LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-24-2012, 11:15 AM   #1
Weapon S
Member
 
Registered: May 2011
Location: Netherlands
Distribution: Debian, Archlinux
Posts: 262
Blog Entries: 2

Rep: Reputation: 49
Grub install on same drive as MBR reference


I'm reinstalling Windows and Linux (memory corruption; sucks hard).
There was one little mishap I once encountered which I'd like to avoid. I have two drives. Windows on one, Linux on the other. The reference to Grub seemed to be on the MBR of the first, Windows drive. But the actual program was on the Linux drive. When I had a little mishap with the Linux drives partitions, I couldn't boot Windows normally, because it tried to load Grub and then failed.
Is there a way to ensure Grub is "installed" to the MBR of the second drive, or will it always try to plant itself in front of Windows?
Last time I didn't have the bootable flag set of the Linux partition, I think. Does that help?
(Bonus question: is there a way to choose another swap partition, if one drive fails? The swap is normally on the Windows drive.)
 
Old 10-24-2012, 04:44 PM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,485

Rep: Reputation: 2485Reputation: 2485Reputation: 2485Reputation: 2485Reputation: 2485Reputation: 2485Reputation: 2485Reputation: 2485Reputation: 2485Reputation: 2485Reputation: 2485
You can install Grub to the mbr of whichever drive you want, you just need to know which is which. If you have Grub in the mbr of the second drive, you will then need to set that drive to first boot priority to boot it. The default during installation is generally to install a small part of Grub to the mbr of the first drive, pointing to whichever partition has boot files. Setting a boot flag is generally not necesasry for Linux. You would need to post more detailed drive/partition information to get more detailed assistance. I'm not sure what your question about swap is but you can put it on either drive.
 
Old 10-26-2012, 01:44 PM   #3
Weapon S
Member
 
Registered: May 2011
Location: Netherlands
Distribution: Debian, Archlinux
Posts: 262

Original Poster
Blog Entries: 2

Rep: Reputation: 49
Thank you for the reply. The good part is I can do everything over now, so at the moment you can't really speak of "the partitions I have". I can select which drive to boot from in my BIOS. I don't think not installing GRUB is a good idea; because I'm not very knowledgeable about this. I'm reading the GRUB manual now.
This was my set-up:
Code:
[Drive 1: GRUB in MBR]
Windows
Linux Swap
Some other partition
Code:
[Drive 2]
Linux: GRUB files here
Some other partition
You see, if any drive fails, GRUB (and thus booting normally) is compromised.
Kind of same story with swap file: either drive fails, and no more Linux for me.
So I'm trying to get it Right this time.
 
Old 10-26-2012, 03:13 PM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,485

Rep: Reputation: 2485Reputation: 2485Reputation: 2485Reputation: 2485Reputation: 2485Reputation: 2485Reputation: 2485Reputation: 2485Reputation: 2485Reputation: 2485Reputation: 2485
It would be helpful if you indicated which windows version you have as well as which distribution of Linux. I am sure you are aware that there are hundreds of different Linux distributions and they do not all use the same bootloader. Grub has two different bootloaders, Legacy Grub and Grub2 and the methods for editing and/or modifying them differ substantially.

If you want windows on one drive and whichever Linux distribution you have on another drive, install windows first to the first drive, then install Linux to the second. Windows will install its bootloader to the mbr of its drive without asking or informing you. When you install Linux, you will be given the option of where to install the bootloader. You should install it to the mbr of the second drive on which you are installing Linux. You would then need to select which drive to boot from in the BIOS. If you have the windows drive attached during the installation of Linux, its bootloader should create an entry for windows and put it on the boot menu. Without knowing which distribution you are planning to use, it is not realistic to give more specific advice.

Reading the Grub Manual is obviously a good idea. Just make sure you are reading the correct manual.

I'm not sure what your question about a swap partition is. If you have an adequate amount of RAM, you probably won't even need a swap partition.
 
Old 10-26-2012, 03:42 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
I don't like any of the installers - Windoze or Linux; they all make too many presumptions on how I should arrange my system(s).

My suggestion, pull out the "other" disk during the installs, then "finish-up" as needed. With one disk in, install Windoze. Take that disk out, stick the other in (in its correct interface), and install Linux. Stick both disk back, and use the BIOS to select.
From Linux you'll be able to easily dual-boot (with grub2 this is simple to fix after the install), and if that disk fails, just use the other for Windoze. If the Windoze disk fails, who cares, Linux will still work...
 
Old 10-27-2012, 05:49 AM   #6
Weapon S
Member
 
Registered: May 2011
Location: Netherlands
Distribution: Debian, Archlinux
Posts: 262

Original Poster
Blog Entries: 2

Rep: Reputation: 49
You're being very helpful, yancek. Thanks And I'm being very vague. Sorry. I will use Debian stable which uses GRUB2. My Windows will be XP (home edition).
> if you have an adequate amount of RAM
My main concern is that Linux will barf all over me, when it can't find its swap. Hm, maybe more a concern for Windows (which would have its swap-file on the Linux drive X( ). Maybe I should consciously pull the drives out and see what happens. o_0
Also, 640M is a bit on the low side.
syg00: if I do exactly that, I'll have to assign the swap partition later, or have it on the same disk... the latter might actually be a good idea, except for speed. Thanks for the suggestion, though.
I think I'll go with install Linux first. Then Windows (which in any case is agnostic about Linux).
----
That didn't work. Even with the first drive completely formatted, GRUB insisted on installing there. (I.e. trying to boot from the Linux drive gave me: Operating system load error, or something)I think I'll switch the drives, and put Linux on #1. If Windows doesn't like that... >_>

Last edited by Weapon S; 10-27-2012 at 10:32 AM.
 
Old 10-27-2012, 05:33 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Swap on the same disk isn't really an issue unless you have high/constant swapping. Most laptops run that way, and have forever - even old, low memory ones. Multiple swap extents can also be allocated (one per disk say), and prioritised - lots of options available.

If you can't direct to which disk the loader goes that is a bug in the Debian installer - report it (I doubt I've installed Debian this century, so I can't say for sure).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i install grub onto hard drive after the mbr has been wiped baronobeefdip Linux - Software 7 02-26-2011 05:49 PM
removing grub from MBR of a flash drive dasy2k1 Linux - General 3 11-29-2009 09:19 PM
How to install Grub to MBR of USB drive? linus72 Linux - Newbie 1 04-11-2009 11:48 AM
Grub in MBR no Linux installed can't access hard drive bookmonger Linux - Software 13 02-14-2006 07:06 AM
how do i install grub in the mbr? spyghost Linux - Newbie 2 11-07-2003 09:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration