Announcement

Collapse
No announcement yet.

Dual boot grub - solved

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Dual boot grub - solved

    Most of yesterday I was fighting GRUB.

    At long last I can get into 7.10, but my Win 2000 - oh no. It stay on "Starting up" forever, nothing happens.

    The disks:
    Code:
    sudo fdisk -l
    
    Disk /dev/hda: 28.5 GB, 28520497152 bytes
    255 heads, 63 sectors/track, 3467 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x0f5a8cdf
    
      Device Boot   Start     End   Blocks  Id System
    /dev/hda1  *      1    3467  27848646  83 Linux
    
    Disk /dev/sda: 9105 MB, 9105018880 bytes
    255 heads, 63 sectors/track, 1106 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x00054b55
    
      Device Boot   Start     End   Blocks  Id System
    /dev/sda1        1    1106   8883913+ 83 Linux
    
    Disk /dev/sdb: 2161 MB, 2161218560 bytes
    255 heads, 63 sectors/track, 262 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xb6a889b9
    
      Device Boot   Start     End   Blocks  Id System
    /dev/sdb1  *      1     227   1823346  7 HPFS/NTFS
    /dev/sdb2       228     262   281137+ 82 Linux swap / Solaris
    where

    sda =/
    hda = /home
    sdb1 = windows
    SDB2= swap

    menu.list:

    Code:
    title		Velg operativsystem
    
    makeactive
    
    Title -----------------------------------------------------------
    
    title    Ubuntu 7.10 Gutsy Gibbon
    
    root		(hd0,0)
    kernel		/boot/vmlinuz-2.6.22-14-generic root=UUID=e3eae914-207d-4e7a-af6f-bbf35241c32a ro quiet splash
    initrd		/boot/initrd.img-2.6.22-14-generic
    quiet
    
    title		Windows 2000
    root		(hd1,0)
    savedefault
    makeactive
    chainloader	+1
    
    title		Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
    root		(hd0,0)
    kernel		/boot/vmlinuz-2.6.22-14-generic root=UUID=e3eae914-207d-4e7a-af6f-bbf35241c32a ro single
    initrd		/boot/initrd.img-2.6.22-14-generic
    
    title		Ubuntu 7.10, memtest86+
    root		(hd0,0)
    kernel		/boot/memtest86+.bin
    quiet
    What can I do to make W2000 start?



    #2
    Re: Dual boot grub

    Maybe this will help:
    title Velg operativsystem

    makeactive

    Title -----------------------------------------------------------

    title Ubuntu 7.10 Gutsy Gibbon

    root (hd0,0)
    kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=e3eae914-207d-4e7a-af6f-bbf35241c32a ro quiet splash
    initrd /boot/initrd.img-2.6.22-14-generic
    quiet

    title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
    root (hd0,0)
    kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=e3eae914-207d-4e7a-af6f-bbf35241c32a ro single
    initrd /boot/initrd.img-2.6.22-14-generic

    title Ubuntu 7.10, memtest86+
    root (hd0,0)
    kernel /boot/memtest86+.bin
    quiet

    title Windows 2000
    root (hd1,0)
    savedefault
    makeactive
    chainloader +1
    Bthw what is this supposed to mean?
    title Velg operativsystem

    makeactive

    Title -----------------------------------------------------------
    HP Pavilion dv6 core i7 (Main)
    4 GB Ram
    Kubuntu 18.10

    Comment


      #3
      Re: Dual boot grub

      I see two different hard drives with a "bootable" flag set. Windows has to have it on /dev/sdb, so you must leave that one set. It may work better to take the boot flag off the /dev/sda drive.

      But, if Linux won't boot, then you'll have to put it back.

      Comment


        #4
        Re: Dual boot grub

        Looks like Windows is on a non-first hard drive: (hd1,0) is the second hard drive (hd1), the first partition (partition 0). (GRUB counts from zero.)

        So, try this:

        title Windows
        root (hd1,0)
        map (hd1) (hd0)
        map (hd0) (hd1)
        chainloader +1

        (You may also try rootnoverify (hd1,0) instead of root (hd1,0), but I don’t think that’s the main problem here.)

        Note all the spaces: after root, after map, after chainloader, between (hd1) and (hd0), and between (hd0) and (hd1). Otherwise, you'll get Command Not Found.

        You must edit menu.lst as root, then File > Save, File > Quit.
        How To GRUB Methods - Toolkit
        http://kubuntuforums.net/forums/inde...opic=3081671.0
        Also, if your scroll down the posts, you’ll come to this one:
        Install Windows XP *after* Kubuntu, and install XP to a non-first hard drive: map command
        7-24-07

        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

        Comment


          #5
          Re: Dual boot grub

          First try this:
          Set the boot flag on Linux ON, and turn it Off on Windows, using the map dance. That should work. If not, then play with the boot flags (using GParted patition editor, Partition > Manage Flags > boot). You might be able to do this with both boot flags On. But the big problem is that Windows likes to be on the first hard drive. Since it is on the second hard drive (hd1,0), we need to fool Windows with a virtual switching of drives using the map dance.
          An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

          Comment


            #6
            Re: Dual boot grub

            Thank you all!

            The windows lines are now:

            Code:
            title		Windows 2000
            map (hd1) (hd0)
            map (hd0) (hd1)
            rootverify		(hd1,0)
            
            chainloader +1
            savedefault
            makeactive
            
            quiet
            
            ### END DEBIAN AUTOMAGIC KERNELS LIST
            I have set the boot option "on" for both drives.

            In gparted I note that the Windows partition has a warning sign, and the info on this says:

            Filesystem: ntfs
            Size: 1.74 GiB
            Flags: boot

            Path /dev/sdb1
            Status: Not mounted

            First sector: 63
            Last sector: 3646754
            Total sectors: 3646692

            WARNING:

            Unable to read the contents of this filesystem!
            Because of this some operations may be unavailable

            And the error code has changed to 13: Invalid or unsupported format


            .........................

            The added lines just give me a simpler ""Choose operating system" window at start:

            http://geeklimit.com/2007/10/23/fixing-grub-for-dual-boot-after-710-upgrade/

            Comment


              #7
              Re: Dual boot grub

              So it worked now?


              I'm not sure what that message is about in GParted. Might have to think about that, or someone else might know. Is 1.74 GB the right size for Windows?

              An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

              Comment


                #8
                Re: Dual boot grub

                Oh, it looks like it didn't work.

                Make sure the naming of your drives is correct as seen by BIOS.
                Turn on the PC, when you see the boot menu, press the "c" key to get a GRUB prompt, grub>.
                Type, at the grub prompt,
                grub> geometry (hd1)
                and press Enter.
                Then try grub> geometry (hd1).
                Then try grub> geometry (hd2).

                Can you tell what OSs are on what drives (look at the size and format, for example)? Is the drive naming correct?

                (Soon, I will have to go somewhere this a.m. until maybe late this afternoon, but someone will be around here. This is fixable! It's just a matter of knowing what is where. But that Error message in GParted is a bit disconcerting, as if that partition is damaged or something.)
                An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                Comment


                  #9
                  Re: Dual boot grub

                  In other words, you have three hard drives, hd0, hd1, and hd2.
                  Find out where Windows and Kubuntu are.
                  If Windows is on (hdx,y), then edit your menu.lst accordingly. If x is not zero, ie if Windows is on either hd1 or hd2, then use that map dance with
                  map (hd1) (hd0)
                  map (hd0) (hd1)

                  or, with
                  map (hd2) (hd0)
                  map (hd0) (hd2)

                  Your menu.lst’s might have been generated by the grub from the Linux grub shell, and therefore might not be reliable. On a related note, this has nothing to do with your /boot/grub/device.map either (although it might be the reason your drives may be wrongly guessed, but then that can be edited later and will not affect the success of fixing this for now).
                  An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                  Comment


                    #10
                    Re: Dual boot grub

                    The grub geometry seems to confirm that

                    sda = hd0 = first boot = Linux /
                    sdb = hd1 = second boot = The drive where installed W2000
                    hda = hds = third boot = Linux /home

                    The, what to me looks interesting, parts of the geometry test is:

                    Code:
                    (hd0): drive 0x80 ... sectors 17783240 ... 
                                  partition num: 0 ... ext2fs .... type 0x83
                    
                    (hd1): drive 0x81 ... sectors 4221130 ... 
                                   partition num 0 ... filesystem unknown ... type 0x7 ...
                                   partition num: 1, filesystem unknown ... type 0x82
                    
                    (hd2): drive 0x82 ... sectors 55704096 ...
                                   partition num: ... 0, ext2fs ... type 0x83
                    One thing I remember is this:

                    During W2000 install, I had to remove the first scsi disk, the one that now is sda/hd0/first in boot order, in order for W2000 to accept the disk it is on.

                    Therefore, I assume there is a Windows type mbr still at in the first few sectors of sdb/hd1. Have no idea whether this may be a problem.

                    Other thing is, the BIOS prevents booting from CD with the correct boot order, so I had to change both menu.list and device.map and reset grub in orderto get into Linux.

                    Comment


                      #11
                      Re: Dual boot grub

                      It’s normal and OK for geometry to say “filesystem unknown” for the NTFS partition, and that doesn’t mean anything (good or bad).

                      The MBR of the Windows drive hd1 should have nothing to do with this, as the Windows bootloader should be in the boot sector of the partition (hd1,0). We are using the MBR of the Linux drive to boot all this—that is where you have installed GRUB to (hd0)=MBR of hd0.

                      You can also try to reinstall GRUB to (hd0) from (hd0,0). That involves GRUB commands root (hd0,0), setup (hd0), and quit all at a GRUB prompt, grub>.
                      See the GRUB How-To for exact details.

                      As for your menu.lst and device.map and re-set grub, it looks like you know what you are doing, so that’s OK—Good work on that! Maybe you already did do the root-setup-quit thing to re-install GRUB?

                      Unfortunately, I am now having to leave for an appointment.
                      An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                      Comment


                        #12
                        Re: Dual boot grub

                        So, to re-install GRUB from (hd0,0) to (hd0) (ie, to the MBR of the first-boot drive):

                        Turn on the PC. When you see the boot menu, press the "c" key to get a GRUB prompt, grub>. Then type these commands at the prompt, each followed by Enter:

                        grub> root (hd0,0)
                        grub> setup (hd0)
                        grub> quit
                        $ exit
                        reboot to test it

                        (You can also do these from a Kubuntu Live CD if you can't get a boot menu at which to press the "c" key. In that case, from the Live CD, K > System > Konsole, type sudo grub, that gives you the GRUB prompt, then the commands root-setup-quit, $exit, exit Kubuntu, eject CD, close CD tray, re-boot to test it.)
                        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                        Comment


                          #13
                          Re: Dual boot grub

                          Quite obviously, there's something confused about the device references (ie, the (hdx,y)'s).
                          In your first post and in your reply #9, sda is the Linux drive, but there's no boot flag set on it. Are you sure it is booting from sda and sda is Linux? One of these drives is data, so if GRUB accidentally tries to access it, there will be an error.

                          Now here's the theory:
                          When you turn on the PC or re-boot it, the drive that the PC boot up "with" is always seen by BIOS (and, therefore, by GRUB) as hd0. This is true whether the PC boot s up with a hard drive, and external drive, or a flash drive. After it is booted up then, the other drives--from the point of view of the GRUB on the boot drive-- are seen as hd1, hd2, etc. In fact, when the PC boots up to a drive, if somehow you can get a "native" GRUB prompt, for example, by interrupting the GRUB boot menu by pressing the "c" key, you can use geometry (hdx) command to see how BIOS/GRUB sees your drives. (Not necessarily true if you get into Kubuntu/Linux at Konsole and get a grub> and use the grub shell from Linux--then that grub shell uses device.map and, as we all know, device.map can be all goofed up, especially when there's a mixture of IDE and SATA drives. When your PC actually boots up, it does not check the device.map--the native GRUB, the one you see when the PC is booting, always gets the drives correct on boot up.)

                          So that's the theory. And obviously, your BIOS seems to be seeing these drives differently than how we have named them in the menu.lst using the (hdx,y) notation. In particular, if GRUB thinks it's going for a Linux OS and finds Windows, well, that's an error; or if GRUB looks for any OS and finds data instead, there's an error. As for the boot flags, you can play with them, but your BIOS order should rule there; however, removing it on the Windows drive might help. But it looks like the device naming, the drive ordering, doesn't line up. You were wondering about the MBR on the Windows drive. Since we are not booting from it, it shouldn't be a factor--we are only chainloading to the boot sector of the Windows partition; however, if you ever needed it, the Windows bootloader is (probably) installed to the first 512 Bytes of that disk, the MBR, and so it should be bootable.
                          An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                          Comment


                            #14
                            Re: Dual boot grub

                            This beats any murder story

                            What I have done is:

                            Tried the disks one by one alone.

                            sda -> Linux boots but without /home.
                            sdb -> Win2000, no problem
                            hda -> Grub error.

                            So, there are two disks with Grub installed - could the problem be that?

                            Then I changed the boot options

                            sda and sdb boot flag
                            just sda boot flag

                            Then I removed the hda and reran the grub commands (root (hd0,0) and so on.
                            The only thing is, "quit" doesn't work, so I did use "restart".

                            Nothing helps.

                            I've checked my device.map file:

                            Code:
                            (hd0)	/dev/sda
                            (hd1)	/dev/sdb
                            (hd2)	/dev/hda
                            Looks OK to me.

                            I've followed the BIOS booting closely:

                            It is like this:

                            First the IDE CD.
                            Second sda - identified as 2 on the SCSI bus, and then 0
                            Third sdb - identified as 4 on the SCSI bus, and then 1.
                            Third hda - identified as E: on the RAID controller.

                            I've tried playing with the BIOS startup order - don't change a thing.

                            Dolphin can't open sdb (NTFS) - it sais hal-storage-fixed-mount-all-options refused uid 1000. But as I read your theoretical description - whether Linux "likes" this drive or not should be of no consequence.

                            Good thing - I learn a lot, thanks to good help here.

                            Edit:

                            I can also start W2000 by changing the boot option in SCSI BIOS, with all the disks present.

                            Comment


                              #15
                              Re: Dual boot grub

                              That you have GRUB installed in more than one place is not a problem (I and other GRUB guys I know install GRUB to every MBR and to most Linux partitions, at the same time).

                              I picked up your RAID controller! That’s (1) out of my area of experience, and (2) seems to cause these problems!

                              And I picked up that message you are getting: hal-storage-fixed-mount-all-options refused uid 1000.
                              If you search here on that, you’ll find it’s popped up many times here. I don’t what it is about, but there’s been a few recent posts on it.

                              Fact is, I believe that your work is correct, that you have identified your drives correctly. GRUB is in the MBR of the first-BIOS drive and controls the boot menu when you first turn on the PC. Your menu.lst and device references (hdx,y) look right. Then we have that RAID controller – who knows what problems it causes. How does it affect how BIOS/GRUB handles these drives or sees them exactly? I don’t know, but RAID always seems to be the showstopper in things like this.

                              I’ll have to think about it, and maybe others will catch something here – we need a RAID user to pop in here.


                              EDIT: You edited: "I can also start W2000 by changing the boot option in SCSI BIOS, with all the disks present."

                              --Yes, so again, it seems the disks are working and bootable by the bootloaders installed to their MBRs. So, again, is RAID messing this up?
                              An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                              Comment

                              Working...
                              X