Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
I have a system with the primary drive as XP. The 2nd drive (with Fedora) has died and been removed. GRUB still appears but only as the single line "GRUB ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2006
    Posts
    19

    How to Fix Windows/Linux 2 drive boot?


    I have a system with the primary drive as XP. The 2nd drive (with Fedora) has died and been removed. GRUB still appears but only as the single line "GRUB Read Error". The computer stops at that point.

    I have another blank drive that I can add to the system. I want to install CentOS on it, but I want to preserve the Windows drive.

    The final goal would be able to boot Windows by default and CentOS by selection.

    How do I do that?

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    The final goal would be able to boot Windows by default and CentOS by selection.
    That can be achieved easily. Install CentOS in Second drive. Its GRUB will take charge and you will have option to boot either OS at startup, same as Fedora's GRUB.
    You have to edit /boot/grub/grub.conf file of CentOS to set Windows OS as default OS.
    After CentOS installation, post the contents of its /boot/grub/grub.conf file here.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Just Joined!
    Join Date
    Jun 2006
    Posts
    19
    OK, that was a great answer.
    I'm going to try to restore the image of a CentOS drive from another computer. That was a 30 GB drive and the target will be a 40 GB drive.

    If that fails I will install CentOS from scratch. I'll get back to you with the grub configuration file because my previous attempts to change the default boot OS was not successful.

  4. #4
    Just Joined!
    Join Date
    Jun 2006
    Posts
    19
    That worked! I wrote the CentOS image from a drive on another computer to this 2nd hard drive. Needed to fiddle with the fstab file (its on the web), and reconfigure the X-server (Linux helped). But its up and running. Now for the grub.conf file:
    ---
    Code:
    # grub.conf generated by anaconda
    #
    # Note that you do not have to rerun grub after making changes to this file
    # NOTICE:  You have a /boot partition.  This means that
    #          all kernel and initrd paths are relative to /boot/, eg.
    #          root (hd0,0)
    #          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
    #          initrd /initrd-version.img
    #boot=/dev/hda
    default=0
    timeout=5
    splashimage=(hd0,0)/grub/splash.xpm.gz
    hiddenmenu
    title CentOS (2.6.18-164.6.1.el5)
    	root (hd0,0)
    	kernel /vmlinuz-2.6.18-164.6.1.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
    	initrd /initrd-2.6.18-164.6.1.el5.img
    title CentOS (2.6.18-164.el5)
    	root (hd0,0)
    	kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
    	initrd /initrd-2.6.18-164.el5.img
    title CentOS (2.6.18-128.el5)
    	root (hd0,0)
    	kernel /vmlinuz-2.6.18-128.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
    	initrd /initrd-2.6.18-128.el5.img
    -------
    Notes:
    1) I had to set the BIOS to boot from IDE-1 to get the system to boot at all.
    2) The 2nd drive is hdd. The Windows drive is hda.
    3) Recall I want Grub to boot Windows by default.

  5. #5
    Just Joined!
    Join Date
    Jun 2006
    Posts
    19
    I managed to make it work with the grub.conf changes:
    Add the following before the 1st "title" directive
    ---
    title Windows XP
    #Don't know what the map cpmmand does.
    map (hd0) (hd1)
    map (hd1) (hd0)
    #not sure why the next is (hd1,0)?
    rootnoverify (hd1,0)
    chainloader +1
    -----
    But again, the BIOS is set to boot the 2nd disk first, and yet before, it booted the first drive. How do you fix this?

  6. #6
    Just Joined!
    Join Date
    Jun 2006
    Posts
    19
    Nope... Originally, the boot sequence in the BIOS was set to look at the diskette first, CDROM 2nd, and IDE-0 (Windows) third. If, in the BIOS, I set that boot sequence again, it says:
    Searching for Boot Record from IDE-0..OK
    GRUB
    and then stops.
    ----
    The BIOS startup output is:
    Primary Master: Windows drive (hda)
    Primary Slave: Not Installed.
    Secondary slave: Linux drive (hdd??)
    Secondary Master: DVD-ROM

    I would like to get back to the original boot sequence?

  7. #7
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Windows OS doesn't boot up if you set its Harddisk as Secondary. map code is like a cheat code to tell Windows OS that its Harddisk is Primary.
    default value set the default OS in GRUB menu.
    Your grub.conf file should be like this
    Code:
    default=3
    timeout=5
    splashimage=(hd0,0)/grub/splash.xpm.gz
    #hiddenmenu
    title CentOS (2.6.18-164.6.1.el5)
    	root (hd0,0)
    	kernel /vmlinuz-2.6.18-164.6.1.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
    	initrd /initrd-2.6.18-164.6.1.el5.img
    title CentOS (2.6.18-164.el5)
    	root (hd0,0)
    	kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
    	initrd /initrd-2.6.18-164.el5.img
    title CentOS (2.6.18-128.el5)
    	root (hd0,0)
    	kernel /vmlinuz-2.6.18-128.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
    	initrd /initrd-2.6.18-128.el5.img
    
    title Windows XP
              rootnoverify (hd1,0) 
              map (hd0) (hd1)
              map (hd1) (hd0)
              chainloader +1
    
    There are three title lines in grub.conf file and Windows OS title is 4th. default count starts from zero, so the value should be 3 to set Windows OS as default OS.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  8. #8
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    In case it doesn't work, post the output of fdisk -l command here.
    Code:
    su -
    fdisk -l
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  9. #9
    Just Joined!
    Join Date
    Jun 2006
    Posts
    19
    title Windows XP
    rootnoverify (hd1,0)
    map (hd0) (hd1)
    map (hd1) (hd0)
    chainloader +1
    I know the above works. (see my posts 5 and 6). I got there myself. But it only works because I set the BIOS boot sequence to IDE-1 (the Linux drive) as the first hard drive to boot from. If I set it to IDE-0 (the Windows drive), it doesn't work. It was orginally set to IDE-0, and I would like it back that way.

    Here is the fdisk -l
    Disk /dev/hda: 30.7 GB, 30750031872 bytes
    16 heads, 63 sectors/track, 59582 cylinders
    Units = cylinders of 1008 * 512 = 516096 bytes

    Device Boot Start End Blocks Id System
    /dev/hda1 * 1 59559 30017421 7 HPFS/NTFS

    Disk /dev/hdd: 40.8 GB, 40822161408 bytes
    16 heads, 63 sectors/track, 79098 cylinders
    Units = cylinders of 1008 * 512 = 516096 bytes

    Device Boot Start End Blocks Id System
    /dev/hdd1 * 1 208 104391 83 Linux
    Partition 1 does not end on cylinder boundary.
    /dev/hdd2 208 77536 38973690 8e Linux LVM
    [root@roli ~]#

  10. #10
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    GRUB is configured to boot up from Linux Harddisk only and that is a best setup imho.

    If you want to set Windows Harddisk as First Boot Device and use GRUB for dual booting, you have to install GRUB in MBR of Windows Harddisk. Its not a good idea. In this case, both Harddisk/OSes will depend on each other. If anything goes wrong with any Harddisk, none of OS will boot up. I would suggest you not to change current setup.

    Is there any reason for setting Windows Harddisk as IDE-0?
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •