Find the answer to your Linux question:
Results 1 to 7 of 7
I've abandoned an earlier linux installation in another HDD sometime ago, but recently I've discovered that I'm still using some GRUB related thing that is written in the old partition. ...
  1. #1
    Linux Newbie
    Join Date
    Apr 2007
    Posts
    211

    Red face Newbiesque but probably simple GRUB-related confusion

    I've abandoned an earlier linux installation in another HDD sometime ago, but recently I've discovered that I'm still using some GRUB related thing that is written in the old partition. Not the /boot/grub, which is 100% surely on the current partition (as it does not exist in the other disk anymore), but whatever it writes on the MBR, I guess.

    I've tried to install grub to the proper HDD by something like grub-install, and it succeeded partially. Now it does access the correct menu.lst (instead of stopping at the stage 1.5), but when it's load from the proper HDD, somehow if fails to find vmlinuz or whatever it points to on those menu.lst lines.

    I thought that perhaps the HDD assignment as "hda" or "hdb" will change depending on which is the one I'm booting from. But I'm not sure it really makes sense.

    If it does, then I think that all I'd have to do would be to switch the hda and hdb references on menu.lst and fstab. But is it really it?


    Summarizing the situation in a flowchart-like manner:

    Grub's MBR on hdb (current) -> grub menu loads, but fails to boot into linux
    Grub's MBR on hda (old) -> loads the grub menu from hdb, and boots into linux


    I'm not in a hurry to fix it, but I guess it's something good to do before I forget, as I may eventually remove the old HDD for some reason, and go crazy trying to figure what's happening.

  2. #2
    Just Joined! arkolyte's Avatar
    Join Date
    Oct 2008
    Location
    Troutville, Virginia
    Posts
    14
    Try setting hdb before hda in the boot order of your bios settings. It may simply be that the computer is getting confused there. If that doesn't fix it, you might have to erase the old GRUB from the MBR, although I'm not exactly sure how you would go about doing that.

  3. #3
    Linux Newbie
    Join Date
    Apr 2007
    Posts
    211
    Thanks for answering, but I just did some of that.

    Part of what I've tried to describe already involved switching the HDD to boot from on the bios. And I don't think that it's really needed to erase the old grub from the MBR, since it's not been read, as it's not in the HDD I'm trying to boot from. It's somewhat like having to delete something from an HDD that's not even in the computer, I think (but who knows, maybe there's some seemingly illogical behavior going on).

    Besides that, if I somehow delete it before acually fixing the new one, I'd not be able to boot.

  4. #4
    Trusted Penguin jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    4,071
    What you could do is delete everything GRUB related on your machine, then re-install GRUB to the proper HDD using the Super GRUB Disk.
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to Private Messages asking for Linux help. Please, keep it on the public boards.

  5. #5
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,114
    Here's how it works. You have a disk that is set to be
    the boot disk, either by default, or by BIOS setting.
    When the BIOS boots, it loads the MBR of this disk
    into memory and passes control of the computer to it.

    If you have only one disk, The GRUB program in the MBR
    will look for /boot/grub for configuration and next stage.

    When you have a second disk it gets complicated.
    Assume you have two disks, with linux on the first
    one. The situation is the same as above. But now you
    decide to install linux on the second disk, and quit using
    the version on the first disk. Now, the MBR on the first
    disk is still booting, but now goes to the second disk
    for configuration etc. This boots the OS on the second
    disk.

    If you install GRUB on the MBR of the second disk, this will
    not help, because the first disk is booted by the BIOS.

    There are probably a lot of workarounds for this, but if
    you intend to remove the first disk in the future, you
    should probably reverse them, making the second disk
    into the boot disk. It will be necessary to run the supergrub
    cd at that point to update GRUB, because once you swap the
    disks, the BIOS, and GRUB will rename them and get confused

  6. #6
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    2,941
    You will need to fix /boot/grub/menu.lst entry, possibly /etc/fstab and ensure grub is installed to the MBR of the hard drive you want to boot from ...

    If you need further help with this then boot Linux from the hard drive, open a terminal and post the output of the following:-

    Code:
    sudo fdisk -l
    sudo cat /boot/grub/menu.lst
    cat /etc/fstab
    and we will try to figure out what is going on. As rcgreen indicated in the above post if you intend removing the old hdd then you are better fixing grub and config to boot from the second hard drive (the one with Linux on) first.

    The -l is a small L rather than a one in the above code ... if sudo does not work with above commands then use
    Code:
    su -
    fdisk -l
    cat /boot/grub/menu.lst
    cat etc/fstab
    It may also be useful to post the output of
    Code:
    sudo grub
    find /boot/grub/menu.lst
    quit
    as well ... copy find output before typing quit

  7. #7
    Linux Newbie
    Join Date
    Apr 2007
    Posts
    211
    I'm almost sure I already have grub on the MBR of the drive I intend to boot from, but I think that probably I didn't use the correct command to install, specifying what's the situation, so it was installed with incorrect parameters/"assumptions", expecting /boot to be somewhere else.

    I'll make these things and post here again, thanks.

Posting Permissions

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