Page 39 of 94 FirstFirst ... 2937383940414989 ... LastLast
Results 381 to 390 of 931

Thread: Grub 2 Basics

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

    Re: Grub 2 Basics

    Quote Originally Posted by kansasnoob View Post
    I've been doing some comparisons between two separate Lucid installs on my machine and I have an anomaly.

    I'm wondering if I should file a bug report?
    I just updated today and chose the maintainer's version. It matches your second entry, which has been the standard. I don't know how your first entry was created, but since the second (latest) is correct, unless you can duplicate the first one I wouldn't file a bug quite yet.
    Back to Xorg...

    Retired.

  2. #382
    Join Date
    Aug 2008
    Location
    South East Montana
    Beans
    6,153

    Re: Grub 2 Basics

    Where these installed before or after the recent grub updates?

    If before, I would remove and install grub and see what happens. I would save a copy of all the files pertaining to grub.

    I had to reinstall grub on one of my installs because it was having trouble replacing some of the files. The rest of the installs had no problem.
    Dell 480 XPS 3G ram Quad Core 2.40GHz, Radeon HD 2400 PRO, Audigy1, 3x320G HDD, 320G External, Debian Testing for use, Debian Squeeze for secure use, Debian Sid for FUN

  3. #383
    Join Date
    Dec 2006
    Location
    Stockholm
    Beans
    317
    Distro
    Ubuntu 17.04 Zesty Zapus

    Re: Grub 2 Basics

    Quote Originally Posted by kansasnoob View Post
    Would you please post the full output from the Boot Info Script as described here:

    http://bootinfoscript.sourceforge.net/

    ...
    Thanks for the reply, kansasnoob ! Below the contents of the RESULT.txt file created by following the instructions at SourceForge :
    Boot Info Script 0.55 dated February 15th, 2010

    ============================= Boot Info Summary: ==============================

    => Grub 2 is installed in the MBR of /dev/sda and looks on the same drive in
    partition #1 for /boot/grub.
    => Grub 2 is installed in the MBR of /dev/sdb and looks on the same drive in
    partition #1 for /boot/grub.

    sda1: __________________________________________________ _______________________

    File system: ntfs
    Boot sector type: Grub 2
    Boot sector info: Grub 2 is installed in the boot sector of sda1 and
    looks at sector 207620287 of the same hard drive for
    core.img, but core.img can not be found at this
    location. No errors found in the Boot Parameter Block.
    Operating System: Windows Vista
    Boot files/dirs: /bootmgr /boot/bcd /Windows/System32/winload.exe

    sda2: __________________________________________________ _______________________

    File system: ntfs
    Boot sector type: Grub 2
    Boot sector info: Grub 2 is installed in the boot sector of sda2 and
    looks at sector 207620287 of the same hard drive for
    core.img, but core.img can not be found at this
    location. No errors found in the Boot Parameter Block.
    Operating System:
    Boot files/dirs: /bootmgr /boot/BCD

    sdb1: __________________________________________________ _______________________

    File system: ext4
    Boot sector type: Grub 2
    Boot sector info: Grub 2 is installed in the boot sector of sdb1 and
    looks at sector 207620287 of the same hard drive for
    core.img, but core.img can not be found at this
    location.
    Operating System: Ubuntu lucid (development
    branch)
    Boot files/dirs: /boot/grub/menu.lst /boot/grub/grub.cfg /etc/fstab
    /boot/grub/core.img

    sdb2: __________________________________________________ _______________________

    File system: Extended Partition
    Boot sector type: -
    Boot sector info:

    sdb5: __________________________________________________ _______________________

    File system: swap
    Boot sector type: -
    Boot sector info:

    =========================== Drive/Partition Info: =============================

    Drive: sda ___________________ __________________________________________________ ___

    Disk /dev/sda: 120,0 GB, 120034123776 byte
    255 huvuden, 63 sektorer/spår, 14593 cylindrar, totalt 234441648 sektorer
    Enheter = sektorer av 1 · 512 = 512 byte
    Sector size (logical/physical): 512 bytes / 512 bytes

    Partition Boot Start End Size Id System

    /dev/sda1 * 63 221,761,259 221,761,197 7 HPFS/NTFS
    /dev/sda2 221,761,260 234,436,544 12,675,285 7 HPFS/NTFS


    Drive: sdb ___________________ __________________________________________________ ___

    Disk /dev/sdb: 120,0 GB, 120034123776 byte
    255 huvuden, 63 sektorer/spår, 14593 cylindrar, totalt 234441648 sektorer
    Enheter = sektorer av 1 · 512 = 512 byte
    Sector size (logical/physical): 512 bytes / 512 bytes

    Partition Boot Start End Size Id System

    /dev/sdb1 * 63 224,829,674 224,829,612 83 Linux
    /dev/sdb2 224,829,675 234,436,544 9,606,870 5 Extended
    /dev/sdb5 224,829,738 234,436,544 9,606,807 82 Linux swap / Solaris


    blkid -c /dev/null: __________________________________________________ __________

    Device UUID TYPE LABEL

    /dev/sda1 72746DD9746DA099 ntfs OS
    /dev/sda2 2C88743C8874071C ntfs HP_RECOVERY
    /dev/sda: PTTYPE="dos"
    /dev/sdb1 49d4a93f-e82b-4e1b-b84b-6012ae4d9854 ext4
    /dev/sdb2: PTTYPE="dos"
    /dev/sdb5 32898ee4-5c34-426e-aace-b9afceccc9f5 swap
    /dev/sdb: PTTYPE="dos"

    ============================ "mount | grep ^/dev output: ===========================

    Device Mount_Point Type Options

    /dev/sdb1 / ext4 (rw,relatime,errors=remount-ro)


    =========================== sdb1/boot/grub/menu.lst: ===========================

    # menu.lst - See: grub(8), info grub, update-grub(8)
    # grub-install(8), grub-floppy(8),
    # grub-md5-crypt, /usr/share/doc/grub
    # and /usr/share/doc/grub-doc/.

    ## default num
    # Set the default entry to the entry number NUM. Numbering starts from 0, and
    # the entry number 0 is the default if the command is not used.
    #
    # You can specify 'saved' instead of a number. In this case, the default entry
    # is the entry saved with the command 'savedefault'.
    # WARNING: If you are using dmraid do not use 'savedefault' or your
    # array will desync and will not let you boot your system.
    default 0

    ## timeout sec
    # Set a timeout, in SEC seconds, before automatically booting the default entry
    # (normally the first entry defined).
    timeout 10

    ## hiddenmenu
    # Hides the menu by default (press ESC to see the menu)
    #hiddenmenu

    # Pretty colours
    #color cyan/blue white/blue

    ## password ['--md5'] passwd
    # If used in the first section of a menu file, disable all interactive editing
    # control (menu entry editor and command-line) and entries protected by the
    # command 'lock'
    # e.g. password topsecret
    ## password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
    # password topsecret

    #
    # examples
    #
    # title Windows 95/98/NT/2000
    # root (hd0,0)
    # makeactive
    # chainloader +1
    #
    # title Linux
    # root (hd0,1)
    # kernel /vmlinuz root=/dev/hda2 ro
    #

    #
    # Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

    ### BEGIN AUTOMAGIC KERNELS LIST
    ## lines between the AUTOMAGIC KERNELS LIST markers will be modified
    ## by the debian update-grub script except for the default options below

    ## DO NOT UNCOMMENT THEM, Just edit them to your needs

    ## ## Start Default Options ##
    ## default kernel options
    ## default kernel options for automagic boot options
    ## If you want special options for specific kernels use kopt_x_y_z
    ## where x.y.z is kernel version. Minor versions can be omitted.
    ## e.g. kopt=root=/dev/hda1 ro
    ## kopt_2_6_8=root=/dev/hdc1 ro
    ## kopt_2_6_8_2_686=root=/dev/hdc2 ro
    # kopt=root=UUID=49d4a93f-e82b-4e1b-b84b-6012ae4d9854 ro

    ## default grub root device
    ## e.g. groot=(hd0,0)
    # groot=(hd1,0)

    ## should update-grub create alternative automagic boot options
    ## e.g. alternative=true
    ## alternative=false
    # alternative=true

    ## should update-grub lock alternative automagic boot options
    ## e.g. lockalternative=true
    ## lockalternative=false
    # lockalternative=false

    ## additional options to use with the default boot option, but not with the
    ## alternatives
    ## e.g. defoptions=vga=791 resume=/dev/hda5
    # defoptions=splash

    ## should update-grub lock old automagic boot options
    ## e.g. lockold=false
    ## lockold=true
    # lockold=false

    ## Xen hypervisor options to use with the default Xen boot option
    # xenhopt=

    ## Xen Linux kernel options to use with the default Xen boot option
    # xenkopt=console=tty0

    ## altoption boot targets option
    ## multiple altoptions lines are allowed
    ## e.g. altoptions=(extra menu suffix) extra boot options
    ## altoptions=(recovery) single
    # altoptions=(recovery mode) single

    ## controls how many kernels should be put into the menu.lst
    ## only counts the first occurence of a kernel, not the
    ## alternative kernel options
    ## e.g. howmany=all
    ## howmany=7
    # howmany=2

    ## specify if running in Xen domU or have grub detect automatically
    ## update-grub will ignore non-xen kernels when running in domU and vice versa
    ## e.g. indomU=detect
    ## indomU=true
    ## indomU=false
    # indomU=detect

    ## should update-grub create memtest86 boot option
    ## e.g. memtest86=true
    ## memtest86=false
    # memtest86=true

    ## should update-grub adjust the value of the default booted system
    ## can be true or false
    # updatedefaultentry=false

    ## should update-grub add savedefault to the default options
    ## can be true or false
    # savedefault=false

    ## ## End Default Options ##

    title Ubuntu karmic (development branch), kernel 2.6.31-13-generic
    root (hd1,0)
    kernel /boot/vmlinuz-2.6.31-13-generic root=UUID=49d4a93f-e82b-4e1b-b84b-6012ae4d9854 ro splash
    initrd /boot/initrd.img-2.6.31-13-generic
    quiet

    title Ubuntu karmic (development branch), kernel 2.6.31-13-generic (recovery mode)
    root (hd1,0)
    kernel /boot/vmlinuz-2.6.31-13-generic root=UUID=49d4a93f-e82b-4e1b-b84b-6012ae4d9854 ro single
    initrd /boot/initrd.img-2.6.31-13-generic

    title Ubuntu karmic (development branch), kernel 2.6.31-12-generic
    root (hd1,0)
    kernel /boot/vmlinuz-2.6.31-12-generic root=UUID=49d4a93f-e82b-4e1b-b84b-6012ae4d9854 ro splash
    initrd /boot/initrd.img-2.6.31-12-generic
    quiet

    title Ubuntu karmic (development branch), kernel 2.6.31-12-generic (recovery mode)
    root (hd1,0)
    kernel /boot/vmlinuz-2.6.31-12-generic root=UUID=49d4a93f-e82b-4e1b-b84b-6012ae4d9854 ro single
    initrd /boot/initrd.img-2.6.31-12-generic

    title Chainload into GRUB 2
    root (hd1,0)
    kernel /boot/grub/core.img

    title Ubuntu karmic (development branch), memtest86+
    root (hd1,0)
    kernel /boot/memtest86+.bin
    quiet

    ### END DEBIAN AUTOMAGIC KERNELS LIST

    # This is a divider, added to separate the menu items below from the Debian
    # ones.
    title Other operating systems:
    root


    # This entry automatically added by the Debian installer for a non-linux OS
    # on /dev/sda1
    title Windows Vista/Longhorn (loader)
    root (hd0,0)
    savedefault
    makeactive
    chainloader +1

    =========================== sdb1/boot/grub/grub.cfg: ===========================

    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by /usr/sbin/grub-mkconfig using templates
    # from /etc/grub.d and settings from /etc/default/grub
    #

    ### BEGIN /etc/grub.d/00_header ###
    if [ -s $prefix/grubenv ]; then
    load_env
    fi
    set default="0"
    if [ ${prev_saved_entry} ]; then
    set saved_entry=${prev_saved_entry}
    save_env saved_entry
    set prev_saved_entry=
    save_env prev_saved_entry
    set boot_once=true
    fi

    function savedefault {
    if [ -z ${boot_once} ]; then
    saved_entry=${chosen}
    save_env saved_entry
    fi
    }

    function recordfail {
    set recordfail=1
    if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
    }
    insmod ext2
    set root='(hd1,1)'
    search --no-floppy --fs-uuid --set 49d4a93f-e82b-4e1b-b84b-6012ae4d9854
    if loadfont /usr/share/grub/unicode.pf2 ; then
    set gfxmode=640x480
    insmod gfxterm
    insmod vbe
    if terminal_output gfxterm ; then true ; else
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output
    terminal gfxterm
    fi
    fi
    insmod ext2
    set root='(hd1,1)'
    search --no-floppy --fs-uuid --set 49d4a93f-e82b-4e1b-b84b-6012ae4d9854
    set locale_dir=($root)/boot/grub/locale
    set lang=sv
    insmod gettext
    if [ ${recordfail} = 1 ]; then
    set timeout=-1
    else
    set timeout=5
    fi
    ### END /etc/grub.d/00_header ###

    ### BEGIN /etc/grub.d/05_debian_theme ###
    set menu_color_normal=white/black
    set menu_color_highlight=black/light-gray
    ### END /etc/grub.d/05_debian_theme ###

    ### BEGIN /etc/grub.d/10_linux ###
    menuentry "Ubuntu, med Linux 2.6.32-17-generic" --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd1,1)'
    search --no-floppy --fs-uuid --set 49d4a93f-e82b-4e1b-b84b-6012ae4d9854
    linux /boot/vmlinuz-2.6.32-17-generic root=UUID=49d4a93f-e82b-4e1b-b84b-6012ae4d9854 ro quiet splash
    initrd /boot/initrd.img-2.6.32-17-generic
    }
    menuentry "Ubuntu, med Linux 2.6.32-17-generic (återställningsläge)" --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd1,1)'
    search --no-floppy --fs-uuid --set 49d4a93f-e82b-4e1b-b84b-6012ae4d9854
    echo Läser in Linux 2.6.32-17-generic ...
    linux /boot/vmlinuz-2.6.32-17-generic root=UUID=49d4a93f-e82b-4e1b-b84b-6012ae4d9854 ro single
    echo Läser in initial ramdisk ...
    initrd /boot/initrd.img-2.6.32-17-generic
    }
    menuentry "Ubuntu, med Linux 2.6.32-16-generic" --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd1,1)'
    search --no-floppy --fs-uuid --set 49d4a93f-e82b-4e1b-b84b-6012ae4d9854
    linux /boot/vmlinuz-2.6.32-16-generic root=UUID=49d4a93f-e82b-4e1b-b84b-6012ae4d9854 ro quiet splash
    initrd /boot/initrd.img-2.6.32-16-generic
    }
    menuentry "Ubuntu, med Linux 2.6.32-16-generic (återställningsläge)" --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd1,1)'
    search --no-floppy --fs-uuid --set 49d4a93f-e82b-4e1b-b84b-6012ae4d9854
    echo Läser in Linux 2.6.32-16-generic ...
    linux /boot/vmlinuz-2.6.32-16-generic root=UUID=49d4a93f-e82b-4e1b-b84b-6012ae4d9854 ro single
    echo Läser in initial ramdisk ...
    initrd /boot/initrd.img-2.6.32-16-generic
    }
    menuentry "Ubuntu, med Linux 2.6.31-20-generic" --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd1,1)'
    search --no-floppy --fs-uuid --set 49d4a93f-e82b-4e1b-b84b-6012ae4d9854
    linux /boot/vmlinuz-2.6.31-20-generic root=UUID=49d4a93f-e82b-4e1b-b84b-6012ae4d9854 ro quiet splash
    initrd /boot/initrd.img-2.6.31-20-generic
    }
    menuentry "Ubuntu, med Linux 2.6.31-20-generic (återställningsläge)" --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd1,1)'
    search --no-floppy --fs-uuid --set 49d4a93f-e82b-4e1b-b84b-6012ae4d9854
    echo Läser in Linux 2.6.31-20-generic ...
    linux /boot/vmlinuz-2.6.31-20-generic root=UUID=49d4a93f-e82b-4e1b-b84b-6012ae4d9854 ro single
    echo Läser in initial ramdisk ...
    initrd /boot/initrd.img-2.6.31-20-generic
    }
    ### END /etc/grub.d/10_linux ###

    ### BEGIN /etc/grub.d/20_memtest86+ ###
    menuentry "Memory test (memtest86+)" {
    insmod ext2
    set root='(hd1,1)'
    search --no-floppy --fs-uuid --set 49d4a93f-e82b-4e1b-b84b-6012ae4d9854
    linux16 /boot/memtest86+.bin
    }
    menuentry "Memory test (memtest86+, serial console 115200)" {
    insmod ext2
    set root='(hd1,1)'
    search --no-floppy --fs-uuid --set 49d4a93f-e82b-4e1b-b84b-6012ae4d9854
    linux16 /boot/memtest86+.bin console=ttyS0,115200n8
    }
    ### END /etc/grub.d/20_memtest86+ ###

    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry "Windows Vista (loader) (on /dev/sda1)" {
    insmod ntfs
    set root='(hd0,1)'
    search --no-floppy --fs-uuid --set 72746dd9746da099
    chainloader +1
    }
    menuentry "Windows Vista (loader) (on /dev/sda2)" {
    insmod ntfs
    set root='(hd0,2)'
    search --no-floppy --fs-uuid --set 2c88743c8874071c
    chainloader +1
    }
    ### END /etc/grub.d/30_os-prober ###

    ### BEGIN /etc/grub.d/40_custom ###
    # 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.
    ### END /etc/grub.d/40_custom ###

    =============================== sdb1/etc/fstab: ===============================

    # /etc/fstab: static file system information.
    #
    # <file system> <mount point> <type> <options> <dump> <pass>
    proc /proc proc defaults 0 0
    # /dev/sdb1
    UUID=49d4a93f-e82b-4e1b-b84b-6012ae4d9854 / ext4 relatime,errors=remount-ro 0 1
    # /dev/sdb5
    UUID=32898ee4-5c34-426e-aace-b9afceccc9f5 none swap sw 0 0
    /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0

    =================== sdb1: Location of files loaded by Grub: ===================


    106.3GB: boot/grub/core.img
    73.0GB: boot/grub/grub.cfg
    73.2GB: boot/grub/menu.lst
    106.4GB: boot/initrd.img-2.6.31-20-generic
    106.4GB: boot/initrd.img-2.6.32-16-generic
    106.5GB: boot/initrd.img-2.6.32-17-generic
    106.4GB: boot/vmlinuz-2.6.31-20-generic
    106.4GB: boot/vmlinuz-2.6.32-16-generic
    106.4GB: boot/vmlinuz-2.6.32-17-generic
    106.5GB: initrd.img.old
    106.4GB: vmlinuz.old
    From what I can see, the problem seems to manifest itself here :
    Boot sector info: Grub 2 is installed in the boot sector of sda1 and
    looks at sector 207620287 of the same hard drive for
    core.img, but core.img can not be found at this
    location. No errors found in the Boot Parameter Block.
    I e, the fact that «core.img» is not found. Any suggestions as to how this defect can be remedied ? Hope the above will suffice for you - or some other fellow user - to point me in the right direction !...

    Henri
    Last edited by mhenriday; March 24th, 2010 at 10:23 AM.

  4. #384
    Join Date
    Mar 2010
    Location
    Munich, Germany
    Beans
    2
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Grub 2 Basics

    Quote Originally Posted by drs305 View Post
    You can take a more agressive approach by disabling the recordfail check in /etc/grub.d/00_header.
    Thanks for the hint. I did that and commented out two more lines in 10_linux that did something with recordfail.

    Code:
    #recordfail=1
    #if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    That works, i'd only like to find out why this is happening. I always shut down the vm with "sudo poweroff" before i do the same to the host.
    Last edited by oyo; March 24th, 2010 at 10:58 AM. Reason: typo

  5. #385
    Join Date
    Apr 2008
    Beans
    11,707

    Re: Grub 2 Basics

    @mhenriday,

    First I'll review what I see and make a few comments:

    I can see here that grub2 is installed to the mbr of both drives (and that should be fine):

    => Grub 2 is installed in the MBR of /dev/sda and looks on the same drive in
    partition #1 for /boot/grub.
    => Grub 2 is installed in the MBR of /dev/sdb and looks on the same drive in
    partition #1 for /boot/grub.
    On both sda1 and sda2 you show:

    Boot sector type: Grub 2
    Boot sector info: Grub 2 is installed in the boot sector of sda1 and
    looks at sector 207620287 of the same hard drive for
    core.img, but core.img can not be found at this
    location. No errors found in the Boot Parameter Block.
    So I assume at some point you tried to install grub2 to those partitions rather than an mbr. That may or may not cause a problem, I'm inclined to think NOT because your boot files/directories look alright on sda1:

    Boot files/dirs: /bootmgr /boot/bcd /Windows/System32/winload.exe
    Where I see the most obvious of problems is with your Lucid on sdb1:

    sdb1: __________________________________________________ _______________________

    File system: ext4
    Boot sector type: Grub 2
    Boot sector info: Grub 2 is installed in the boot sector of sdb1 and
    looks at sector 207620287 of the same hard drive for
    core.img, but core.img can not be found at this
    location.
    Operating System: Ubuntu lucid (development
    branch)
    Boot files/dirs: /boot/grub/menu.lst /boot/grub/grub.cfg /etc/fstab
    /boot/grub/core.img
    Of course it shows the "core.img can not be found" error, I assume once again that you tried to install grub2 to that partition rather than an mbr, but having both a menu.lst and a grub.cfg really tends to hinder the performance of either legacy grub or grub2.

    Just to clarify "menu.lst" is a component of legacy grub, whereas "grub.cfg" is a component of grub2. Further, just so you'll understand, both legacy grub and grub2 use the package "grub-common". The proper package name for grub2 is "grub-pc", and the package name for legacy grub is just "grub".

    Anyway to clean up the most obvious problem you'll need to boot into Ubuntu and backup the old /boot/grub directory, create a new one, purge some packages and their configuration files, then reinstall and reconfigure the correct packages. No sweat, I'll give you the commands so you can just copy-n-paste.

    But I wonder if it's possible for you to select whether drive sda (the Windows drive) or sdb (the Ubuntu drive) boots first? I can see that both drives are 120GB but don't know if they're both IDE, both SATA, or a mix of the two?

    I'm always reluctant to send someone inside their computer changing cables and such, and it's really not necessary. But one way we could determine if Vista will boot under it's own power is restore a generic Windows mbr to sda and just see if Windows will boot.

    Of course that may, or most probably will, leave Ubuntu unbootable, so i need to know that you have an Ubuntu Live CD. The version doesn't really matter just so long as you know it runs OK so we can restore grub2 to the mbr of sda if needed.

    Have I confused you yet? For the most part make sure you have an Ubuntu Live CD that you know will run!

    To fix the mixed grub2 and legacy grub files/directories boot into Ubuntu & run the following commands:

    Code:
    sudo mv /boot/grub /boot/grub_backup
    Code:
    sudo mkdir /boot/grub
    Note: purging the following packages you may see "not installed so not removed", that's OK.

    Code:
    sudo apt-get --purge remove startupmanager
    Code:
    sudo apt-get --purge remove grub
    Code:
    sudo apt-get --purge remove grub-pc
    Code:
    sudo apt-get --purge remove grub-common
    Now we reinstall & reconfigure:

    Code:
    sudo apt-get install grub-pc
    Code:
    sudo update-grub
    Wait for it to say done! Then:

    Code:
    sudo grub-install /dev/sda
    Code:
    sudo grub-install /dev/sdb
    Note: If either of the last two commands returns an error use the command "sudo grub-install --recheck /dev/sdX", of course replacing X with either "a" or "b" as appropriate.

    Then just see if Windows will now boot. If not then I need to know for sure that you have a Live CD that works and we'll try a generic Windows mbr.

  6. #386
    Join Date
    Dec 2006
    Location
    Stockholm
    Beans
    317
    Distro
    Ubuntu 17.04 Zesty Zapus

    Re: Grub 2 Basics

    Thanks for staying with me here, kansasnoob - and for your very pedagogical instructions, which even I could follow ! Interestingly enough, when I ran
    Code:
    sudo apt-get --purge remove grub
    I got a message to the effect that GRUB not being installed, there was nothing to remove. Be that as it may, I opted to follow your instructions to the letter and remove and then reinstall «grub-pc» and «grub-common». As you can see from the RESULTS1.txt file which I reproduce below, this did indeed succeed in removing the «/boot/grub/menu.lst» path from the Boot files/dirs under /sdb1:
    Boot Info Script 0.55 dated February 15th, 2010

    ============================= Boot Info Summary: ==============================

    => Grub 2 is installed in the MBR of /dev/sda and looks on the same drive in
    partition #1 for /boot/grub.
    => Grub 2 is installed in the MBR of /dev/sdb and looks on the same drive in
    partition #1 for /boot/grub.

    sda1: __________________________________________________ _______________________

    File system: ntfs
    Boot sector type: Grub 2
    Boot sector info: Grub 2 is installed in the boot sector of sda1 and
    looks at sector 207620287 of the same hard drive for
    core.img, but core.img can not be found at this
    location. No errors found in the Boot Parameter Block.
    Operating System: Windows Vista
    Boot files/dirs: /bootmgr /boot/bcd /Windows/System32/winload.exe

    sda2: __________________________________________________ _______________________

    File system: ntfs
    Boot sector type: Grub 2
    Boot sector info: Grub 2 is installed in the boot sector of sda2 and
    looks at sector 207620287 of the same hard drive for
    core.img, but core.img can not be found at this
    location. No errors found in the Boot Parameter Block.
    Operating System:
    Boot files/dirs: /bootmgr /boot/BCD

    sdb1: __________________________________________________ _______________________

    File system: ext4
    Boot sector type: Grub 2
    Boot sector info: Grub 2 is installed in the boot sector of sdb1 and
    looks at sector 207620287 of the same hard drive for
    core.img, but core.img can not be found at this
    location.
    Operating System: Ubuntu lucid (development
    branch)
    Boot files/dirs: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

    sdb2: __________________________________________________ _______________________

    File system: Extended Partition
    Boot sector type: -
    Boot sector info:

    sdb5: __________________________________________________ _______________________

    File system: swap
    Boot sector type: -
    Boot sector info:

    =========================== Drive/Partition Info: =============================

    Drive: sda ___________________ __________________________________________________ ___

    Disk /dev/sda: 120,0 GB, 120034123776 byte
    255 huvuden, 63 sektorer/spår, 14593 cylindrar, totalt 234441648 sektorer
    Enheter = sektorer av 1 · 512 = 512 byte
    Sector size (logical/physical): 512 bytes / 512 bytes

    Partition Boot Start End Size Id System

    /dev/sda1 * 63 221,761,259 221,761,197 7 HPFS/NTFS
    /dev/sda2 221,761,260 234,436,544 12,675,285 7 HPFS/NTFS


    Drive: sdb ___________________ __________________________________________________ ___

    Disk /dev/sdb: 120,0 GB, 120034123776 byte
    255 huvuden, 63 sektorer/spår, 14593 cylindrar, totalt 234441648 sektorer
    Enheter = sektorer av 1 · 512 = 512 byte
    Sector size (logical/physical): 512 bytes / 512 bytes

    Partition Boot Start End Size Id System

    /dev/sdb1 * 63 224,829,674 224,829,612 83 Linux
    /dev/sdb2 224,829,675 234,436,544 9,606,870 5 Extended
    /dev/sdb5 224,829,738 234,436,544 9,606,807 82 Linux swap / Solaris


    blkid -c /dev/null: __________________________________________________ __________

    Device UUID TYPE LABEL

    /dev/sda1 72746DD9746DA099 ntfs OS
    /dev/sda2 2C88743C8874071C ntfs HP_RECOVERY
    /dev/sda: PTTYPE="dos"
    /dev/sdb1 49d4a93f-e82b-4e1b-b84b-6012ae4d9854 ext4
    /dev/sdb2: PTTYPE="dos"
    /dev/sdb5 32898ee4-5c34-426e-aace-b9afceccc9f5 swap
    /dev/sdb: PTTYPE="dos"

    ============================ "mount | grep ^/dev output: ===========================

    Device Mount_Point Type Options

    /dev/sdb1 / ext4 (rw,relatime,errors=remount-ro)


    =========================== sdb1/boot/grub/grub.cfg: ===========================

    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by /usr/sbin/grub-mkconfig using templates
    # from /etc/grub.d and settings from /etc/default/grub
    #

    ### BEGIN /etc/grub.d/00_header ###
    if [ -s $prefix/grubenv ]; then
    load_env
    fi
    set default="0"
    if [ ${prev_saved_entry} ]; then
    set saved_entry=${prev_saved_entry}
    save_env saved_entry
    set prev_saved_entry=
    save_env prev_saved_entry
    set boot_once=true
    fi

    function savedefault {
    if [ -z ${boot_once} ]; then
    saved_entry=${chosen}
    save_env saved_entry
    fi
    }

    function recordfail {
    set recordfail=1
    if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
    }
    insmod ext2
    set root='(/dev/sdb,1)'
    search --no-floppy --fs-uuid --set 49d4a93f-e82b-4e1b-b84b-6012ae4d9854
    if loadfont /usr/share/grub/unicode.pf2 ; then
    set gfxmode=640x480
    insmod gfxterm
    insmod vbe
    if terminal_output gfxterm ; then true ; else
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output
    terminal gfxterm
    fi
    fi
    insmod ext2
    set root='(/dev/sdb,1)'
    search --no-floppy --fs-uuid --set 49d4a93f-e82b-4e1b-b84b-6012ae4d9854
    set locale_dir=($root)/boot/grub/locale
    set lang=sv
    insmod gettext
    if [ ${recordfail} = 1 ]; then
    set timeout=-1
    else
    set timeout=10
    fi
    ### END /etc/grub.d/00_header ###

    ### BEGIN /etc/grub.d/05_debian_theme ###
    set menu_color_normal=white/black
    set menu_color_highlight=black/light-gray
    ### END /etc/grub.d/05_debian_theme ###

    ### BEGIN /etc/grub.d/10_linux ###
    menuentry "Ubuntu, med Linux 2.6.32-17-generic" --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(/dev/sdb,1)'
    search --no-floppy --fs-uuid --set 49d4a93f-e82b-4e1b-b84b-6012ae4d9854
    linux /boot/vmlinuz-2.6.32-17-generic root=UUID=49d4a93f-e82b-4e1b-b84b-6012ae4d9854 ro quiet splash
    initrd /boot/initrd.img-2.6.32-17-generic
    }
    menuentry "Ubuntu, med Linux 2.6.32-17-generic (återställningsläge)" --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(/dev/sdb,1)'
    search --no-floppy --fs-uuid --set 49d4a93f-e82b-4e1b-b84b-6012ae4d9854
    echo Läser in Linux 2.6.32-17-generic ...
    linux /boot/vmlinuz-2.6.32-17-generic root=UUID=49d4a93f-e82b-4e1b-b84b-6012ae4d9854 ro single
    echo Läser in initial ramdisk ...
    initrd /boot/initrd.img-2.6.32-17-generic
    }
    menuentry "Ubuntu, med Linux 2.6.32-16-generic" --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(/dev/sdb,1)'
    search --no-floppy --fs-uuid --set 49d4a93f-e82b-4e1b-b84b-6012ae4d9854
    linux /boot/vmlinuz-2.6.32-16-generic root=UUID=49d4a93f-e82b-4e1b-b84b-6012ae4d9854 ro quiet splash
    initrd /boot/initrd.img-2.6.32-16-generic
    }
    menuentry "Ubuntu, med Linux 2.6.32-16-generic (återställningsläge)" --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(/dev/sdb,1)'
    search --no-floppy --fs-uuid --set 49d4a93f-e82b-4e1b-b84b-6012ae4d9854
    echo Läser in Linux 2.6.32-16-generic ...
    linux /boot/vmlinuz-2.6.32-16-generic root=UUID=49d4a93f-e82b-4e1b-b84b-6012ae4d9854 ro single
    echo Läser in initial ramdisk ...
    initrd /boot/initrd.img-2.6.32-16-generic
    }
    menuentry "Ubuntu, med Linux 2.6.31-20-generic" --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(/dev/sdb,1)'
    search --no-floppy --fs-uuid --set 49d4a93f-e82b-4e1b-b84b-6012ae4d9854
    linux /boot/vmlinuz-2.6.31-20-generic root=UUID=49d4a93f-e82b-4e1b-b84b-6012ae4d9854 ro quiet splash
    initrd /boot/initrd.img-2.6.31-20-generic
    }
    menuentry "Ubuntu, med Linux 2.6.31-20-generic (återställningsläge)" --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(/dev/sdb,1)'
    search --no-floppy --fs-uuid --set 49d4a93f-e82b-4e1b-b84b-6012ae4d9854
    echo Läser in Linux 2.6.31-20-generic ...
    linux /boot/vmlinuz-2.6.31-20-generic root=UUID=49d4a93f-e82b-4e1b-b84b-6012ae4d9854 ro single
    echo Läser in initial ramdisk ...
    initrd /boot/initrd.img-2.6.31-20-generic
    }
    ### END /etc/grub.d/10_linux ###

    ### BEGIN /etc/grub.d/20_memtest86+ ###
    menuentry "Memory test (memtest86+)" {
    insmod ext2
    set root='(/dev/sdb,1)'
    search --no-floppy --fs-uuid --set 49d4a93f-e82b-4e1b-b84b-6012ae4d9854
    linux16 /boot/memtest86+.bin
    }
    menuentry "Memory test (memtest86+, serial console 115200)" {
    insmod ext2
    set root='(/dev/sdb,1)'
    search --no-floppy --fs-uuid --set 49d4a93f-e82b-4e1b-b84b-6012ae4d9854
    linux16 /boot/memtest86+.bin console=ttyS0,115200n8
    }
    ### END /etc/grub.d/20_memtest86+ ###

    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry "Windows Vista (loader) (on /dev/sda1)" {
    insmod ntfs
    set root='(/dev/sda,1)'
    search --no-floppy --fs-uuid --set 72746dd9746da099
    chainloader +1
    }
    menuentry "Windows Vista (loader) (on /dev/sda2)" {
    insmod ntfs
    set root='(/dev/sda,2)'
    search --no-floppy --fs-uuid --set 2c88743c8874071c
    chainloader +1
    }
    ### END /etc/grub.d/30_os-prober ###

    ### BEGIN /etc/grub.d/40_custom ###
    # 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.
    ### END /etc/grub.d/40_custom ###

    =============================== sdb1/etc/fstab: ===============================

    # /etc/fstab: static file system information.
    #
    # <file system> <mount point> <type> <options> <dump> <pass>
    proc /proc proc defaults 0 0
    # /dev/sdb1
    UUID=49d4a93f-e82b-4e1b-b84b-6012ae4d9854 / ext4 relatime,errors=remount-ro 0 1
    # /dev/sdb5
    UUID=32898ee4-5c34-426e-aace-b9afceccc9f5 none swap sw 0 0
    /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0

    =================== sdb1: Location of files loaded by Grub: ===================


    106.3GB: boot/grub/core.img
    72.7GB: boot/grub/grub.cfg
    106.4GB: boot/initrd.img-2.6.31-20-generic
    106.4GB: boot/initrd.img-2.6.32-16-generic
    106.5GB: boot/initrd.img-2.6.32-17-generic
    106.4GB: boot/vmlinuz-2.6.31-20-generic
    106.4GB: boot/vmlinuz-2.6.32-16-generic
    106.4GB: boot/vmlinuz-2.6.32-17-generic
    106.5GB: initrd.img.old
    106.4GB: vmlinuz.old
    So far so good, but alas, just as previously, when I attempt to boot into the Vista loader, the machine reboots and GRUB displays again. So can it go !...

    I have - I think ! - a live CD for 64-bit Karmic (I usually wait for the stable version of a new Ubuntu upgrade before burning a CD) and if not I can always burn one, so reconstructing Lucid by upgrading from Karmic would be no problem. Otherwise, I could always try re-installing Vista on sda from my three Vista CDs (thanks, Microsoft !), which would, of course, install that generic Windows MBR that you mention and disable GRUB2 (thanks again, Microsoft !), but it should be possible to recover the latter (I've previously done so for the older version in similar circumstances). Naturally, I'd prefer to resolve the current problem in such a way as to avoid re-installations, but as this laptop is not my main computer (I haven't dared to try upgrading to Lucid on the big box !), loss of data wouldn't constitute an insurmountable problem. So lay on, Macduff ; I'm ready for your suggestions !...

    Henri
    Last edited by mhenriday; March 24th, 2010 at 07:53 PM.

  7. #387
    Join Date
    Apr 2008
    Beans
    11,707

    Re: Grub 2 Basics

    OK, look what Meierfra wrote here:

    http://ubuntuforums.org/showpost.php...&postcount=357

    Basically the same as here:

    http://support.microsoft.com/kb/927392

    Once you know that repairing the Vista bootsector was successful you may need to restore grub2 to the mbr of sda (probably will) like this:

    Boot your Ubuntu Live CD choosing to Try without changes then go to terminal and run the following:

    Code:
    sudo mount /dev/sdb1 /mnt && sudo mount --bind /dev /mnt/dev &&sudo mount --bind /proc /mnt/proc && sudo chroot /mnt
    Code:
    grub-install /dev/sda
    If that shows any errors:

    Code:
    grub-install --recheck /dev/sda
    Then just:

    Code:
    exit
    Code:
    sudo umount /mnt/dev && sudo umount /mnt/proc && sudo umount /mnt

  8. #388
    Join Date
    Mar 2010
    Beans
    10

    Re: Grub 2 Basics

    Thank you very much for the guide, it is very useful.

    There is a small typo error in your original post, where you describe 'GRUB SAVEDEFAULT=' you missed a '_':

    GRUB SAVEDEFAULT= - If set to true this setting will automatically set the last selected OS from the menu as the default OS on the next boot. No commands need be run to set the default OS.

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

    Re: Grub 2 Basics

    Gioby,

    Thanks for the input. I've corrected the typo.

    And welcome to Ubuntu and the Ubuntu Forums.
    Back to Xorg...

    Retired.

  10. #390
    Join Date
    Dec 2006
    Beans
    78

    Re: Grub 2 Basics

    Can you please update your doc to indicate that GRUB_TIMEOUT does not work at this time. There is a bug report on PPA. Thank you.

Page 39 of 94 FirstFirst ... 2937383940414989 ... LastLast

Tags for this Thread

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
  •