Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15
I assume this is the right place to ask this as, although it's not about the installation its self it is about the boot loader which comes under this category ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2010
    Posts
    9

    Question Why can I load the grub menu manually but not find it automatically?


    I assume this is the right place to ask this as, although it's not about the installation its self it is about the boot loader which comes under this category according to the description. I thought I had installed Ubuntu 10.10 (I have a really slow internet connection and this was the latest version I had downloaded and didn't want to spend another day downloading 11.04) successfully however when I boot the PC there is a grub error message ("File System Not Recognised"). The strange thing about this is that, although apparently it has loaded grub, I can load grub fine with the supergrubdisk CD. I selected "Detect any Grub2 Installation" which brought up one option, "HD(0,7)" which I assume means Hard Disk 0 (or the first one) and the seventh partition (which, according to gparted, is flagged as boot and mounted in the /boot file system directory). When I choose this I am given the options to select the correct operating systems. Why does this happen?

    Thanks in advance,
    Cameron

  2. #2
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,110
    What other operating system(s) do you have on the computer?
    During the Ubuntu install, did you select the default to install the Grub2 bootloader to the master boot record.
    (hd0,7) in Grub2 is the first drive, 7th partition.
    The error you are getting probably means Grub is pointing to the wrong partition to try to boot Ubuntu.
    Command to use to get useful information: sudo fdisk -l (lower case Letter L)
    Post the output of the /boot/grub/grub.cfg file.

  3. #3
    Linux Newbie glene77is's Avatar
    Join Date
    Dec 2009
    Location
    Memphis, TN
    Posts
    125
    yancek,
    I have read your responses before,
    and received good information.

    This is a text, compiled after reading your comments
    and comments from Nathan.
    I have used it several times, to fix my mistakes,
    as I tinker with having several OS on the same HD.
    My main computer uses Grub2 (v1.9, loaded from Ubuntu.
    My sand-box computer has half dozen OS on it,
    and uses Grub4Dos, loaded from Puppy 525.

    You may want to interpret its usage for the OP.

    """
    *(: Linux_{}_MBR_Rebuild_info_110321.txt

    ************************************************** *********************
    *(: Grub_Install_Help_.txt
    Usage: grub-install [OPTION] install_device
    Install GRUB on your drive.
    -h, --help print this message and exit
    grub-install copies GRUB images into /boot/grub,
    and uses grub-setup to install grub into the boot sector.

    If the --root-directory option is used, then grub-install will copy
    images into the operating system installation rooted at that directory.

    Report bugs to <bug-grub@gnu.org>.

    ************************************************** ******


    ************************************************** ******
    from: Nathan729, Ubuntu forums.
    Re: Altering MBR to point to new Partition.
    The simplest solution is to boot from a Ubuntu Live-CD,
    which runs the system in RAM,
    then repair grub...
    ### Thanks for the idea from Natham729 Ubuntu formum.
    ### Target: make MBR point to (hd0,sda1)
    ### can point to any sda#. Just alter this code.
    ### Live-CD, Terminal, script Code:
    # MKDIR in RamDrive
    sudo mkdir /mnt
    # MOUNT primary OS in /mnt by reference
    sudo mount /dev/sda1 /mnt
    # INSTALL MBR code pointing to primary OS by reference as /mnt
    sudo grub-install --root-directory=/mnt /dev/sda
    #MOUNT other subdir as required
    sudo mount --bind /dev /mnt/dev
    sudo mount --bind /proc /mnt/proc
    sudo mount --bind /sys /mnt/sys
    # UPDATE grub.cfg
    sudo chroot /mnt update-grub
    # REBOOT
    sudo reboot.
    ************************************************** ******
    """

    glene77is

  4. #4
    Just Joined!
    Join Date
    Feb 2010
    Posts
    9
    Thanks for the reply, I am dual booted with windows 7 and I didn't change any GRUB settings so I assume it's set to GRUB2.

    This is the output of the fdisk command:

    Code:
    Disk /dev/sda: 160.0 GB, 160041885696 bytes
    255 heads, 63 sectors/track, 19457 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0xc8fe0ada
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1        1212     9728000   27  Unknown
    /dev/sda2            1212        1412     1605632    7  HPFS/NTFS
    /dev/sda3            1412       13506    97148437+   7  HPFS/NTFS
    /dev/sda4           13506       19458    47806465    5  Extended
    /dev/sda5           13506       13871     2929664   82  Linux swap / Solaris
    /dev/sda6           13871       19336    43898880   83  Linux
    /dev/sda7   *       19336       19458      975872   83  Linux
    and this is the contents of the grub.cfg file:

    Code:
    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by 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
      set have_grubenv=true
      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
    }
    
    function load_video {
      insmod vbe
      insmod vga
    }
    
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos6)'
    search --no-floppy --fs-uuid --set 722c5981-1d52-4695-a7fd-1fd866a92470
    if loadfont /usr/share/grub/unicode.pf2 ; then
      set gfxmode=640x480
      load_video
      insmod gfxterm
    fi
    terminal_output gfxterm
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos7)'
    search --no-floppy --fs-uuid --set 447a08a7-edc6-4b90-957d-4a3888d14442
    set locale_dir=($root)/grub/locale
    set lang=en
    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, with Linux 2.6.35-28-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    	recordfail
    	insmod part_msdos
    	insmod ext2
    	set root='(hd0,msdos7)'
    	search --no-floppy --fs-uuid --set 447a08a7-edc6-4b90-957d-4a3888d14442
    	linux	/vmlinuz-2.6.35-28-generic root=UUID=722c5981-1d52-4695-a7fd-1fd866a92470 ro   quiet splash
    	initrd	/initrd.img-2.6.35-28-generic
    }
    menuentry 'Ubuntu, with Linux 2.6.35-28-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    	recordfail
    	insmod part_msdos
    	insmod ext2
    	set root='(hd0,msdos7)'
    	search --no-floppy --fs-uuid --set 447a08a7-edc6-4b90-957d-4a3888d14442
    	echo	'Loading Linux 2.6.35-28-generic ...'
    	linux	/vmlinuz-2.6.35-28-generic root=UUID=722c5981-1d52-4695-a7fd-1fd866a92470 ro single 
    	echo	'Loading initial ramdisk ...'
    	initrd	/initrd.img-2.6.35-28-generic
    }
    menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    	recordfail
    	insmod part_msdos
    	insmod ext2
    	set root='(hd0,msdos7)'
    	search --no-floppy --fs-uuid --set 447a08a7-edc6-4b90-957d-4a3888d14442
    	linux	/vmlinuz-2.6.35-22-generic root=UUID=722c5981-1d52-4695-a7fd-1fd866a92470 ro   quiet splash
    	initrd	/initrd.img-2.6.35-22-generic
    }
    menuentry 'Ubuntu, with Linux 2.6.35-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    	recordfail
    	insmod part_msdos
    	insmod ext2
    	set root='(hd0,msdos7)'
    	search --no-floppy --fs-uuid --set 447a08a7-edc6-4b90-957d-4a3888d14442
    	echo	'Loading Linux 2.6.35-22-generic ...'
    	linux	/vmlinuz-2.6.35-22-generic root=UUID=722c5981-1d52-4695-a7fd-1fd866a92470 ro single 
    	echo	'Loading initial ramdisk ...'
    	initrd	/initrd.img-2.6.35-22-generic
    }
    ### END /etc/grub.d/10_linux ###
    
    ### BEGIN /etc/grub.d/20_linux_xen ###
    ### END /etc/grub.d/20_linux_xen ###
    
    ### BEGIN /etc/grub.d/20_memtest86+ ###
    menuentry "Memory test (memtest86+)" {
    	insmod part_msdos
    	insmod ext2
    	set root='(hd0,msdos7)'
    	search --no-floppy --fs-uuid --set 447a08a7-edc6-4b90-957d-4a3888d14442
    	linux16	/memtest86+.bin
    }
    menuentry "Memory test (memtest86+, serial console 115200)" {
    	insmod part_msdos
    	insmod ext2
    	set root='(hd0,msdos7)'
    	search --no-floppy --fs-uuid --set 447a08a7-edc6-4b90-957d-4a3888d14442
    	linux16	/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 part_msdos
    	insmod ntfs
    	set root='(hd0,msdos1)'
    	search --no-floppy --fs-uuid --set 34d84dbbd84d7bdc
    	chainloader +1
    }
    menuentry "Windows 7 (loader) (on /dev/sda2)" {
    	insmod part_msdos
    	insmod ntfs
    	set root='(hd0,msdos2)'
    	search --no-floppy --fs-uuid --set fa9c4eb39c4e69e9
    	chainloader +1
    }
    menuentry "Windows Vista (loader) (on /dev/sda3)" {
    	insmod part_msdos
    	insmod ntfs
    	set root='(hd0,msdos3)'
    	search --no-floppy --fs-uuid --set 4242504d42504835
    	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 ###
    
    ### BEGIN /etc/grub.d/41_custom ###
    if [ -f  $prefix/custom.cfg ]; then
      source $prefix/custom.cfg;
    fi
    ### END /etc/grub.d/41_custom ###
    There are also two installations of windows vista according to grub, Windows Vista was installed on my laptop by default and they do nothing and just give an error, how would I delete them? Could I just remove there parts from the file?

  5. #5
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,110
    Vista was installed by default. Does that mean it was installed by the manufacturer?
    Since you have a grub.cfg file, that means it is Grub2.
    Your grub.cfg output shows two vista partitions: sda1 and sda3. sda1 is probably a Recovery partition for vista if this computer came with vista installed by the manufacturer.
    You can't boot vista? You can boot windows 7? Did you install windows 7 yourself? If you already had vista and installed windows 7, the windows 7 bootloader should have detected vista?

    It looks like your system partition for Ubuntu is on sda6 as sda7 appears to be too small to contain it. Did you create a separate boot partition for Ubuntu?

    I have Ubuntu installed on a partition on my computer. I don't boot the system with Grub2 but use Grub Legacy to boot Grub2 on Ubuntu. Looking at my Ubuntu grub.cfg file, the difference I see is the UUID entries. Look at your entries for Ubuntu, the line below:

    search --no-floppy --fs-uuid --set 447a08a7-edc6-4b90-957d-4a3888d14442
    compare it to the next line in your entry for Ubuntu:

    linux /vmlinuz-2.6.35-28-generic root=UUID=722c5981-1d52-4695-a7fd-1fd866a92470 ro single
    On my Ubuntu entry in grub.cfg, these numbers are identical which would seem to indicate a separate boot partition. The only thing I could think of is to boot Ubuntu and open a terminal and run: blkid , then compare the output with your Grub UUID information. I don't know why you would be able to boot with SuperGrub and not from Ubuntu as the entries point to the same partition. I'm just not familiar enough with Grub2 to make any suggestions.

  6. #6
    Just Joined!
    Join Date
    Feb 2010
    Posts
    9
    Thanks for the reply again, Vista came with the PC and was installed by the manufacturer. I updated it to Windows 7 using a update disk. For some reason grub thinks there are two vista installations when there isn't even one. I can boot however to do so I have to use the supergrub2disk, as when I select my hard drive as the boot device it gives an error.

    This is the list of functions of each of the partitions:

    sda1: Recovery (10GB, NTFS)
    sda2: System (1.6GB NTFS)
    sda3: Vista [The default name of the drive that holds windows 7] (99GB, NTFS)
    sda4: Extended (Container for Logical Partitions)
    sda5: Linux Swap (3GB)
    sda6: Ubuntu Filesystem (45GB, ext4)
    sda7: Ubuntu Boot (999MB, ext4, mounted at /boot, flaged as Bootable)

    sda1-3 came with pre-installed on the system and I set sda7 as the boot location.

    Thanks Again,
    Cameron

  7. #7
    Linux Newbie glene77is's Avatar
    Join Date
    Dec 2009
    Location
    Memphis, TN
    Posts
    125
    CoolCam,
    You wrote
    " sda7: Ubuntu Boot (999MB, ext4, mounted at /boot, flaged as Bootable) "

    Interesting that a partition can be used for booting only.
    On my "sand-box" computer, I was unable to install a Linux OS in the first partition.
    So I installed Grub4Dos, and set the grbldr and Menu.lst on this hda0,sda0.
    That is all I use the 1GB partition for, basically.
    Just booting, and calling any of six other OS on this "sand-box" computer.

    You have provided lots of interesting info.
    glene77is

  8. #8
    Just Joined!
    Join Date
    Feb 2010
    Posts
    9
    Well to be honest I have no idea why I did that :/ lol... does it mean I have to reinstall it again

  9. #9
    Linux Newbie glene77is's Avatar
    Join Date
    Dec 2009
    Location
    Memphis, TN
    Posts
    125
    Quote Originally Posted by coolcam262 View Post
    Well to be honest I have no idea why I did that :/ lol...
    does it mean I have to reinstall it again
    CoolCalm,

    Not at all, man!
    I was just making a note of the recurrence of the use of sda0 for only 'booting' operations.
    These computers don't know me from Adam's house-cat,
    and don't seem to give a flip.
    So, I try to compromise and adapt,
    at least until I know how to change things.

    I was just saying that I was unable to install an OS to the first partition, "sand-box" computer,
    but was able to install Grub4Dos, grdldr, and menu.lst just fine.
    Works OK, and I can also use the partition for shared storage amongst the various OS.

    I have been able to install several other OS (PartedMagic, Knoppix, Ubuntu, Puppy 520, Puppy 525, LHP Puppy 503 Mariner, Mint Ubuntu, Watt Ubuntu, Crunch Ubuntu).
    All these slipped right into the partition sda2 Extended, as sda5 , 6, 7, etc.
    Just seems to be a little problem that I may resolve in the future.

    Right now, I am more interested in modifying the scripts in Grub and Grub2.
    Tracing the steps in the historical DOS boot-strap method,
    and coming up towards Grub2 has been interesting.
    That was something that I put off until I retired for the second time.

    In all the reading, it is apparent that the M$ monopoly on world-wide OS
    has been detrimental to the development of secure, stable, and modifiable OS
    for both corporate IT and little application users alike.
    The more I read, the more I am aware that M$ approach to several things is
    (1) fragile,
    (2) prone to hacked invasion,
    (3) difficult to adapt to embedded corporate IT installations.

    Anyway, learn to compromise and adapt, and you will get along fine with Linux.
    This is the best thing since Jason invented sliced bread.
    buena suerte,
    glene77is

  10. #10
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,110
    There is not reason you can not have a separate boot partition.
    You could in fact, have a separate grub partition if you wanted.
    The standard for people who do have a boot partition is to put it at the beginning of the drive.

    however when I boot the PC there is a grub error message ("File System Not Recognised")
    Exactly how do you get this message? When you power on the computer, do you get some kind of menu from which to make a selection? If you do and then get the error, what do you select?

    There is really no need to have the Linux Ubuntu partition marked as active/bootable.

    Have you tried running the blkid command from Ubuntu terminal to see if the entries in your grub.cfg file are the same as the blkid output for sda6 and sda7.

    Next time you boot Ubuntu, look to see where the kernel (vmlinuz) and initrd files are. The entries on my install show the vmlinuz and initrd in the /boot directory. The vmlinuz and initrd entires in the root directory (not the root user directory) are links. Don' really know if that will matter.

    Here's a link to a Grub2 Ubuntu tutorial. Maybe you've see it already?

    https://help.ubuntu.com/community/Grub2

Page 1 of 2 1 2 LastLast

Posting Permissions

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