Page 93 of 103 FirstFirst ... 43839192939495 ... LastLast
Results 921 to 930 of 1028

Thread: How to install Grub from a live Ubuntu cd.

  1. #921
    Join Date
    Jul 2009
    Beans
    54

    Re: How to install Grub from a live Ubuntu cd.

    Any help on how to make GRUB refresh the list of partitions/systems? I posted this question here, no answer:
    http://ubuntuforums.org/showthread.p...75#post7647675

  2. #922
    Join Date
    Mar 2008
    Beans
    4,714
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: How to install Grub from a live Ubuntu cd.

    Abdus, each time you install an Ubuntu distribution and allow it to install grub, it scans your system for operating systems and writes a GRUB menu.lst which lists a boot option for each OS found.

    The same would be true of most major Linux distros (Fedora, SUSE, etc).

    So if you allow the last Linux distro to install GRUB to the MBR, you should be all set.
    GRUB would read the /boot/grub/menu.lst in that last Linux distro's partition and you should see a boot option for each OS on your system.

    If you want to regenerate the /boot/grub/menu.lst, then the command you looking for is
    Code:
    sudo update-grub
    If you can not boot Ubuntu directly but can boot from a LiveCD, then you can generate the menu.lst by doing the following:

    Boot from the Ubuntu LiveCD
    Open a terminal (Applications>Accessories>Terminal). Type
    Code:
    sudo mount /dev/sda5 /mnt
    Change sda5 to the correct name for your Linux root partition. If you have multiple Linux OSes installed, you must name the Linux root partition that is controlling the boot process. Usually that would be the last OS you installed.

    Then type:
    Code:
    cd /mnt
    sudo mount --bind {/,}proc
    sudo mount  --bind {/,}sys
    sudo mount  --bind {/,}dev
    sudo chroot /mnt
    grep -v rootfs /proc/mounts > /etc/mtab
    update-grub

  3. #923
    Join Date
    Jul 2009
    Beans
    54

    Re: How to install Grub from a live Ubuntu cd.

    Quote Originally Posted by unutbu View Post
    Abdus, each time you install an Ubuntu distribution and allow it to install grub, it scans your system for operating systems and writes a GRUB menu.lst which lists a boot option for each OS found.

    The same would be true of most major Linux distros (Fedora, SUSE, etc).

    So if you allow the last Linux distro to install GRUB to the MBR, you should be all set.
    GRUB would read the /boot/grub/menu.lst in that last Linux distro's partition and you should see a boot option for each OS on your system.
    I understand that, thank you. However it would feel much more safe to have the MBR managed only by one OS, i.e. my Ubuntu Jaunty, which is my main system, and the only one for everyday use. The other systems (windowses, linuxes) are just auxiliary, for testing purposes, and I don't want to let them manage my MBR for more than a few minutes reuired to restore it.

    Quote Originally Posted by unutbu View Post
    If you want to regenerate the /boot/grub/menu.lst, then the command you looking for is
    Code:
    sudo update-grub
    This command did not reread the partitions/systems anew, it just restored the menu as it was before.

    Quote Originally Posted by unutbu View Post
    If you can not boot Ubuntu directly but can boot from a LiveCD, then you can generate the menu.lst by doing the following: [...]
    After installing auxiliary OS's I restore my GRUB using the Ubuntu alternative installation CD, using the menu there ("install GRUB" or similar). This procedure works, however it just restores previous config instead of rereading patitions/systems anew. Would doing what you suggested by the GRUB console reread those?

    Thanks for help!
    Last edited by Abdus; July 21st, 2009 at 11:22 AM.

  4. #924
    Join Date
    Mar 2008
    Beans
    4,714
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: How to install Grub from a live Ubuntu cd.

    Ah, I see. I think the Ubuntu installer has some kind of script to detect partitions containing operating systems and then generate the appropriate boot stanzas in menu.lst. I don't know enough about the Ubuntu installer to tell you how to rip out that script so that you may run it independently.

    There is no GUI for doing this either, as far as I know.

    However, it is not really very hard to edit the menu.lst manually.
    While booted into your main Linux OS (Jaunty), mount the last installed Linux distro at, say, /mnt:
    Code:
    sudo mount /dev/sda? /mnt
    (again change sda? to the appropriate name).

    Then open an editor with root privileges:
    Code:
    gksu gedit /mnt/boot/grub/menu.lst
    and open your "controlling" menu.lst. (Click the "Open" button and open /boot/grub/menu.lst.)

    Near the bottom of /mnt/boot/grub/menu.lst will be boot stanzas for each of your other operating systems. You can simply copy those stanzas and paste them into Jaunty's menu.lst.

  5. #925
    Join Date
    Jul 2009
    Beans
    54

    Re: How to install Grub from a live Ubuntu cd.

    That is an excellent tip, unutbu, thank you for it, I'll try it with no doubt! Are you sure that partitions UUIDs are same in both the linuxes on my machine though?

    PS. I still find it unbelieevable that so well established and already old app as GRUB has no "rread" option. Amazing, isn't it?

  6. #926
    Join Date
    Jul 2009
    Beans
    1

    Re: How to install Grub from a live Ubuntu cd.

    this is it. thank you. u rock!!!

  7. #927
    Join Date
    Apr 2008
    Beans
    10

    Re: How to install Grub from a live Ubuntu cd.

    Quote Originally Posted by unutbu View Post
    chanklor, GRUB reads files in your ubuntu partition (such as /boot/grub/menu.lst and stage2) during the boot process. Since you've removed the ubuntu partition, GRUB is no longer viable.

    To regain the ability to boot Vista, you'll need to restore the default Vista MBR (master boot record). Here are instructions on how to do that:

    http://ubuntuforums.org/showthread.php?t=740221
    thanks a lot! exactly what i needed
    thansk thanks thanks!

  8. #928
    Join Date
    May 2009
    Beans
    23

    Re: How to install Grub from a live Ubuntu cd.

    :/ anyone know how to fix my problem? frmo the previous page

  9. #929
    Join Date
    May 2009
    Beans
    2

    Smile Re: How to install Grub from a live Ubuntu cd.

    This worked with me.
    Thanks a lot.

    Quote Originally Posted by catlett View Post
    Please try the chroot grub-install and post what happens. Like I said I saw the how to when I didn't understand commands and never saw it again. Then I saw the grub manual describing the find, root, setup commands and I went with that.I think find, root, setup doesn't return the bios error because they are given from the grub shell.
    Just for FYI, this is the error I get with grub-install from the live session.
    Code:
    ubuntu@ubuntu:~$ sudo grub-install /dev/hda
    Probing devices to guess BIOS drives. This may take a long time.
    Could not find device for /boot: Not found or not a block device.
    This is the output of find, root, setup

    Code:
    grub> find /boot/grub/stage1
     (hd0,1)
     (hd0,10)
    
    grub> root (hd0,10)
     Filesystem type is ext2fs, partition type 0x83
    
    grub> setup (hd0)
     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)"... failed (this is not fatal)
     Running "embed /boot/grub/e2fs_stage1_5 (hd0,10)"... failed (this is not fatal
    )
     Running "install /boot/grub/stage1 d (hd0) /boot/grub/stage2 p /boot/grub/menu
    .lst "... succeeded
    Done.

  10. #930
    Join Date
    Aug 2008
    Beans
    70

    Re: How to install Grub from a live Ubuntu cd.

    July 27,

    A vista update seems to have eaten part of my grub. Anyway, with this post and the help of others, I got it working again.

    If the original submitter still reads, adding how to find the (hdx,y) would help. The "find /boot/grub/stage1" is not working on my installation. I had to do : find "/grub/stage1" . Searching for /boot/grub/stage1 resulted in an Error 15 : File not found.

    I suppose any combination of
    /boot/stage1
    /boot/grub/stage1
    /grub/stage1
    /stage1

    might return something.

Page 93 of 103 FirstFirst ... 43839192939495 ... 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
  •