linux - GRUB-2 Bootloader fails to load for lack of floppy drive. Ubuntu 10.4 & Windows XP

16
2013-10
  • kammer

    2010.07.21 while trying to install Ubuntu 10.4

    Hello all,

    I've been trying to install Ubuntu 10.04 on my Dell workstation and am unable to get the Grub-2 bootloader to load properly. It seems to be failing for lack of a floppy drive on the system resulting in an error message that reads :

    error: fd0 cannot get C/H/S values.  
    

    I've gone through the Grub-2 page at https://help.ubuntu.com/community/Grub2 to no avail and other sources having similar problems have likewise turned up no solutions. I would certainly appreciate any insight, here's the background:

    A while back I was trying to install a different version of Linux and had the same problems, then had to set the project aside for a bit. I don't think this has anything to do with Linux or Ubuntu per se, but rather Grub.

    The system is an old (4-5 years) Dell workstation that has one drive (128 GB) set up for Windows XP and a second new drive (500GB) which I installed for Linux. There is a DVD/CD drive and the system contains no floppy drive at all. In one attempt to get this working I tried modifying the BIOS to indicate there was a floppy drive - this created a failure earlier in the chain with the BIOS failing to load properly, not unexpected, just a shot in the dark at that point.

    At the moment I am considering just running out to buy and install a cheap floppy drive to see if that helps. I'll never use the thing though so I'd rather find a solution that doesn't require me to spend money on useless hardware.

    In any case, here's the /boot/grub/grub.cfg contents:

    #
    # 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 fbebde47-f488-41b0-9480-337802ecb988
    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 fbebde47-f488-41b0-9480-337802ecb988
    set locale_dir=($root)/boot/grub/locale
    set lang=en
    insmod gettext
    if [ ${recordfail} = 1 ]; then
      set timeout=-1
    else
      set timeout=10
    fi
    insmod play
    play 480 440 1
    ### 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.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {
     recordfail
     insmod ext2
     set root='(hd1,1)'
     search --no-floppy --fs-uuid --set fbebde47-f488-41b0-9480-337802ecb988
     linux /boot/vmlinuz-2.6.32-21-generic root=UUID=fbebde47-f488-41b0-9480-337802ecb988 ro   quiet splash
     initrd /boot/initrd.img-2.6.32-21-generic
    }
    menuentry 'Ubuntu, with Linux 2.6.32-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
     recordfail
     insmod ext2
     set root='(hd1,1)'
     search --no-floppy --fs-uuid --set fbebde47-f488-41b0-9480-337802ecb988
     echo 'Loading Linux 2.6.32-21-generic ...'
     linux /boot/vmlinuz-2.6.32-21-generic root=UUID=fbebde47-f488-41b0-9480-337802ecb988 ro single 
    
    
     echo 'Loading initial ramdisk ...'
     initrd /boot/initrd.img-2.6.32-21-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 fbebde47-f488-41b0-9480-337802ecb988
     linux16 /boot/memtest86+.bin
    }
    menuentry "Memory test (memtest86+, serial console 115200)" {
     insmod ext2
     set root='(hd1,1)'
     search --no-floppy --fs-uuid --set fbebde47-f488-41b0-9480-337802ecb988
     linux16 /boot/memtest86+.bin console=ttyS0,115200n8
    }
    ### END /etc/grub.d/20_memtest86+ ###
    
    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry "Microsoft Windows XP Home Edition (on /dev/sda1)" {
     insmod ntfs
     set root='(hd0,1)'
     search --no-floppy --fs-uuid --set 6ef0d4b4f0d4842d
     drivemap -s (hd0) ${root}
     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 ###
    

    Thoughts anyone?

    Thanks in advance.

  • Answers
  • jeremiahd

    Is there a setting in your BIOS for floppy emulation? If so, try turning it on, and it might solve (or at least workaround) the issue. If not, check for a "legacy USB" or similar option that makes the BIOS not start USB devices, and that might help. When you modified the BIOS to indicate there was a floppy drive, and it errored, what exactly did you do, and what exactly happened?

    From what I can tell, the error can be caused by certain BIOSes reporting usb devices as floppies. Grub then tries to probe for a floppy, and doesn't find an actual one, and borks. Assuming this is what is going on, it's supposedly fixed in grub-1.98-1 -- although upgrading to that may be more of a pain than it's worth.

    Putting a floppy in the system might solve the issue, I'm honestly not sure. It seems like it would, but that's a pretty nasty workaround.

  • BloodyIron

    Try turning the floppy controller off completely in the BIOS. It may be trying to initialize a device that doesn't exist. If GRUB can't see a controller, it shuold naturally do nothing at all about floppy.


  • Related Question

    linux - How can I make grub2 boot into Windows 7?
  • Grzenio

    I had Windows 7 installed on my system, then I installed Debian testing with grub2 as its boot manager. Initially I couldn't see windows entry in grub at all, so I ran:

    aptitude install os-prober kcpuload 
    update-grub
    

    Now I can see the entry, but when I select it I get only Win7 system restore, instead of the the real thing. Any ides how to make it work?

    EDIT: I tried the suggested approach to add a new file to /etc/grub.d, which generated an entry in grub.cfg, but it does not appear in the grub menu on boot :(

    I have this:

    grzes:/home/ga# cat /etc/grub.d/11_Windows
    #! /bin/sh -e
    echo Adding Windows >&2
    cat << EOF
    menuentry “Windows 7″ {
            set root=(hd0,2)
            chainloader +1
    }
    

    And I have the following grub.cfg file:

    grzes:/home/ga# cat /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                          
    }                             
    insmod ext2                   
    set root=(hd0,3)              
    search --no-floppy --fs-uuid --set 6ce3ff31-0ef7-41df-a6f5-b6b886db3a94
    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                                                                                                                                                           
    set locale_dir=/boot/grub/locale                                                                                                                             
    set lang=en                                                                                                                                                  
    insmod gettext                                                                                                                                               
    set timeout=5                                                                                                                                                
    ### END /etc/grub.d/00_header ###  
    

  • Related Answers
  • Smar

    First, you'll need to check the config. Its in theee... thee... /etc/grub.d/ ? /etc/grub/?.. somewhere there. Config file names look like this: 00xy, 10linux, 20other ... these are just examples, but the real thing is almost the same. Check them, where is the windows one. Back it up (copy it somewhere). You'll need something like this into the file:

    menuentry "Windows" {
    set root=(hd0,3)
    chainloader +1
    }
    

    If you haven't got any config file like this, just create one. Grub2's config reading is easy-to-understand. It goes incrementally. Like: 00* , 10*, 20*, etc. So your new file should be named 95-windowsfix if you want it to be the last entry, or give it a smaller number (to make it the first entry) than Linux configs have if you want it to be the first.)

    in the 'other' config file. Modify the set root value of course. Determine the hdd by typing: sudo fdisk -l . For example, /dev/sda1 is (hd0,0) if its on the second HDD: /dev/sdb1 >> (hd1,0) ..and so on. You can understand the syntax from this I guess. After you made the modifications, do an update-grub and you can try to boot it.

    I'm aware that this looks like a huge mess. Sorry for that. I don't have any Ubuntu machine near to me with Grub2 so thats why I wrote this much "i guess". If you won't be able to get it work, just ask.

  • Tom Wijsman

    Try this:

    grub-mkconfig -o /boot/grub/grub.cfg