Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: grub problem after installing ubuntu

  1. #1
    Join Date
    Dec 2008
    Beans
    70

    grub problem after installing ubuntu

    Hi,

    I got a grub problem while installing ubuntu 12.04.

    At first, win xp ran on my pc and it has drivers of C/D/E. Then I free driver C and install ubuntu 12.04 on it by setting up swap area and root /. The installation goes well until almost the last step which prompts error "executing update-grub failed". After restarting the system, it goes to the black screen with:

    Error: ELF header smaller than expected
    grub rescue>

    I followed this instruction https://help.ubuntu.com/community/Boot-Repair

    After clicking the "Recommended repair" button, I got the message "Please close all your package managers (Software Center, Update Manager, Synaptic, ...). Then try again. But I'm not running any package managers!

    Here is the Boot Reapir link:

    http://paste.ubuntu.com/5719103/

    Thanks for the help

    Li
    Last edited by lidengdeng; April 26th, 2013 at 06:27 PM.

  2. #2
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: grub problem after installing ubuntu

    Boot-Repair could not run any updates as sda1 was mounted read-only for some reason. It may need fsck?

    You also overwrote c: or your Windows boot partition. Was that your intent? Ubuntu will read the other NTFS partitions but if you keep NTFS you should really have Windows or a Windows repairCD as you may need to run chkdsk occasionally on the NTFS partitions and you cannot do that from Linux.

    Lets run this to see if it clears the read-only issue.
    #From liveCD so everything is unmounted,swap off if necessary, change example shown with partition sda1 to your partition(s)
    #e2fsck is used to check the ext2/ext3/ext4 family of file systems. -p trys fixes where response not required
    sudo e2fsck -C0 -p -f -v /dev/sda1
    #if errors: -y auto answers yes for fixes needing response see man e2fsck
    sudo e2fsck -f -y -v /dev/sda1

    Manually fix grub install:

    https://help.ubuntu.com/community/Grub2/Installing
    Reinstall grub2 - Short version & full chroot version
    https://help.ubuntu.com/community/Gr...alling%20GRUB2
    Grub2 info & full chroot version - also see METHOD 3 - CHROOT:
    https://wiki.ubuntu.com/Grub2#Recove...20via%20LiveCD
    How to restore the Ubuntu/XP/Vista/7 bootloader (Updated for Ubuntu 9.10 and later with grub2) by talsemgeest
    https://help.ubuntu.com/community/Re...ta/7Bootloader


    #Comments are anything after the #, enter commands in terminal session
    #Install MBR from liveCD/DVD/USB, Ubuntu install on sda1 and want grub2's bootloader in drive sda's MBR:
    #Find linux partition, change sda1 if not correct:
    sudo fdisk -l
    #confirm that linux is sda1
    sudo mount /dev/sda1 /mnt
    sudo grub-install --root-directory=/mnt/ /dev/sda
    # The above command should work but they now suggest this command for grub 1.99 with Natty 11.04 or later - uses boot not root.:
    sudo grub-install --boot-directory=/mnt/boot /dev/sda
    #If that returns any errors run:
    sudo grub-install --recheck --root-directory=/mnt/ /dev/sda

    # If no errors on previous commands reboot into working system and run this:
    sudo update-grub
    For info on UEFI boot install & repair:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







  3. #3
    Join Date
    Dec 2008
    Beans
    70

    Re: grub problem after installing ubuntu

    Thanks for your reply.

    I got some important documents in D and E drivers, but my windows dumped.. That's why I wanna to install ubuntu on C driver and keep D and E.

    When installing ubuntu, it takes a long time at the step "Looking for other operating systems". Will it detect my windows OS because of NTFS format of D and E? C has already been formatted.

    And if both D and E are formated and used in ubuntu, will I get the same grub issue?

  4. #4
    Join Date
    Dec 2008
    Beans
    70

    Re: grub problem after installing ubuntu

    Thanks for your reply.

    I got some important documents in D and E drivers, but my windows dumped.. That's why I wanna to install ubuntu on C driver and keep D and E.

    When installing ubuntu, it takes a long time at the step "Looking for other operating systems". Will it detect my windows OS because of NTFS format of D and E? C has already been formatted.

    And if both D and E are formated and used in ubuntu, will I get the same grub issue?

  5. #5
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: grub problem after installing ubuntu

    The os-prober scans all partitions looking for operating systems. If you only have one, you can turn that off until you install another. If it is running slow, it may be normal as NTFS does not mount as quick as native Linux formats, but a chkdsk may speed it up.

    In /etc/default/grub I added this:
    gksudo gedit /etc/default/grub
    GRUB_DISABLE_OS_PROBER=true
    or turn off executeable bit
    sudo chmod a-x /etc/grub.d/30_os-prober
    sudo update-grub
    For info on UEFI boot install & repair:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







  6. #6
    Join Date
    Dec 2008
    Beans
    70

    Re: grub problem after installing ubuntu

    But where I can run the command?

    gksudo gedit /etc/default/grub
    GRUB_DISABLE_OS_PROBER=true

    I am using usb stick for installation. Should I change the /etc/default/grub file on the usb before installing ubuntu?

    Thanks,

  7. #7
    Join Date
    Nov 2009
    Location
    Segur De Calafell, Spain
    Beans
    11,660
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: grub problem after installing ubuntu

    No need to do anything for os-prober during the install, oldfred is talking about once you have the system installed I guess.

    But it didn't install correctly, out of what ever reason. There is no /boot/grub/grub.cfg on sda1 and no kernels.

    I would try the install again. Select the manual method, select sda1, Change button, then set Use As ext4, mount point /, and tick the format box.
    The device for bootloader should be /dev/sda.

    Let the install finish and see if it works.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 12.04 LTS 64bit & Windows 7 Ultimate 64bit

  8. #8
    Join Date
    Dec 2008
    Beans
    70

    Re: grub problem after installing ubuntu

    Quote Originally Posted by darkod View Post
    No need to do anything for os-prober during the install, oldfred is talking about once you have the system installed I guess.

    But it didn't install correctly, out of what ever reason. There is no /boot/grub/grub.cfg on sda1 and no kernels.

    I would try the install again. Select the manual method, select sda1, Change button, then set Use As ext4, mount point /, and tick the format box.
    The device for bootloader should be /dev/sda.

    Let the install finish and see if it works.
    As you said, I re-install it for a few times by select sda1 as mount point1 with ext4. The device for bootloader automatically choose /dev/sda.

    The installtion always resulted in update-grub failed error, and rebooting goes to the screen with "grub rescure" command.

  9. #9
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: grub problem after installing ubuntu

    Do you have a BIOS with bitlocker or simlar method to lock BIOS and prevent writing into MBR?

    Sometimes BIOS settings make a difference.
    For info on UEFI boot install & repair:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







  10. #10
    Join Date
    Dec 2008
    Beans
    70

    Re: grub problem after installing ubuntu

    Thanks for the pointer. But where can I change the setting by unlocking and allowing writing into MBR?

    Quote Originally Posted by oldfred View Post
    Do you have a BIOS with bitlocker or simlar method to lock BIOS and prevent writing into MBR?

    Sometimes BIOS settings make a difference.

Page 1 of 2 12 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
  •