Welcome, Guest. Please login or register.
Did you miss your activation email?
July 31, 2010, 09:01:22 pm

Kubuntu Forums  |  Kubuntu Discussion  |  Kubuntu 9.10 Karmic Koala  |  Software Support  |  Topic: Grub2 and a small question 0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Grub2 and a small question  (Read 1807 times)
Fintan
Kubuntu Veteran
*******
Offline Offline

Posts: 3563


Mostly harmless


« on: July 26, 2009, 03:22:36 am »

As you all can see here:
http://kubuntuforums.net/forums/index.php?topic=3105278.new;topicseen#new

I had a few problems with netbook karmic and grub2 that were finally resolved, or almost  Wink

That is the reason for this Thread.

According to this:
http://ubuntuforums.org/showthread.php?t=1195275

The grub.cfg should not be edited manually.
One should edit one of the /etc/grub.d/files.

This is where it becomes confusing.

My machine has ubuntu on sda1 and Kubuntu karmic on sda3

So I should have one Kubuntu karmic and one ubuntu, right?
Wrong.

I have two ubuntu's:
The relevant grub.cfg is attached below

The first ubuntu recorded by /etc/grub.d/30_os-prober points to my swap partition.

The second ubuntu recorded by /etc/grub.d/30_otheros points to the correct partition.

So, something in the /etc/grub.d/30_os-prober file is obviously wrong but I cannot figure out what it is.

For reference I have attached the
/etc/grub.d/30_os-prober file below.

Grub legacy was a lot easier  Wink

Any ideas?
Logged

Pentium IV 2.3 Ghz
1.5 GB Ram
ATI Radeon 9250 pro
Karmic 9.10 backup
Lucid 10.04 Main
Lucid 10.04 KDE4.5 Testing
Maveric 10.10 alpha Testing

Acer Travelmate 4021
1'5 GB ram
Intel GMA900 Shared Memory
Kubuntu 10.04 Lucid KDE 4.5 RC- Main
Lucid Netbook - KDE 4.5 RC testing
Rog131
Kubuntu Veteran
*******
Offline Offline

Posts: 3922


Kubuntu facientes adiuvant


« Reply #1 on: July 27, 2009, 05:29:40 am »

Is that your entire/original grub.cfg ?

It seems to be missing the top (header, theme,  linux). The top at here:
Quote
#
# 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 ###
set default=0
set timeout=5
set root=(hd1,1)
search --no-floppy --fs-uuid --set 66d15cbe-ef37-488b-aaf0-f6c1cc3a4170
if loadfont /usr/share/grub/ascii.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
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-4-generic" {
   set root=(hd1,1)
   search --no-floppy --fs-uuid --set 66d15cbe-ef37-488b-aaf0-f6c1cc3a4170
   linux   /boot/vmlinuz-2.6.31-4-generic root=UUID=66d15cbe-ef37-488b-aaf0-f6c1cc3a4170 ro   quiet splash
   initrd   /boot/initrd.img-2.6.31-4-generic
}
menuentry "Ubuntu, Linux 2.6.31-4-generic (recovery mode)" {
   set root=(hd1,1)
   search --no-floppy --fs-uuid --set 66d15cbe-ef37-488b-aaf0-f6c1cc3a4170
   linux   /boot/vmlinuz-2.6.31-4-generic root=UUID=66d15cbe-ef37-488b-aaf0-f6c1cc3a4170 ro single
   initrd   /boot/initrd.img-2.6.31-4-generic
}
menuentry "Ubuntu, Linux 2.6.31-3-generic" {
   set root=(hd1,1)
   search --no-floppy --fs-uuid --set 66d15cbe-ef37-488b-aaf0-f6c1cc3a4170
   linux   /boot/vmlinuz-2.6.31-3-generic root=UUID=66d15cbe-ef37-488b-aaf0-f6c1cc3a4170 ro   quiet splash
   initrd   /boot/initrd.img-2.6.31-3-generic
}
menuentry "Ubuntu, Linux 2.6.31-3-generic (recovery mode)" {
   set root=(hd1,1)
   search --no-floppy --fs-uuid --set 66d15cbe-ef37-488b-aaf0-f6c1cc3a4170
   linux   /boot/vmlinuz-2.6.31-3-generic root=UUID=66d15cbe-ef37-488b-aaf0-f6c1cc3a4170 ro single
   initrd   /boot/initrd.img-2.6.31-3-generic
}
### END /etc/grub.d/10_linux ###

What do you have at the /etc/grub.d ?. At here: 00_header  05_debian_theme  10_linux  20_memtest86+  30_os-prober  30_otheros  40_custom.

If you have all those you could try to rebuild the grub.cfg with the command:
Code:
sudo update-grub2
Logged

dibl
Kubuntu Veteran
*******
Offline Offline

Posts: 10366


What does not kill me makes me stronger ...


WWW
« Reply #2 on: July 27, 2009, 05:39:05 am »


So I should have one Kubuntu karmic and one ubuntu, right?
Wrong.

I have two ubuntu's:
The relevant grub.cfg is attached below

The first ubuntu recorded by /etc/grub.d/30_os-prober points to my swap partition.

The second ubuntu recorded by /etc/grub.d/30_otheros points to the correct partition.


Fintan, thanks for experimenting with Grub2 -- maybe you'll save the rest of us some grief!   Grin


OK, I think you do have Ubuntu and Kubuntu, but with the menu pointing to the wrong partition.  Kubuntu has always been identified by Grub as "Ubuntu" on the menu -- the kernel is the same on both.

So, use "blkid" to get the correct UUID for the partition where Kubuntu lives, and then edit the menu to reflect it correctly in both places:
Quote
title      Ubuntu 9.04, kernel 2.6.28-14-generic
uuid      2a5c02ca-bf06-4b1c-9f2c-ba0454bbc83b
kernel      /boot/vmlinuz-2.6.28-14-generic root=UUID=2a5c02ca-bf06-4b1c-9f2c-ba0454bbc83b ro quiet splash
initrd      /boot/initrd.img-2.6.28-14-generic
quiet

Logged


Kubuntu 10.04 64-bit

Intel X6800/D975XBX2/GTX260

Top 20 Kubuntu FAQs HERE
Rog131
Kubuntu Veteran
*******
Offline Offline

Posts: 3922


Kubuntu facientes adiuvant


« Reply #3 on: July 27, 2009, 05:49:00 am »

If the problem is the double markings: 30_os-prober vs 30_otheros then you could clean the 30_otheros file so that it only have:
Code:
#!/bin/sh
exec tail -n +3 $0
and rebuild the grub.cfg
Logged

Fintan
Kubuntu Veteran
*******
Offline Offline

Posts: 3563


Mostly harmless


« Reply #4 on: July 27, 2009, 06:27:15 am »

@rog:
Thank you but yes that is the whole grub.cfg.

In the mean time I played a little and did a dist-upgrade of ubutnu which gave me the final release of juanty and the latest 9.04 kernel.

This is the new grub.cfg after removing old kernels from Ubuntu and KK and sudo update-grub:

Quote
# 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 ###
set default=0
set timeout=5
set root=(hd0,7)
search --no-floppy --fs-uuid --set 81c5b42f-4f49-44c8-becd-1217a5c0fa9d
if loadfont /usr/share/grub/ascii.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
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set root=(hd0,3)
search --no-floppy --fs-uuid --set aafa3492-4ede-4f3b-bd0f-cef789423981
insmod tga
if background_image /images/backgroundfintan1.tga ; then
  set color_normal=black/black
  set color_highlight=magenta/black
else
  set menu_color_normal=cyan/blue
  set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-4-generic" {
   set root=(hd0,3)
   search --no-floppy --fs-uuid --set aafa3492-4ede-4f3b-bd0f-cef789423981
   linux   /vmlinuz-2.6.31-4-generic root=UUID=81c5b42f-4f49-44c8-becd-1217a5c0fa9d ro   quiet splash
   initrd   /initrd.img-2.6.31-4-generic
}
menuentry "Ubuntu, Linux 2.6.31-4-generic (recovery mode)" {
   set root=(hd0,3)
   search --no-floppy --fs-uuid --set aafa3492-4ede-4f3b-bd0f-cef789423981
   linux   /vmlinuz-2.6.31-4-generic root=UUID=81c5b42f-4f49-44c8-becd-1217a5c0fa9d ro single
   initrd   /initrd.img-2.6.31-4-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
   linux   /memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
   linux   /memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Ubuntu 9.04, kernel 2.6.28-13-generic (on /dev/sda1)" {
   set root=(hd0,1)
   search --no-floppy --fs-uuid --set b91170ae-6234-41e9-b8e9-0e2c82ae4e33
   linux /boot/vmlinuz-2.6.28-13-generic root=UUID=b91170ae-6234-41e9-b8e9-0e2c82ae4e33 ro quiet splash
   initrd /boot/initrd.img-2.6.28-13-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-13-generic (recovery mode) (on /dev/sda1)" {
   set root=(hd0,1)
   search --no-floppy --fs-uuid --set b91170ae-6234-41e9-b8e9-0e2c82ae4e33
   linux /boot/vmlinuz-2.6.28-13-generic root=UUID=b91170ae-6234-41e9-b8e9-0e2c82ae4e33 ro single
   initrd /boot/initrd.img-2.6.28-13-generic
}
menuentry "Ubuntu 9.04, memtest86+ (on /dev/sda1)" {
   set root=(hd0,1)
   search --no-floppy --fs-uuid --set b91170ae-6234-41e9-b8e9-0e2c82ae4e33
   linux /boot/memtest86+.bin
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_otheros ###

# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda1.
menuentry "Ubuntu jaunty (development branch), kernel 2.6.28-9-generic (on /dev/sda1)" {
   set root=(hd0,1)
   search --no-floppy --fs-uuid --set b91170ae-6234-41e9-b8e9-0e2c82ae4e33
   linux /boot/vmlinuz-2.6.28-9-generic root=UUID=b91170ae-6234-41e9-b8e9-0e2c82ae4e33 ro quiet splash
   initrd /boot/initrd.img-2.6.28-9-generic
}


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda1.
menuentry "Ubuntu jaunty (development branch), kernel 2.6.28-9-generic (recovery mode) (on /dev/sda1)" {
   set root=(hd0,1)
   search --no-floppy --fs-uuid --set b91170ae-6234-41e9-b8e9-0e2c82ae4e33
   linux /boot/vmlinuz-2.6.28-9-generic root=UUID=b91170ae-6234-41e9-b8e9-0e2c82ae4e33 ro single
   initrd /boot/initrd.img-2.6.28-9-generic
}


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda1.
menuentry "Ubuntu jaunty (development branch), memtest86+ (on /dev/sda1)" {
   set root=(hd0,1)
   search --no-floppy --fs-uuid --set b91170ae-6234-41e9-b8e9-0e2c82ae4e33
   linux /boot/memtest86+.bin 
}

### END /etc/grub.d/30_otheros ###

### BEGIN /etc/grub.d/40_custom ###
# This file is an example on how to add custom entries
### END /etc/grub.d/40_custom ###

Notice that the ...30_otheros section now points to a kernel that is not there anymore Huh but the uuid's are correct Smiley.

Quote
What do you have at the /etc/grub.d ?. At here: 00_header  05_debian_theme  10_linux  20_memtest86+  30_os-prober  30_otheros  40_custom.

Yes, I have all of those files in/etc/grub.d

In the old grub.cfg the 30_otheros section was correct and the 30_os-prober section was off.

Now 30_otherors is completely off.
I can edit that though Smiley

@dible thankx for designating me as a good ginnypig Wink Smiley

Ahhh yes, blkid.

Well that gives nothing in Karmic netbook Huh
Quote
fintan@fintanws3:~$ blkid
fintan@fintanws3:~$

Very strange Huh Tongue

Logged

Pentium IV 2.3 Ghz
1.5 GB Ram
ATI Radeon 9250 pro
Karmic 9.10 backup
Lucid 10.04 Main
Lucid 10.04 KDE4.5 Testing
Maveric 10.10 alpha Testing

Acer Travelmate 4021
1'5 GB ram
Intel GMA900 Shared Memory
Kubuntu 10.04 Lucid KDE 4.5 RC- Main
Lucid Netbook - KDE 4.5 RC testing
Rog131
Kubuntu Veteran
*******
Offline Offline

Posts: 3922


Kubuntu facientes adiuvant


« Reply #5 on: July 27, 2009, 09:54:42 am »

About blkid

Here, the blkid was just dying without the output. Then i tried:
Code:
sudo blkid
and the normal blkid started to work.

Very strange  Huh


Maybe you need to make the default cache file /etc/blkid.tab with the "sudo blkid"

man blkid
Quote
OPTIONS
-c cachefile

Read from cachefile instead of reading from the default cache file /etc/blkid.tab.  If you want  to  start  with  a clean  cache  (i.e.  don't  report  devices previously scanned but not necessarily available at this time), specify /dev/null.
Logged

Fintan
Kubuntu Veteran
*******
Offline Offline

Posts: 3563


Mostly harmless


« Reply #6 on: July 27, 2009, 10:43:48 am »

sudo blkid worked here on the laptop as well.

The desktop reacts normaly
Logged

Pentium IV 2.3 Ghz
1.5 GB Ram
ATI Radeon 9250 pro
Karmic 9.10 backup
Lucid 10.04 Main
Lucid 10.04 KDE4.5 Testing
Maveric 10.10 alpha Testing

Acer Travelmate 4021
1'5 GB ram
Intel GMA900 Shared Memory
Kubuntu 10.04 Lucid KDE 4.5 RC- Main
Lucid Netbook - KDE 4.5 RC testing
dibl
Kubuntu Veteran
*******
Offline Offline

Posts: 10366


What does not kill me makes me stronger ...


WWW
« Reply #7 on: July 27, 2009, 10:47:49 am »

Yes, the /etc/blkid.tab file is "built" once and then sits there unchanged in subsequent bootups.  So you really need to
Code:
sudo rm /etc/blkid.tab
and then run
Code:
sudo blkid
to get the "current" values of device UUIDs.
Logged


Kubuntu 10.04 64-bit

Intel X6800/D975XBX2/GTX260

Top 20 Kubuntu FAQs HERE
Fintan
Kubuntu Veteran
*******
Offline Offline

Posts: 3563


Mostly harmless


« Reply #8 on: September 06, 2009, 03:04:37 am »

Grub2 on karmic alpha5 with travelmate 4021 does not recognize all OS's until you run:
Code:
sudo update-grub
Logged

Pentium IV 2.3 Ghz
1.5 GB Ram
ATI Radeon 9250 pro
Karmic 9.10 backup
Lucid 10.04 Main
Lucid 10.04 KDE4.5 Testing
Maveric 10.10 alpha Testing

Acer Travelmate 4021
1'5 GB ram
Intel GMA900 Shared Memory
Kubuntu 10.04 Lucid KDE 4.5 RC- Main
Lucid Netbook - KDE 4.5 RC testing
GreyGeek
Global Moderator
Kubuntu Veteran
*****
Online Online

Posts: 2768


He's proof that you are never too old to use Linux


« Reply #9 on: September 06, 2009, 11:49:34 am »

Grub2 on karmic alpha5 with travelmate 4021 does not recognize all OS's until you run:
Code:
sudo update-grub

I have a similar setup:  Kubuntu 9.04 on /dev/sda1 and Kubuntu 9.10 on /dev/sda5.   Jaunty uses grub, Karmic uses grub2.
Jaunty's menu.lst had 9 kernel updates,  each with an additional "recover" option.  Karmic had only one kernel and its recovery option.

The first problem I  noticed, and mentioned on this forum previously, was that while grub2 boot screen had the correct kernel assignment for Karmic, and it would boot fine, and it gave correct listings for the 9 Jaunty kernels, only the oldest kernel would boot, regardless of which one I selected during bootup.  Also, after the first Karmic kernel  update, several of the Jaunty kernels were no longer listed (or were not in the visible part of the boot "window").

I first tried to edit menu.lst.  Removing the kernels didn't work because it was obvious that grub2 was dynamically reading their existance, not reading menu.lst.   Using the SystemSettings "Update Grub2" option failed with a message "Menu.list does not exist", or something like that, but it would install  an empty menu.lst file in my Karmic /boot/grub directory.

What I did to clear things up was to first boot into Jaunty and use Synaptic to remove EVERY kernel except 2.6.30, then reboot into Karmic and run "sudo update-grub".   Now both work correctly and I can boot the latest kernel in each.

However,  Karmic is running SO SMOOTHLY that I don't spend any time in Jaunty any more.  As far as the performance of my Sony VAIO VGN-FW140E/H notebook is concerned, running the 64b Karmic is a VAST improvement over the 32bit Jaunty, and Jaunty wasn't shabby, either.
Logged

"If Windows API becomes the default on Linux then what is the point of Linux?" -- Mark Shuttleworth
MONO is Windows API
Snowhog
KFNs unofficial 'presence' (AHD, SCE, sense 6)
Global Moderator
Kubuntu Veteran
*****
Offline Offline

Posts: 10455


"It is quite a three pipe problem, ..."


« Reply #10 on: September 06, 2009, 02:27:23 pm »

IIRC, there has been some discussion on an incompatibility issue with Grub 2 and Grub (legacy) installations. I think Qqmike has commented on this.
Logged

Toshiba Satellite P105-S6147
Intel Mobile 945GM/GMS, 943/940GML

Happily running:
Kubuntu LL 10.04

VMware Player 3.1.0 (Win XP Pro guest VM)

Using Linux since March 23, 2007
Linux User #446986
Kubuntu User #15733
Pages: [1] Go Up Print 
Kubuntu Forums  |  Kubuntu Discussion  |  Kubuntu 9.10 Karmic Koala  |  Software Support  |  Topic: Grub2 and a small question « previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.281 seconds with 14 queries.
 

MKPortal M1.1.1 ©2003-2006 mkportal.it
Page generated in 0.04487 seconds with 10 queries