OnedererTwoHardDisksExample

From Super Grub Disk Wiki
Jump to navigationJump to search

Onederer's system

Onederer has two hard disk which I describe:

  • Hard Disk A: Linux (With the normal Linux partitions)
  • Hard Disk B: Windows (With only one partition).

Onederer's problem

  • Part I: Onederer had to install Windows in Hard Disk B although he would have liked to install it in Hard Disk A. More than that changing hard disk boot priority in BIOS does not help on his Linux problems.
  • Part II: (That's the problem we are going to try to solve). Whenever he tries to install a distribution it thinks that Linux hard disk is the first one to boot although from the bios point of view it is the second one to boot.

You can learn more about the grub hard disk order concept.

Onederer's solution A

Solution A implies that the hard disk boot order is the same one for hard disks and for cdrom booting.

In this particular example:

  • First hard disk to boot (hd0) : Hard Disk B : Windows
  • Second hard disk to boot (hd1) : Hard Disk A : Linux

Step 1: Getting a functional Linux system

In order to fix this mess he should edit his menu.lst to reflect the actual setup of his system (grub hard disk order). In order to edit his menu.lst he can either boot with a linux live cd such as Ubuntu live cd or Knoppix or boot with his own system.

He knows already how to boot into his system with:

I just started Sabayon  Linux again by going into the SGD's BOOT LINUX section, and manually
editing and changing the "root (hd0,0)" to "root (hd1,0)", then I typed "b" to boot the OS.  
And Linux came up fine.

In my opinion he can also boot into his system with:

Step 2: Editing menu.lst to meet his setup

Once he booted into linux he has to edit his /boot/grub/menu.lst file as a root file as it is described here: How to edit menu.lst as root or superuser

What changes does he need to do?

First of all he needs to edit the groot variable so that it reads: (hd1,0) instead of (hd0,0).

After that, after the file editing he needs to go back to the Linux shell and run: update-grub command.

Finally he can edit menu.lst again to check that (hd0,0) references have been changed to (hd1,0) although this step is optional.

Step 3: Installing Grub again

Finally he only has to install Grub again so that it is installed into the first hard disk, the Windows one with the steps explained at how to fix grub.

If that fails he can try to force the setup with:

  • Choose Language & Help
  • English
  • Advanced
  • GRUB
  • Restore Grub in Hard Disk (MBR)
  • Manual Restore GRUB in Hard Disk (MBR) (!NO stage1_5).
  • Select Linux partition as Grub partition
  • Select Windows Hard Disk as the hard disk where to put GRUB

Step 4: Reboot witout Super Grub Disk cdrom

  • Remove Super Grub Disk from the tray.
  • Reboot
  • Enjoy !

Onederer solution B

Solution B implies that the hard disk boot order is not the same one for hard disks and for cdrom booting.

In this particular example, when booting from Hard disk:

  • First hard disk to boot (hd0) : Hard Disk B : Windows
  • Second hard disk to boot (hd1) : Hard Disk A : Linux

But when booting from Cdrom:

  • First hard disk to boot (hd0) : Hard Disk A : Linux
  • Second hard disk to boot (hd1) : Hard Disk B : Windows

Step 1: Getting a functional Linux system

In order to fix this mess he should edit his menu.lst to reflect the actual setup of his system (grub hard disk order). In order to edit his menu.lst he can either boot with a linux live cd such as Ubuntu live cd or Knoppix or boot with his own system.

He can boot into his system with:

Step 2: Editing menu.lst to meet his setup

Once he has the functional he has to edit his /boot/grub/menu.lst file as a root file as it is described here: How to edit menu.lst as root or superuser

What changes does he need to do?

First of all he needs to edit the groot variable so that it reads: (hd1,0) instead of (hd0,0).

After that, after the file editing he needs to go back to the Linux shell and run: update-grub command.

Finally he can edit menu.lst again to check that (hd0,0) references have been changed to (hd1,0) although this step is optional.

Step 3: Installing Grub again

Finally he only has to install Grub again so that it is installed into the first hard disk, the Windows one.

If that fails he can try to force the setup with:

(Remember that if he reboots he needs to run EASY LIVE SWAP option again)

  • Choose Language & Help
  • English
  • Advanced
  • GRUB
  • Restore Grub in Hard Disk (MBR)
  • Manual Restore GRUB in Hard Disk (MBR) (!NO stage1_5).
  • Select Linux partition as Grub partition
  • Select Windows Hard Disk as the hard disk where to put GRUB

Step 4: Reboot witout Super Grub Disk cdrom

  • Remove Super Grub Disk from the tray.
  • Reboot
  • Enjoy !

Step 5: Boot your Windows from Grub

Depending on the menu.lst settings you might need to edit it to be able to boot Windows from the grub menu. (You might see Starting up... but Windows never starts.) Here there are the instructions: How to Boot Windows from a Second hard Disk.

Onederer's own summary

The Grub hard disk booting problem has finally been resolved.

Most systems (I'd say at least 98%), the computer bios's and computer systems are setup so that Windows lives on partition (hd0,0). However, on MY system, Linux lives on (hd0,0), and Windows is on partition (hd1,0). The normal setup with /boot/grub/grub.conf, is that the menu is setup to reflect that Grub is installed on the MBR (most of the time) of /dev/hda, which is the drive that Windows is normally installed on. This also includes the Grub Splash Screen.


My distribution installer expected /dev/sda drive (Linux) to be (hd0) and also expected that /dev/sdb (Windows) was (hd1). Other attempted setups such as physical hard drive swapping have been fultile. It just didn't work! With the assistance of SuperGrubDisk Forum, I edited every instance of what normally is /boot/grub/grub.conf (hd0,0), to (hd1,0). Then I rebooted, and for the very first time, after all those years, on this machine, I saw a beautiful Grub menu in all of its splendor. I was able to boot Linux without any problems!

However, I was not able to boot Windows. So I went back and edited once more /boot/grub/grub.conf. In the windows title I edited (hd0,1) to (hd0,0) and added "makeactive" to the menu. I rebooted again, and this time, selected Windows from the Grub Splash Screen. What a wonderful sight! Windows booted up perfectly. Now my wife doesn't have to be confused anymore when she tries to use this system again! And this frees me for other projects.

What I have to figure out now is why Grub now points to the second selection of the menu. This selection I don't want. It is trying to boot the "safe mode". I need it to point to the regular mode, which is the top selection of the menu. And of course, Windows is on the bottom of the selections. Note: this problem has now been corrected. Where you see below, default=1, has now been changed to default=0. This causes Grub to now point to the first instance of the Grub menu selection, rather than the second choice.

Here's a copy below, of how /boot/grub/grub.conf now looks. If you want to see the original grub.conf., as it was originally created by the system, just ask, and I'll post it for you for comparasion.

SM-1 / # cd boot/grub
SM-1 grub # ls
device.map grub.conf grub.conf_original menu.lst stage1 ufs2_stage1_5
e2fs_stage1_5 grub.conf~ grub.conf.sample minix_stage1_5 stage2 vstafs_stage1_5
fat_stage1_5 grub.conf.old.add iso9660_stage1_5 reiserfs_stage1_5 stage2_eltorito xfs_stage1_5
ffs_stage1_5 grub.conf.old.remove jfs_stage1_5 splash.xpm.gz stage2.old
SM-1 grub # cat grub.conf
# grub.conf generated by the Sabayon Linux Installer
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/kernel-genkernel real_root=UUID=76e6309c-3c29-4fcb-bbe1-fcd26d83bcb7
# initrd /boot/initramfs-genkernel
#boot=sda
default=1
timeout=6
splashimage=(hd1,0)/boot/grub/splash.xpm.gz
title Sabayon Linux x86-64 3.5 (genkernel-x86_64-2.6.25-sabayon-r1)
root (hd1,0)
kernel /boot/kernel-genkernel-x86_64-2.6.25-sabayon-r1 root=/dev/ram0 ramdisk=8192 real_root=UUID=76e6309c-3c29-4fcb-bbe1-fcd26d83bcb7 dolvm quiet   
init=/linuxrc splash=silent,theme:sabayon vga=791 CONSOLE=/dev/tty1 resume=swap:/dev/sda2
initrd /boot/initramfs-genkernel-x86_64-2.6.25-sabayon-r1
title Sabayon Linux x86-64 3.5 (genkernel-x86_64-2.6.25-sabayon-r1) (safe mode)
root (hd1,0)
kernel /boot/kernel-genkernel-x86_64-2.6.25-sabayon-r1 root=/dev/ram0 ramdisk=8192 real_root=UUID=76e6309c-3c29-4fcb-bbe1-fcd26d83bcb7 dolvm  
init=/linuxrc CONSOLE=/dev/tty1 resume=swap:/dev/sda2 nox acpi=off ide=nodma vga=normal
initrd /boot/initramfs-genkernel-x86_64-2.6.25-sabayon-r1
title Other Operating System - Microsoft Windows
rootnoverify (hd0,0) 
makeactive
chainloader +1
title=Sabayon Linux (kernel-genkernel-x86_64-2.6.25-sabayon-r1)
root (hd1,0)
kernel /boot/kernel-genkernel-x86_64-2.6.25-sabayon-r1 root=/dev/ram0 ramdisk=8192 real_root=UUID=76e6309c-3c29-4fcb-bbe1-fcd26d83bcb7 dolvm quiet  init=/linuxrc splash=silent,theme:sabayon vga=791 CONSOLE=/dev/tty1 resume=swap:/dev/sda1
initrd /boot/initramfs-genkernel-x86_64-2.6.25-sabayon-r1

If you ever end up with a system like this, I hope that this WIKI will help you solve your booting problem.

The first sympton that you will see when you install a new operating system and boot it up, is that you will never see a Grub splash screen. Windows will boot up as if there is no Linux present. If that is the case, use a partition manager such as gparted, and look at your setup. If you find that Windows is installed in the second hard drive, then you will have to first install grub to the correct hard disk mbr and then do the editing that was done above in /boot/grub/grub.conf to get your Linux running.

Cheers!

Resources

Onederer Super Grub Disk forum post