LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-10-2011, 04:15 AM   #1
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711
Blog Entries: 8

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
dual booting 2 linux os on 2 hd with grub


I have spent the afternoon searching a few web-sites and the closest I found to a solution is this thread on this board.
http://www.linuxquestions.org/questi...istros-313489/

The Situation
I use an external hard-drive to test operating systems. Debian on my internal drive uses GRUB. When an OS is installed on the external drive with a different boot-loader, during boot-up I simply enter the BIOS and choose the external drive.
But once I installed a system on the external drive that also uses GRUB. I do not know if it was because there were two GRUBs or because both drives had Debian, but after installing the second system I could not boot my computer without the external hard-drive being connected.

The Problem
I just installed ArchBang on the external drive. I did not want a repeat of the earlier fiasco, so when adding the boot-loader I installed it on the external drive, not as MBL. This time, during the boot sequence the external drive with Arch does not appear in the BIOS. So as far as my computer is concerned, the external drive does not exist.

I must admit that I am a little confused about boot-loaders. I have no difficulty installing different boot-loaders on the two drives. But GRUB on both gives me problems. Unfortunately, almost everything on the internet concerning dual-booting is either about Linux and Microsoft or about two Linux systems on a single hard-drive.
I need some advise on adding the second boot-loader to the MBL without screwing it up like the last time I tried.

Last edited by Randicus Draco Albus; 12-10-2011 at 04:16 AM.
 
Old 12-10-2011, 10:55 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Quote:
The Situation
I use an external hard-drive to test operating systems. Debian on my internal drive uses GRUB. When an OS is installed on the external drive with a different boot-loader, during boot-up I simply enter the BIOS and choose the external drive.
But once I installed a system on the external drive that also uses GRUB. I do not know if it was because there were two GRUBs or because both drives had Debian, but after installing the second system I could not boot my computer without the external hard-drive being connected.
The thing to watch out for when installing GNU/Linux on two hard drives (whether both internal, or one internal and one external) is that both drives have an MBR. It is necessary then to be very careful when specifying which MBR to instal grub into.

In your case, when you installed to the external drive, you may have accidentally specified to have grub installed to the MBR of the internal drive. Now the pointer in the internal drive MBR points to the rest of the grub files on the external drive. You can't boot the internal Linux installation unless the external drive is connected, so that grub can see the config file which lists Linux installations on both the internal and extenal drives.

To repair this, boot into the internal drive Linux installation and run grub install to rewrite the pointer in the MBR (which will then point to the internal drive grub config file). It should detect all bootable Linux installations and write a config file which will show you a menu on boot wihch lists the Linux installations on both the internal and external drives without the need to tweak the BIOS in order to select which drive to boot.

If you prefer to switch drives via the BIOS, you will then need to write grub to the MBR of the external drive. Boot into the Linux installation on the external drive and run grub install, but be very careful to specify grub install to the MBR of the external drive and not the internal drive. That will give you working grub installations in both drives.

For example:
Let's assume the internal drive is /dev/sda, and the external drive is /dev/sdb.

To repair the MBR of the internal drive, run grub-install /dev/sda to write grub to the MBR with pointer to grub files on the internal drive.

To repair the MBR of the external drive, run grub-install /dev/sdb to write grub to the MBR with pointer to grub files on the external drive.

Now, on boot you will have the grub menu from the internal drive from which you can select to boot into Linux on either the internal or external drive. If you select to boot from the extenal drive, you will see another grub menu (from the extenal drive) showing you both external and internal drive installations. Just select the extenal installation to boot, or wait for the timeout to expire, which will have the same effect.
 
1 members found this post helpful.
Old 12-10-2011, 12:53 PM   #3
chip66
LQ Newbie
 
Registered: Mar 2011
Posts: 6

Rep: Reputation: 0
We are in a transition period between the old and new partitioning systems.

For a couple years it was standard to have PCBIOS calling the MBR, calling the partition marked bootable.

With the new GUID partitions there are BIOSs and programs trying to bridge the gap.

I suppose the first thing to do is establish what your BIOS is trying to do and what
type of partition table your drive has.
 
Old 12-10-2011, 03:49 PM   #4
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711

Original Poster
Blog Entries: 8

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
@bigrigdriver
Thanks for the explanation. It makes GRUB clearer. I cannot tell from your post if I my wording was clear about writing GRUB to the internal drive was in the past and the current situation is no BIOS listing. But that does not matter. When the external drive did not appear in the BIOS, the drive was connected during boot-up. Today, after reading your reply, I plugged the drive in and it mounted. So I re-installed Arch and followed your advice about installing GRUB on the external drive.
Another snag however. I have installed twice. The Arch installer gives the option of installing GRUB on any partition on both drives. The first time I put GRUB in sdb2_ and the second time in sdb2,1. Both times yielded the same result. I cannot boot the system. The error message is:

root (hd1,0)
ext2fs, partition type 0x83 kernel/vmlinuz-linux root=/dev/disk/by-uuid/(followed by a long alpha-numeric string)loglevel=3 ro quiet resume=/dev/disk/by-uuid/(another alpha-numeric string)nomodest
Error 15: File not found

The only difference is the number and letter combinations in the two strings. I know the sdb2,1 partition is the boot partition, but whether GRUB is there or on the primary partition, attempting to boot generates the above error. Perhaps it is an Arch idiosyncrasy or because I am a complete blockhead when it comes to computers, but I am left scratching my head. The primary and boot partitions are the only logical places the boot-loader should go.
???????

EDIT
I did a little more research and found out that the boot-loader should be installed on sdb_. Just to be safe, I down-loaded another ISO and burned another disc. Same result. In case the problem is ArchBang, I experimented by installing Arch Linux. Again, same result, only with a much shorter alpha-numeric sequence.
I have come to the conclusion that I do not possess sufficient knowledge to install Arch's boot-loader. It must be done with Nano. The instructions say to "check" the configuration, but it probably needs to be "tweeked." I guess I am not experienced enough to use Arch.

Last edited by Randicus Draco Albus; 12-11-2011 at 04:05 AM.
 
Old 12-11-2011, 12:30 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,978

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
I use the bios hard drive choice to set my drive. That way I get full installs to each drive an a hot key at boot selects my choice. Almost all bios's in the last 10 years allow that.

If one drive fails it doesn't kill the other install.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dual Booting (2 Linux from Separate Drives) GRUB issue. RensoreK Linux - Desktop 1 08-22-2008 12:01 AM
Grub boot problem after dual booting any Linux with Vista aresgodofwar30 Linux - Newbie 10 02-08-2008 11:43 PM
GRUB error -- dual booting Linux and WinXP j3nnifers Linux - Software 4 06-27-2006 02:13 PM
Grub and dual-booting two Linux distros RonRussell Linux - General 2 04-15-2005 08:04 PM
GRUB: Dual booting Linux and WinXP with SCSI involved Judicator Linux - General 1 07-29-2003 03:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:02 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