Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Grub on wrong drive (!?) + dual boot questions

  1. #1
    Join Date
    May 2006
    Location
    Columbia, MO.
    Beans
    149
    Distro
    Ubuntu 12.04 Precise Pangolin

    Grub on wrong drive (!?) + dual boot questions

    Hey y'all,
    I have two hard drives on my system now, one just for misc. storage and one for my main drive.
    I'm planning on replacing my secondary storage drive with a larger one, and using it for a separate Windows XP setup.
    However, when I switched out my second drive, the computer wouldn't boot! It turns out, for some reason, Grub is not on my main drive; it's on the smaller secondary drive that I need to replace!
    So what I need to do is install Grub on my main drive...so I can install XP on the other new drive I just got.

    Any tips on how to do this? I'd prefer not to mess with my current Ubunbu install if I don't have to (aside from installing Grub, of course!)

    And then, how would I set up Windows on the other?

    Many thanks,
    -C
    Ubuntu... [ok]

  2. #2
    Join Date
    Jun 2006
    Beans
    7,419
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Grub on wrong drive (!?) + dual boot questions

    simply reinstall grub from live cd (see link my signature)

  3. #3
    Join Date
    May 2006
    Location
    Columbia, MO.
    Beans
    149
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Grub on wrong drive (!?) + dual boot questions

    Thanks for the reply.
    I went through the procedure and I'm suitably confused, of course...

    Here is my fstab:
    Code:
    # /etc/fstab: static file system information.
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc            /proc           proc    defaults        0       0
    # /dev/sda1
    UUID=a3bcad50-bac1-430a-ae5e-8abff8353b73 /               ext3    defaults,erro$
    # /dev/sda5
    UUID=101d4077-f824-41bb-9196-16fef228a962 none            swap    sw           $
    /dev/hda        /media/cdrom0   udf,iso9660 user,auto     0       0
    ##/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0
    /dev/sdb1       /media/music    vfat    rw,user
    /dev/sdb1 is where grub is at right now.
    /dev/sda1 (or is id sda5?) is where my ubuntu installation is.

    Output of Grub:
    Code:
    grub> find /boot/grub/stage1
     (hd1,0)
    I tried setting up grub on hd0 and hd1, and my computer will still only boot from sdb1.

    Not sure what to try next. This is the first time I've messed with this stuff...not sure how /sdb1 and /sda1 translate into hard drive numbers.

    Thanks,
    -C
    Ubuntu... [ok]

  4. #4
    Join Date
    Jun 2006
    Beans
    7,419
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Grub on wrong drive (!?) + dual boot questions

    Quote Originally Posted by Culito View Post
    /dev/sda1 (or is id sda5?) is where my ubuntu installation is.

    Output of Grub:
    Code:
    grub> find /boot/grub/stage1
     (hd1,0)
    I tried setting up grub on hd0 and hd1, and my computer will still only boot from sdb1.
    sda1 is root partition

    you have to edit menu.lst to match.

    gksudo gedit /boot/grub/menu.lst

    -change 'groot' and 'root' lines to (hd0,0)

    Reboot. If the other drive is still connected, enter the Bios and set the ubuntu drive first.

  5. #5
    Join Date
    Mar 2008
    Location
    California, USA
    Beans
    8,111

    Re: Grub on wrong drive (!?) + dual boot questions

    Quote Originally Posted by Culito View Post
    Hey y'all,
    I have two hard drives on my system now, one just for misc. storage and one for my main drive.
    I'm planning on replacing my secondary storage drive with a larger one, and using it for a separate Windows XP setup.
    However, when I switched out my second drive, the computer wouldn't boot! It turns out, for some reason, Grub is not on my main drive; it's on the smaller secondary drive that I need to replace!
    So what I need to do is install Grub on my main drive...so I can install XP on the other new drive I just got.

    Any tips on how to do this? I'd prefer not to mess with my current Ubunbu install if I don't have to (aside from installing Grub, of course!)

    And then, how would I set up Windows on the other?

    Many thanks,
    -C
    Logos34, from Culito's post above it sounds like what he wants to do is install Grub on his main HDD (hd0), and be able to use it while his secondary HDD is disconnected. Is this correct, Culito?

    If that is true, he will need some place on his main HDD for the Grub configuration files in /boot/grub. He could do like I have done, and create a small partition on the main HDD, say 50 MB, for his /boot/grub files. That way he will have Grub installed entirely to the main HDD, and disconnecting his secondary HDD will not cause him problems since Grub will be independent of his secondary HDD. Also, Grub will be entirely independent of all his operating systems.

    Would the above scenario work for you, Culito, or did I misinterpret what you said?

  6. #6
    Join Date
    Jun 2006
    Beans
    7,419
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Grub on wrong drive (!?) + dual boot questions

    Quote Originally Posted by caljohnsmith View Post
    Logos34, from Culito's post above it sounds like what he wants to do is install Grub on his main HDD (hd0), and be able to use it while his secondary HDD is disconnected....

    If that is true, he will need some place on his main HDD for the Grub configuration files in /boot/grub. He could do like I have done, and create a small partition on the main HDD, say 50 MB, for his /boot/grub files. That way he will have Grub installed entirely to the main HDD, and disconnecting his secondary HDD will not cause him problems since Grub will be independent of his secondary HDD.
    You misunderstand about how grub works. Grub is installed on his main ubuntu drive (otherwise he wouldn't be able to boot into it at all!)...The only thing that's on the secondary storage disk is the tiny grub stage1/1.5 file on the MBR...it points to /boot/grub on the ubuntu disk, where it fetches the menu.lst at boot. All Culito needs to do is write the grub bootloader code to the MBR of the ubuntu disk, then edit the 'root' lines in menu.lst to reflect the new location of the ubuntu drive as the boot disk -- i.e. (hd0)...

  7. #7
    Join Date
    May 2006
    Location
    Columbia, MO.
    Beans
    149
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Grub on wrong drive (!?) + dual boot questions

    cal, that is exactly the scenario.
    This is what I'm doing:

    Code:
    sudo grub
    find /boot/grub/stage1
    output:
    (hd1.0)

    Code:
    root (hd1,0)
    setup (hd0)
    output:
    Checking if "/boot/grub/stage1" exists... yes
    Checking if "/boot/grub/stage2" exists... yes
    Checking if "/boot/grub/e2fs_stage1_5" exists... yes
    Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 17 sectors are embedded.
    succeeded
    Running "install /boot/grub/stage1 d (hd0) (hd0)1+17 p (hd1,0)/boot/grub/stage
    2 /boot/grub/menu.lst"... succeeded
    Done.

    Then I change my menu.lst groot and root entries to hd0,0...and no go.

    It will still only boot if I select my secondary hard drive to boot from, and then I have to select the recovery kernel (set for hd1,0 in menu.lst) because it cant find the files in hd0,0....

    That's all I can figure out for now...
    Ubuntu... [ok]

  8. #8
    Join Date
    Mar 2008
    Location
    California, USA
    Beans
    8,111

    Re: Grub on wrong drive (!?) + dual boot questions

    Logos34, please correct me if I'm wrong, but here is how I understand it from the info Culito provided:
    • According to his fstab, Ubuntu is on sda1.
    • Yet when he does "find /boot/grub/stage1" in Grub's CLI, it returns (hd1,0) and not (hd0,0). So Grub thinks Ubuntu is on the second HDD, not the first.

    That would mean that to install Grub to the MBR of the same HDD that Ubuntu is on, he could do:
    Code:
    sudo grub
    grub> root (hd1,0)
    grub> setup (hd1)
    Then the only thing left will be to make sure his menu.lst is correct, and make sure BIOS has the proper boot order so it will boot the HDD with Ubuntu on it.

    EDIT: Culito, try the commands above that use "setup (hd1)" instead of the "setup (hd0)" you used and I believe it should work. Also in your menu.lst for the Ubuntu entries, you should try (hd1,0), but it looks like that may be dependent on whether you have your other HDD connected.
    Last edited by caljohnsmith; August 8th, 2008 at 05:32 PM.

  9. #9
    Join Date
    Jun 2006
    Beans
    7,419
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Grub on wrong drive (!?) + dual boot questions

    Culito,

    You wanted

    root (hd1,0)

    setup (hd1)
    like Caljohnsmith said, BUT you want menu.lst to read 'root (hd0,0)' because as soon as you switch the Bios to boot from the ubuntu drive it will be seen as '(hd0)'

  10. #10
    Join Date
    May 2006
    Location
    Columbia, MO.
    Beans
    149
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Grub on wrong drive (!?) + dual boot questions

    Aha!
    That did it. However, the plot thickens!!

    I guess the root file system is also on my storage drive!! If I boot up from my main drive now, it just sits and waits at "waiting for root file system"...

    Crap. It looks like it might be time for a backup and fresh install, with only ONE hd hooked up this time!! I have no idea how ubuntu would have installed this way.

    Thanks for your help, guys.
    Ubuntu... [ok]

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

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