Announcement

Collapse
No announcement yet.

[SOLVED]After reinstall - kernels that does not exist is listed below Win 7 entr

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED]After reinstall - kernels that does not exist is listed below Win 7 entr

    I have been looking at the advice given, but either my case is not explained, or (more probable) I don't understand what to do.

    I had to do a full reinstall of Windows 7, and, as this PC is "new" (to me), it seemed quicker to reinstall Kubuntu 9.10 than to start messing about with grub2 in order to get dual boot.

    Things went just fine - except one thing:

    I now have the good old Grub menu - but with some kernels listed below Windows 7.

    Just a little annoying, but I really would like to remove them, making the menu clean and simple.

    So: How do I get rid of these menu lines?

    Added:

    When I try inserting a nice splash, I get this:

    Code:
    nils@nils-ASUS:~$ sudo grub-mkconfig -o /boot/grub/grub.cfg           
    error: cannot open `/dev/sdf' while attempting to get disk size
    error: cannot open `/dev/sdf' while attempting to get disk size
    Generating grub.cfg ...
    error: cannot open `/dev/sdf' while attempting to get disk size
    The error message is repeated around 20 times, with these lines inserted:

    Code:
    Found linux image: /boot/vmlinuz-2.6.31-14-generic
    Found initrd image: /boot/initrd.img-2.6.31-14-generic
    Code:
    Found memtest86+ image: /boot/memtest86+.bin
    Found Windows 7 (loader) on /dev/sda1
    Code:
    Found Ubuntu 9.10 (9.10) on /dev/sda5


    #2
    Re: After reinstall - kernels that does not exist is listed below Windows 7 entry

    Have you tried to run
    Code:
    sudo update-grub2
    You can also remove the lines from the boot menu by deleting the unnecessary lines from /boot/grub/grub.cfg. You will find them in the file after
    Code:
    ### BEGIN /etc/grub.d/10_linux ###
    starting with menuentry.


    Comment


      #3
      Re: After reinstall - kernels that does not exist is listed below Windows 7 entry

      I would NOT recommend editing /boot/grub/grub.cfg. The accepted and safe way of editing the behavior of grub is to edit /etc/default/grub and then run "sudo update-grub2"
      "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
      – John F. Kennedy, February 26, 1962.

      Comment


        #4
        Re: After reinstall - kernels that does not exist is listed below Windows 7 entry

        Remove unused kernels then run the update. If it's still bugging you with too much stuff - you can edit the files in /etc/grub.d to achieve the desired results.

        Why don't you post your /etc/grub/grub.cfg file for examination and suggestions.

        Please Read Me

        Comment


          #5
          Re: After reinstall - kernels that does not exist is listed below Windows 7 entry

          1. One of the kernels listed under the Windows 7 entry is not on my system today. The other one will not be removed.

          And, when I run:

          sudo update-grub2,

          I get this error message:
          Code:
          error: cannot open `/dev/sdf' while attempting to get disk size
          error: cannot open `/dev/sdf' while attempting to get disk size
          Generating grub.cfg ...                    
          error: cannot open `/dev/sdf' while attempting to get disk size
          <...>
          error: cannot open `/dev/sdf' while attempting to get disk size
          Found linux image: /boot/vmlinuz-2.6.31-20-generic
          Found initrd image: /boot/initrd.img-2.6.31-20-generic
          error: cannot open `/dev/sdf' while attempting to get disk size
          <...>
          error: cannot open `/dev/sdf' while attempting to get disk size
          Found linux image: /boot/vmlinuz-2.6.31-14-generic
          Found initrd image: /boot/initrd.img-2.6.31-14-generic
          error: cannot open `/dev/sdf' while attempting to get disk size
          <...>
          error: cannot open `/dev/sdf' while attempting to get disk size
          Found memtest86+ image: /boot/memtest86+.bin
          Found Windows 7 (loader) on /dev/sda1
          error: cannot open `/dev/sdf' while attempting to get disk size
          <...>
          error: cannot open `/dev/sdf' while attempting to get disk size
          Found Ubuntu 9.10 (9.10) on /dev/sda5
          error: cannot open `/dev/sdf' while attempting to get disk size
          <...>
          error: cannot open `/dev/sdf' while attempting to get disk size
          done
          (<...> = one or many repetitions of

          2. Here is my /boot/grub/grub.cfg file:

          Code:
          #
          # 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 /boot/grub/grubenv ]; then
           have_grubenv=true
           load_env
          fi
          set default="0"
          if [ ${prev_saved_entry} ]; then
           saved_entry=${prev_saved_entry}
           save_env saved_entry
           prev_saved_entry=
           save_env prev_saved_entry
          fi
          insmod ext2
          set root=(hd0,7)
          search --no-floppy --fs-uuid --set 7fd8fd06-e717-4c11-aae9-ec453fbfeaa5
          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
          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/white
          ### END /etc/grub.d/05_debian_theme ###
          
          ### BEGIN /etc/grub.d/10_linux ###
          menuentry "Ubuntu, Linux 2.6.31-20-generic" {
              recordfail=1
              if [ -n ${have_grubenv} ]; then save_env recordfail; fi
          	set quiet=1
          	insmod ext2
          	set root=(hd0,7)
          	search --no-floppy --fs-uuid --set 7fd8fd06-e717-4c11-aae9-ec453fbfeaa5
          	linux	/boot/vmlinuz-2.6.31-20-generic root=UUID=7fd8fd06-e717-4c11-aae9-ec453fbfeaa5 ro  quiet splash
          	initrd	/boot/initrd.img-2.6.31-20-generic
          }
          menuentry "Ubuntu, Linux 2.6.31-20-generic (recovery mode)" {
              recordfail=1
              if [ -n ${have_grubenv} ]; then save_env recordfail; fi
          	insmod ext2
          	set root=(hd0,7)
          	search --no-floppy --fs-uuid --set 7fd8fd06-e717-4c11-aae9-ec453fbfeaa5
          	linux	/boot/vmlinuz-2.6.31-20-generic root=UUID=7fd8fd06-e717-4c11-aae9-ec453fbfeaa5 ro single 
          	initrd	/boot/initrd.img-2.6.31-20-generic
          }
          menuentry "Ubuntu, Linux 2.6.31-14-generic" {
              recordfail=1
              if [ -n ${have_grubenv} ]; then save_env recordfail; fi
          	set quiet=1
          	insmod ext2
          	set root=(hd0,7)
          	search --no-floppy --fs-uuid --set 7fd8fd06-e717-4c11-aae9-ec453fbfeaa5
          	linux	/boot/vmlinuz-2.6.31-14-generic root=UUID=7fd8fd06-e717-4c11-aae9-ec453fbfeaa5 ro  quiet splash
          	initrd	/boot/initrd.img-2.6.31-14-generic
          }
          menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
              recordfail=1
              if [ -n ${have_grubenv} ]; then save_env recordfail; fi
          	insmod ext2
          	set root=(hd0,7)
          	search --no-floppy --fs-uuid --set 7fd8fd06-e717-4c11-aae9-ec453fbfeaa5
          	linux	/boot/vmlinuz-2.6.31-14-generic root=UUID=7fd8fd06-e717-4c11-aae9-ec453fbfeaa5 ro single 
          	initrd	/boot/initrd.img-2.6.31-14-generic
          }
          ### END /etc/grub.d/10_linux ###
          
          ### BEGIN /etc/grub.d/20_memtest86+ ###
          menuentry "Memory test (memtest86+)" {
          	linux16	/boot/memtest86+.bin
          }
          menuentry "Memory test (memtest86+, serial console 115200)" {
          	linux16	/boot/memtest86+.bin console=ttyS0,115200n8
          }
          ### END /etc/grub.d/20_memtest86+ ###
          
          ### BEGIN /etc/grub.d/30_os-prober ###
          menuentry "Windows 7 (loader) (on /dev/sda1)" {
          	insmod ntfs
          	set root=(hd0,1)
          	search --no-floppy --fs-uuid --set 221cb4ee1cb4be5b
          	chainloader +1
          }
          menuentry "Ubuntu, Linux 2.6.31-19-generic (on /dev/sda5)" {
          	insmod ext2
          	set root=(hd0,5)
          	search --no-floppy --fs-uuid --set 88860d4b-3633-4b72-a59b-f0eaac4ea469
          	linux /boot/vmlinuz-2.6.31-19-generic root=UUID=88860d4b-3633-4b72-a59b-f0eaac4ea469 ro quiet splash
          	initrd /boot/initrd.img-2.6.31-19-generic
          }
          menuentry "Ubuntu, Linux 2.6.31-19-generic (recovery mode) (on /dev/sda5)" {
          	insmod ext2
          	set root=(hd0,5)
          	search --no-floppy --fs-uuid --set 88860d4b-3633-4b72-a59b-f0eaac4ea469
          	linux /boot/vmlinuz-2.6.31-19-generic root=UUID=88860d4b-3633-4b72-a59b-f0eaac4ea469 ro single
          	initrd /boot/initrd.img-2.6.31-19-generic
          }
          menuentry "Ubuntu, Linux 2.6.31-14-generic (on /dev/sda5)" {
          	insmod ext2
          	set root=(hd0,5)
          	search --no-floppy --fs-uuid --set 88860d4b-3633-4b72-a59b-f0eaac4ea469
          	linux /boot/vmlinuz-2.6.31-14-generic root=UUID=88860d4b-3633-4b72-a59b-f0eaac4ea469 ro quiet splash
          	initrd /boot/initrd.img-2.6.31-14-generic
          }
          menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode) (on /dev/sda5)" {
          	insmod ext2
          	set root=(hd0,5)
          	search --no-floppy --fs-uuid --set 88860d4b-3633-4b72-a59b-f0eaac4ea469
          	linux /boot/vmlinuz-2.6.31-14-generic root=UUID=88860d4b-3633-4b72-a59b-f0eaac4ea469 ro single
          	initrd /boot/initrd.img-2.6.31-14-generic
          }
          ### 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 ###

          Comment


            #6
            Re: After reinstall - kernels that does not exist is listed below Windows 7 entry

            The menu entries below Windows 7 are kernels which are on your /dev/sda5. update-grub2 searches all of your partitions and hd for kernel images. I don't know how to restrict update-grub2 to searching specific partitions. If you delete (or comment out) the entries below the Windows menu entry they will be back on your next run of update-grub2 (or kernel update).
            But you can boot into the Ubuntu on your sda5 and remove the unused kernels. That can limit the unnecessary lines in your grub menu.

            Comment


              #7
              Re: After reinstall - kernels that does not exist is listed below Windows 7 entry

              Another solution would be to edit /etc/grub.d/40_custom and copy the entries you want from the ### BEGIN /etc/grub.d/30_os-prober ### section of your /boot/grub/grub.conf file to it.

              Then change the properties of /etc/grub.d/30_os-prober and make it non-executable, thus preventing it from being executed by update-grub.

              Then when you run update-grub, it won't search for other OS's but it will add in only your manual entries. This method will work well if you use the sda5 install as am emergency backup install and don't update it often. If you do update it - you have to edit /etc/grub.d/40_custom yourself.

              Alternate method if you plan on updating sda5 install regularly: install grub2 to your sda5 partition (after booting to it) and put a chainload entry for that os into /etc/grub.d/40_custom. Then you'll get a second grub menu, but /etc/grub.d/40_custom on your main install won't need updating.

              If you are a multi-boot maniac and use several different distros - you might consider a separate grub2 partition that you manually edit yourself. I do this and whenever I update an install - I cut-n-paste from the installers grub.cfg into my dedicated grub.cfg. One extra step from the norm, but keeps my menu ther way I want it.

              Please Read Me

              Comment


                #8
                Re: After reinstall - kernels that does not exist is listed below Windows 7 entry

                Thank you; I am slowly getting nearer to understand what these files are all about - but not there yet.

                You are right, I have an old HD split in two - sda5 is one partition, and contains an old, not used version of Kubuntu.

                However - I am not allowed to delete any of these, and it is not these that are in my grub2 menu.

                The grub2 menu repeats the install kernel from the CD: 2.6.31-14 and a non-existing 2.6.31-19 from a previous install of the 64 bit Kubuntu here.

                Perhaps the simplest first - why can't I remove the kernels on sda5?
                Does this have something to do with the error message posted:

                Code:
                error: cannot open `/dev/sdf' while attempting to get disk size

                Comment


                  #9
                  Re: After reinstall - kernels that does not exist is listed below Windows 7 entry

                  Originally posted by nilsA
                  You are right, I have an old HD split in two - sda5 is one partition, and contains an old, not used version of Kubuntu.

                  However - I am not allowed to delete any of these, and it is not these that are in my grub2 menu.

                  The grub2 menu repeats the install kernel from the CD: 2.6.31-14 and a non-existing 2.6.31-19 from a previous install of the 64 bit Kubuntu here.

                  Perhaps the simplest first - why can't I remove the kernels on sda5?
                  Does this have something to do with the error message posted:

                  Code:
                  error: cannot open `/dev/sdf' while attempting to get disk size
                  There are several things going on here it seems:

                  1) The /dev/sdf error likely has to do a USB device you had plugged in during one of your updates. A thumb drive, mem card or external hard drive Another possibility is your system has left the old device atttached. so "sudo cat /dev/sdf" and it should say "no medium found." Anything else means some is wrong.

                  2) I don't know what you mean by "why can't I remove the kernels on sda5." Do you mean you boot to that install and apt-get refuses to remove the kernel's? If you no longer use this install at all - reformat or delete the partition. If you're having trouble uninstalling the older kernels - in a console type "sudo kpackagekit", then in the searchbar type "2.6.31-14", the click on the gray X's next to each installed package, then click "Apply"

                  3)"The grub2 menu repeats the install kernel from the CD: 2.6.31-14 and a non-existing 2.6.31-19 from a previous install of the 64 bit Kubuntu here." - It's not repeating the 2.6.31-14 entry - it is stating that you have it on two different partitions - sda5 and sda7

                  According to your grub.cfg you have:

                  Windows 7 on /dev/sda1
                  Kubuntu on /dev/sda5 with two kernels installed: -19 and -14
                  Kubuntu on /dev/sda7 with two kernels installed: -20 and -14


                  Please Read Me

                  Comment


                    #10
                    Re: After reinstall - kernels that does not exist is listed below Windows 7 entry

                    The Grub 2 Guide

                    Well written. Helped me to understand how to setup/manage Grub 2.
                    Windows no longer obstructs my view.
                    Using Kubuntu Linux since March 23, 2007.
                    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                    Comment


                      #11
                      Re: After reinstall - Grub problem SOLVED (sort of).

                      Originally posted by Snowhog
                      The Grub 2 Guide

                      Well written. Helped me to understand how to setup/manage Grub 2.
                      A little too much too fast - I have to get started first ;-)

                      I'm getting there, so I'll make a link to that Guide.

                      What happened is this:

                      Probably I had a SD card in a slot on the PC during install or reinstall.
                      Then I did not understand how KK "think" during a reinstall, so at my first HD I had sda1 for Win7, sda5 and sda 7 for old and new Kubuntu, and then an old IDE drive where still older installs of Kubuntu resided.


                      Solution (not very elegant but quick):

                      kdesu dolphin - remove the old kernels on the old drive partition.
                      reinstall from CD
                      delete the two Kubuntu partitions and one swap partition on the sda drive, and make them into one new partition.

                      ... at the moment upgrades are being downloaded, and things looks fine.

                      But I'd probably better copy the files I want to keep on the old drive and get rid of any old Kubuntu. As I have seen now and earlier, they can make a lot of trouble.

                      I'm a simple dual boot guy, so no need for fancy solutions to booting.

                      Comment


                        #12
                        Re: [SOLVED]After reinstall - kernels that does not exist is listed below Win 7 entr

                        All part of the learning process so you're in good company!

                        I learned after some early failures to plan better and backup when it mattered!

                        If you're considering moving away from windoze as your primary OS I suggest:

                        1) Learn to be adept at partitioning and control what the installer does. Even windoze lets you select a partition to install to.

                        2) When you set up a new hard drive or system - leave room for side-by installs. Linux (any flavor) requires much less room than windows and you have way more control. I always plan on 2 or 3 extra installs and make room for them in advance. 16gb is more than enough for any distro and 500gb hard drives are $60us. You can get four kubuntu's, 100gb for personal data, and still have enough room for a 330gb windows install! Way more than you need!!!

                        3) For your primary linux install have a separate /home and /tmp partition (and /boot and /grub if you really want to play around). This will insure you have space to play without overfilling anything.

                        As a minimum:
                        sda1 - linux swap - 1 to 4 gb (match RAM size)
                        sda2 - windows
                        sda3 - primary linux install - from 6 to 16gb
                        sda4 - extended
                        sda5 - /home
                        sda6 - linux backup install 16gb
                        sda7 - /tmp - 12 to 32gb

                        I left windows and /home sizes blank - you decide how much you need where. Also, /tmp should be big if you do video editing or stuff like that, smaller if you don't.

                        Please Read Me

                        Comment

                        Working...
                        X