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

Thread: Reinstalling grub using grub-install (without LiveCD)

  1. #1
    Join Date
    Sep 2010
    Beans
    13
    Distro
    Ubuntu 10.04 Lucid Lynx

    Question Reinstalling grub using grub-install (without LiveCD)

    Recently, I needed to reinstall GRUB2 from LiveCD.

    I had 2 instances of ubuntu (in addition to WinXP in /dev/sda2 ) - 10.04 in /dev/sda6 and then development 10.10 in /dev/sda7 which I installed few days ago after WinXP and 10.04, just to check it out. I wanted to delete 10.10 and since GRUB2 was part of it, I needed to reinstall it after deletion.

    Following recommendations (many thanks to Rubi1200 for explanations and link to BootInfoScript) I've deleted partition with 10.10, then booted with LiveCD and installed GRUB2 so it becomes again part of 10.04 (as it was before installing 10.10). I had no problems at all doing it.

    The question I would like to ask : would it be possible to achieve the same without booting from LiveCD by doing the follows ?

    1. Boot to 10.04 Ubuntu /dev/sda6
    2. Delete partition /dev/sda7 with 10.10 (and GRUB2 which was part of it)
    3. Issue sudo grub-install /dev/sda

    This would save booting from LiveCD

    Any disadvantages/pitfalls vs LiveCD approach ?
    Last edited by sl789; September 26th, 2010 at 10:45 PM.

  2. #2
    Join Date
    Jul 2008
    Location
    Maryland
    Beans
    1,537
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Reinstalling grub using grub-install (without LiveCD)

    If I understand what you said the answer would be yes! I think what you meant was that you would use the grub installed to 10.10 to boot to 10.04 in its own partition. From the 10.04 session you would be able to delete the 10.10 partition including its grub and use the grub-install command to reinstall grub so that it would boot to the 10.04 install.

    I have actually been able to do a similar thing.
    Last edited by ronparent; September 26th, 2010 at 10:57 PM.
    12.10 Quantal w/grub2/Mint13 installed on raid0, Gigabyte AMD MB, AMD 64x4 CPUs at 3.2GHz, 16 GB ram, HD7770 ATI video, dual boot win7 on 64gb ssd and win8 on 1Tb SATA raid. 13.04 installed on raid0 and ssd

  3. #3
    Join Date
    Sep 2010
    Beans
    13
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Reinstalling grub using grub-install (without LiveCD)

    Hi Ronparent !

    >I think what you meant was that you would use the grub installed to 10.10 to boot to >10.04 in its own partition.

    That's correct (after installation of 10.10 I had a triple boot system - WinXP, 10.04 and 10.10). The only reason I didn't like LiveCD is that it took a long time to boot from it.

    So I thought, for the future, if I decide to install some Ubuntu development version along side the main one, I would be able to uninstall it easily. (My problm also was that when installing 10.10, I choose to check option "nstall bootloader", otherwise it would be enough just to boot to 10.04, delete partition with 10.10 and then run update-grub)

  4. #4
    Join Date
    Feb 2009
    Beans
    29

    Re: Reinstalling grub using grub-install (without LiveCD)

    Hi s1786,

    how do you did the installation without CD. I have a same problem to resolve.

    have only ubuntu 8.10 in my computer, and trying to desinstall some tools and make more free space to do the update to ubuntu 9, I have deleted some system-files (python), and my OS become defected , no internet connexion, no graphic interface, ...

    my ubuntu CD is defected too and shows ubiquited error. I can only boot from it, but can not install the install packet which is in the desktop.

    I have downloaded the .iso version 10.04 but the grub failed

    I have followed this link
    https://help.ubuntu.com/community/In...tion/FromLinux

    but in step3, I founed /etc/grub.d/20_memtest86+ instead of /etc/grub.conf or /boot/grub/menu.lst or /etc/grub.d/40_custom and I have added the following files in my 20_memtest86+

    menuentry "installer" {
    insmod ext2
    set root=(hd0,1)
    linux /casper/vmlinuz boot=casper root=/dev/ram1 ramdisk_size=1048576 rw
    initrd /casper/initrd.lz
    }


    Thanks for help

  5. #5
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Reinstalling grub using grub-install (without LiveCD)

    Quote Originally Posted by ka3sem View Post
    the grub failed

    I have followed this link
    https://help.ubuntu.com/community/In...tion/FromLinux
    Thanks for help
    The link is incomplete - it doesn't contain a valid address:
    https://help.ubuntu.com/community/In...tion/FromLinux

    Without seeing the link's contents, I can say that 20_memtest86+ is not the file you want to try to add any menuentry. It is most likely meant to go into the /etc/grub.d/40_custom file (if you are using Grub2).

    As a minimum, post the correct link and tell us what version of Grub you are using:
    Code:
    grub-install -v
    Back to Xorg...

    Retired.

  6. #6
    Join Date
    Feb 2009
    Beans
    29

    Re: Reinstalling grub using grub-install (without LiveCD)


  7. #7
    Join Date
    Feb 2009
    Beans
    29

    Re: Reinstalling grub using grub-install (without LiveCD)

    I don t know which grub-version I am using, but as I can t find the grub.cfg file, I estimate I use grup 2. How can I verify it

  8. #8
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Reinstalling grub using grub-install (without LiveCD)

    We still don't know which version of Grub you are using, but if you are using Lucid or Maverick it is Grub 2. Karmic could be either Grub legacy (0.97) or Grub 2 (1.96 or later).

    You can open a root text editor. If you are using Grub2, this command should open the first tab to /etc/grub.d/40_custom. It will have about 6 lines of text, with nothing else. You would add the contents from your previous post at the end of what currently exists:
    Code:
    gksu gedit /etc/grub.d/40_custom /boot/grub/menu.lst
    Contents of 40_custom:
    Code:
    #!/bin/sh
    exec tail -n +3 $0
    # This file provides an easy way to add custom menu entries.  Simply type the
    # menu entries you want to add after this comment.  Be careful not to change
    # the 'exec tail' line above.
    If the file opens and is completely blank, you don't have a 40_custom file and might be using Grub legacy. If that is the case, edit the menu.lst file which will open in the second tab in Gedit.
    Back to Xorg...

    Retired.

  9. #9
    Join Date
    Feb 2009
    Beans
    29

    Re: Reinstalling grub using grub-install (without LiveCD)

    whith grub-install -v, I obtain

    grub-install (GNU GRUB 0.97)

    is that means my version is 0.97

  10. #10
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Reinstalling grub using grub-install (without LiveCD)

    Quote Originally Posted by ka3sem View Post
    whith grub-install -v, I obtain

    grub-install (GNU GRUB 0.97)

    is that means my version is 0.97
    Yes, so you would edit the second tab - the menu.lst file.
    Back to Xorg...

    Retired.

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
  •