update-grub not adding an entry to grub.cfg

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read this

update-grub not adding an entry to grub.cfg

Postby Notna888 on Sun Apr 01, 2012 5:30 am

Hi there,

I'm a bit of a newb so any assumptions I make on how exactly grub and the MBR actually work are just that, assumptions, and if I'm not clear on something just let me know. (or if this has already been solved please link the thread to me, as you're a much better searcher than I)

For the last week or so I've been trying to regain access to my linux mint 11 partition after installing windows. I have two hard drives in my computer, Windows (and later a second partition trying to recover a working grub) on the first and Mint 11 on the second. I mainly want to return to mint 11 as I had just gotten it the way I wanted, it supported my usb wifi stick, it had all the programs I wanted etc etc

I had the MBR on the first linking to the boot partition I made on the second. After trying boot repair disc to regain grub, I did but with only the one entry of Windows. After trying the repair disk a few times I realized that it wasn't working for what ever reason, so I created a small second partition on the windows drive and installed mint 12 to it to see if that might sort it out (I was getting wishful) but alas it didn't, I did get mint 12, memtest and windows in the grub menu however.

When I run sudo update-grub it does say it recognizes mint 11 on /dev/sdb

When I installed mint 11 I made a separate boot partition.

I'm not afraid to enter the /boot/grub/grub.cfg file, nor the /etc/grub.d/ either

Sorry if this post is all over the place but I had a bit more information like UUID's, output of sudo fdisk -l, the current grub.cfg file, an entry I've written myself etc etc I was going to post here but it didn't save properly in my windows documents (also having trouble with the wifi stick... but that'll be another post sometime else) so if anyone has even a basic way for me to do it I'm all ears, thank you all very much

Also, if you require any information, just say
User avatar
Notna888
Level 1
Level 1
 
Posts: 21
Joined: Mon May 03, 2010 6:43 am
Location: Busselton Western Australia

Linux Mint is funded by ads and donations.
 

Re: update-grub not adding an entry to grub.cfg

Postby hal8000 on Sun Apr 01, 2012 10:53 am

Boot with the Mint CD in live mode and post the output of:

sudo fdisk -l

You should have at least a root, home and swap partitions.
/dev/sdb is the whole second hard drive a partition is /dev/sdb1 etc

You then need to reinstall grub2 from the live CD, you can use the method
here:
https://help.ubuntu.com/community/Grub2 ... ling_GRUB2
User avatar
hal8000
Level 3
Level 3
 
Posts: 161
Joined: Sun May 04, 2008 2:04 pm
Location: UK

Re: update-grub not adding an entry to grub.cfg

Postby Notna888 on Mon Apr 02, 2012 11:26 am

Thank you for your quick reply, unfortunately I've already tried the methods on there... how ever now I have my other information that didn't save properly the first time


sda1=windows
sda2=linux mint 12 (tried installing seeing if that would repair grub better than boot recovery)

sdb1=linux mint 11 /boot partition
sdb2=linux mint 11 / directory
sdb3=linux mint 11 /home
sdb4=swap

sdd1=external harddrive

sudo fdisk -l
Code: Select all
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa505a505

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63   296945459   148472698+   7  HPFS/NTFS/exFAT
/dev/sda2       296945460   312576704     7815622+  83  Linux

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xcdf8427f

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048      206847      102400   83  Linux
/dev/sdb2          206848   268550143   134171648   83  Linux
/dev/sdb3       268550144   309510143    20480000    b  W95 FAT32
/dev/sdb4       309510144   312580095     1534976   82  Linux swap / Solaris

Disk /dev/sdd: 1000.2 GB, 1000204885504 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525167 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xfff713b2

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1              63  1953520127   976760032+   7  HPFS/NTFS/exFAT


and

sudo ls -l /dev/disk/by-uuid
Code: Select all
total 0
lrwxrwxrwx 1 root root 10 2012-04-05 07:03 15CA-911A -> ../../sdb3
lrwxrwxrwx 1 root root 10 2012-04-05 07:03 3a789621-4fa7-4cec-9949-323a02529f18 -> ../../sda2
lrwxrwxrwx 1 root root 10 2012-04-05 07:04 5484795284793816 -> ../../sdd1
lrwxrwxrwx 1 root root 10 2012-04-05 07:03 62E40911E408E95D -> ../../sda1
lrwxrwxrwx 1 root root 10 2012-04-05 07:03 c230f75f-d593-43da-8475-cd3093d34646 -> ../../sdb4
lrwxrwxrwx 1 root root 10 2012-04-05 07:03 c7714925-6219-473f-96fc-c11d4dd1d0fa -> ../../sdb1
lrwxrwxrwx 1 root root 10 2012-04-05 07:03 fc0e16b0-710a-42e8-9fb6-b51904fe6d8d -> ../../sdb2


and finally the current grub file
Code: Select all
#
# 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 video_bochs
  insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set=root c26db662-a191-4153-963d-d1fff824d027
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  insmod part_msdos
  insmod ext2
  set root='(hd0,msdos2)'
  search --no-floppy --fs-uuid --set=root c26db662-a191-4153-963d-d1fff824d027
  set locale_dir=($root)/boot/grub/locale
  set lang=en_AU
  insmod gettext
fi
terminal_output gfxterm
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
if background_color 0,0,0; then
  clear
fi
### END /etc/grub.d/05_debian_theme ###

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

### BEGIN /etc/grub.d/10_linux ###
if [ ${recordfail} != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Linux Mint 12 32-bit, 3.0.0-12-generic (/dev/sda2)' --class linuxmint --class gnu-linux --class gnu --class os {
   recordfail
   set gfxpayload=$linux_gfx_mode
   insmod gzio
   insmod part_msdos
   insmod ext2
   set root='(hd0,msdos2)'
   search --no-floppy --fs-uuid --set=root c26db662-a191-4153-963d-d1fff824d027
   linux   /boot/vmlinuz-3.0.0-12-generic root=UUID=c26db662-a191-4153-963d-d1fff824d027 ro   quiet splash vt.handoff=7
   initrd   /boot/initrd.img-3.0.0-12-generic
}
menuentry 'Linux Mint 12 32-bit, 3.0.0-12-generic (/dev/sda2) -- recovery mode' --class linuxmint --class gnu-linux --class gnu --class os {
   recordfail
   insmod gzio
   insmod part_msdos
   insmod ext2
   set root='(hd0,msdos2)'
   search --no-floppy --fs-uuid --set=root c26db662-a191-4153-963d-d1fff824d027
   echo   'Loading Linux 3.0.0-12-generic ...'
   linux   /boot/vmlinuz-3.0.0-12-generic root=UUID=c26db662-a191-4153-963d-d1fff824d027 ro recovery nomodeset
   echo   'Loading initial ramdisk ...'
   initrd   /boot/initrd.img-3.0.0-12-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/10_lupin ###
### END /etc/grub.d/10_lupin ###

### 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,msdos2)'
   search --no-floppy --fs-uuid --set=root c26db662-a191-4153-963d-d1fff824d027
   linux16   /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
   insmod part_msdos
   insmod ext2
   set root='(hd0,msdos2)'
   search --no-floppy --fs-uuid --set=root c26db662-a191-4153-963d-d1fff824d027
   linux16   /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows NT/2000/XP (on /dev/sda1)" --class windows --class os {
   insmod part_msdos
   insmod ntfs
   set root='(hd0,msdos1)'
   search --no-floppy --fs-uuid --set=root 62E40911E408E95D
   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 ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###


nothing in any of the /etc/grub.d/*** files

thank you again
User avatar
Notna888
Level 1
Level 1
 
Posts: 21
Joined: Mon May 03, 2010 6:43 am
Location: Busselton Western Australia

Re: update-grub not adding an entry to grub.cfg

Postby hal8000 on Tue Apr 03, 2012 5:22 pm

Which mbr is grub2 installed into sda or sdb?

You should always have bash scripts in /etc/grub.d
These are what I have in Mint 12:

ls /etc/grub.d -l
total 68
-rwxr-xr-x 1 root root 6690 2012-04-01 10:13 00_header
-rwxr-xr-x 1 root root 5522 2011-10-01 13:14 05_debian_theme
-rwxr-xr-x 1 root root 1183 2011-10-23 17:05 06_mint_theme
-rwxr-xr-x 1 root root 7370 2011-10-22 20:24 10_linux
-rwxr-xr-x 1 root root 6518 2011-09-20 11:36 10_lupin
-rwxr-xr-x 1 root root 6344 2011-10-01 13:40 20_linux_xen
-rwxr-xr-x 1 root root 1588 2011-05-02 23:53 20_memtest86+
-rwxr-xr-x 1 root root 7545 2011-10-01 13:40 30_os-prober
-rwxr-xr-x 1 root root 214 2011-10-01 13:40 40_custom
-rwxr-xr-x 1 root root 95 2011-10-01 13:40 41_custom
-rw-r--r-- 1 root root 483 2011-10-01 13:40 README

The script called 30_os_prober is the script that detects other linux systems.
It can be disabled from /etc/default/grub

However any script starting 40_ is custom and will not be touched by grub2 even when it updates.

So you can edit 40_custom and chainload Mint 11 like this:

sudo gedit /etc/grub.d/40_custom
#!/bin/sh
exec tail -n +3 $0
# 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.
menuentry "Mint11" {
set root=(hd1,2)
chainloader +1
}


Which should chainload Mint 11 into booting.
sdb2 is root partition of Mint 11, so in grub2, this is (hd1,2)
so hopefully should work.
User avatar
hal8000
Level 3
Level 3
 
Posts: 161
Joined: Sun May 04, 2008 2:04 pm
Location: UK

Re: update-grub not adding an entry to grub.cfg

Postby Notna888 on Wed Apr 04, 2012 4:52 am

Shall try it when I get home, sorry about the confusion, I had the shell scripts but I meant I hadn't messed around with them, will report back here, thank you
User avatar
Notna888
Level 1
Level 1
 
Posts: 21
Joined: Mon May 03, 2010 6:43 am
Location: Busselton Western Australia

Re: update-grub not adding an entry to grub.cfg

Postby sunewbie on Wed Apr 04, 2012 8:41 am

Help in Ubuntu may be confusing, I tried chmod / chroot method and it worked.

perhaps a tutorial on community is explained in a easy way.

http://community.linuxmint.com/tutorial/view/245

Hope it's helpful to you.
Linux Beginners Search Engine | more details | Google CSE Page
Acceptance = Relief, Resistance = Stress | Strength become Habit, Habit becomes Weakness
Be not a traitor in your thoughts. Do everything that is necessary in Proper time.
User avatar
sunewbie
Level 5
Level 5
 
Posts: 509
Joined: Sun Sep 04, 2011 12:55 pm
Location: Mumbai, India

Re: update-grub not adding an entry to grub.cfg

Postby Notna888 on Wed Apr 04, 2012 11:29 am

No dice unfortunately... neither "chainloading" nor the "chmod / chroot method"

I did write my own menu entry basing it off the linux mint 12 one, except it kept saying it couldn't load the kernal, now this is just a crazy idea of mine and probably not common practice but I'm going to try copying the intrd and kernal file thingy's into the mint 12 /boot and work it out from there... so it'll look something like

menuentry 'Linux Mint 11 second test' --class linuxmint --class gnu-linux --class gnu --class os {
recordfail
set gfxpayload=$linux_gfx_mode
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd1,2)'
search --no-floppy --fs-uuid --set=root fc0e16b0-710a-42e8-9fb6-b51904fe6d8d
linux /boot/vmlinuz-2.6.something-something-generic root=UUID=c26db662-a191-4153-963d-d1fff824d027 ro quiet splash vt.handoff=7
initrd /boot/initrd.img-2.6.something-something-generic
}

Maybe this'll work, otherwise I might just have to salvage what I can and move on I guess, will come back with results
User avatar
Notna888
Level 1
Level 1
 
Posts: 21
Joined: Mon May 03, 2010 6:43 am
Location: Busselton Western Australia

Re: update-grub not adding an entry to grub.cfg

Postby sunewbie on Wed Apr 04, 2012 12:50 pm

If it's eating too much time, better take a back-up, wipeout everything (except windoz - if you have it) and go for fresh install. Install XFCE. Peace of mind :)

If you want to learn, good luck :)

Ideally, you can update grub and grub-pc or try reconfigure-grub-pc and this solves problems. Else the terminal will show grub updating, but it will not be installed in the MBR. But re-configuring grub-pc might work.

Code: Select all
sudo dpkg-reconfigure grub-pc


then
Code: Select all
sudo update-grub


if it does not work try

Code: Select all
sudo update-grub2


http://ubuntuforums.org/showthread.php?t=1581099

refer 4. Reinstall the grub packages.
Last edited by sunewbie on Thu Apr 05, 2012 1:28 am, edited 1 time in total.
Linux Beginners Search Engine | more details | Google CSE Page
Acceptance = Relief, Resistance = Stress | Strength become Habit, Habit becomes Weakness
Be not a traitor in your thoughts. Do everything that is necessary in Proper time.
User avatar
sunewbie
Level 5
Level 5
 
Posts: 509
Joined: Sun Sep 04, 2011 12:55 pm
Location: Mumbai, India

Re: update-grub not adding an entry to grub.cfg

Postby hal8000 on Wed Apr 04, 2012 6:54 pm

Ok, I ow have grub2 loaded in my mbr and controlled by Mint12.

And the same problem, Mint 11 does not load, reason os-proper makes a total and proper
mess of reading any linux that uses grub legacy (e.g. Mint11).

I have created a custome /etc/grub/d/40 script which is executable, ran
sudo update-grub

and next reboot grub2 totally ignores it!
Its late now so will look into this tomorrow.
Do not reinstall as this will fix nothing, its related to the os-prober script.
User avatar
hal8000
Level 3
Level 3
 
Posts: 161
Joined: Sun May 04, 2008 2:04 pm
Location: UK

Re: update-grub not adding an entry to grub.cfg

Postby sunewbie on Thu Apr 05, 2012 1:19 am

:shock: Mint 11 uses grub legacy ??? I had Mint 9 based on Ubuntu 10.04 LTS and it used GRUB 2 i.e. 1.98, but not GRUB legacy. GRUB 2 (beta 4) was introduced in Ubuntu 9.10 Karmic so Mint 8 should have GRUB legacy, which has reached End of Life.

If that's the case, then upgrade GRUB to GRUB 2 in Mint 11 from ubuntu grub help (links in previous posts).

Alternatively, like you have said, in Mint 12 add manual entry of Mint 11 in 40_Custom file and then update grub2. Ideally things should work. It's strange :(

EDIT: I have Pinguy OS 11.04 equivalent to Mint 11 and I have Bodhi Linux equivalent to Mint 9, as they share same code base of Ubuntu. All are using Grub 2. I installed Xubuntu 11.10, then LM 12, Bodhi 1.2 (upgraded to 1.3), Pinguy 11.04 and Saline OS 1.6

since Saline OS was the last OS, it's GRUB installed in MBR and Saline OS option was on top.

Recently, I went for Bodhi dist-upgrade, which updated GRUB. Now I have Grub controlled by Bodhi and Bodhi is the first option. No issues with me.

update-grub does not work, but reconfigure grub-pc should work.
Linux Beginners Search Engine | more details | Google CSE Page
Acceptance = Relief, Resistance = Stress | Strength become Habit, Habit becomes Weakness
Be not a traitor in your thoughts. Do everything that is necessary in Proper time.
User avatar
sunewbie
Level 5
Level 5
 
Posts: 509
Joined: Sun Sep 04, 2011 12:55 pm
Location: Mumbai, India

Re: update-grub not adding an entry to grub.cfg

Postby hal8000 on Thu Apr 05, 2012 2:59 pm

I have now found a solution and it is grub2's os_prober script failing to properly detect and configure
other linux systems.

Although grub legacy may not be developed anymore its far easier customizing than grub2.
Graphics, font size, style and positioning all easily controlled with one config script, not looking
through 100's of line of code in grub2.

This site on Suse shows how easy it is to change font and backgrounds in grub legacy:
http://en.opensuse.org/SDB:Gfxboot

I have been using grub-customizer in both Mint 12 and Ubuntu 11.10 and have found that 40_custom
scripts are deleted and now start at 16_custom

I have also found that any mistake in a custom grub2 script means that the entry will not be displayed.

I am also finding grub2 slower than grub-legacy at displaying menu entries. Not sure why but grub2 splash
screen appears then entries appear almost 1/2 second later. In grub legacy, splash screen appears instantly
with menu entries.

Will post my entry for Mint11 for Notna88 shortly as an example.
User avatar
hal8000
Level 3
Level 3
 
Posts: 161
Joined: Sun May 04, 2008 2:04 pm
Location: UK

Re: update-grub not adding an entry to grub.cfg

Postby sunewbie on Fri Apr 06, 2012 1:17 am

hal8000 wrote:I have now found a solution and it is grub2's os_prober script failing to properly detect and configure
other linux systems.

Although grub legacy may not be developed anymore its far easier customizing than grub2.
Graphics, font size, style and positioning all easily controlled with one config script, not looking
through 100's of line of code in grub2.



True very true. Chances are more to make a mistake in Grub 2.

I am not facing any issue in time lag between BG and text
Linux Beginners Search Engine | more details | Google CSE Page
Acceptance = Relief, Resistance = Stress | Strength become Habit, Habit becomes Weakness
Be not a traitor in your thoughts. Do everything that is necessary in Proper time.
User avatar
sunewbie
Level 5
Level 5
 
Posts: 509
Joined: Sun Sep 04, 2011 12:55 pm
Location: Mumbai, India

Re: update-grub not adding an entry to grub.cfg

Postby hal8000 on Fri Apr 06, 2012 7:27 am

sunewbie wrote:
I am not facing any issue in time lag between BG and text


I'm looking into the delay, I have same delay in Ubuntu installing grub2 to the MBR as well.

I may disable os-prober and write custome scripts to see if that helps. I have got about 8 systems
with BSD and OSX across two hard drives so it may be due to delay in reading configuration; I don't
for certain yet if this is the problem.
User avatar
hal8000
Level 3
Level 3
 
Posts: 161
Joined: Sun May 04, 2008 2:04 pm
Location: UK

Re: update-grub not adding an entry to grub.cfg

Postby sunewbie on Fri Apr 06, 2012 9:08 am

hal8000 wrote:
sunewbie wrote:
I am not facing any issue in time lag between BG and text


I'm looking into the delay, I have same delay in Ubuntu installing grub2 to the MBR as well.

I may disable os-prober and write custome scripts to see if that helps. I have got about 8 systems
with BSD and OSX across two hard drives so it may be due to delay in reading configuration; I don't
for certain yet if this is the problem.


In case of 2 HDD, delay might be there.

I had 2 HDD and only Ubuntu 10.04 and XP installed. GRUB took 23 seconds to load on power on, but upon restart it was displayed immediately in 1-2 seconds. At that time, there was a similar bug, so waited for a bug fix. Later I found that it's 2 HDD creating problem. I guess if you remove 1 HDD, then the problem might be automatically stored. Also Ubiquity is not very smart. I had 320 GB HDD with formatted partitions and I had a 320 GB USB external HDD. When I clicked on install alongside XP, it took external HDD for installation, since it was the biggest HDD. I could do nothing then keep staring at my screen like a helpless Chick :( Ubiquity is not that smarter.

Alternatively, sometimes, GRUB does not overwrite itself. So Install XP / Win 7 bootloader through repair option, which will wipe GRUB. Then again reinstall GRUB2

Hope you figure out the problem and find the solution
Linux Beginners Search Engine | more details | Google CSE Page
Acceptance = Relief, Resistance = Stress | Strength become Habit, Habit becomes Weakness
Be not a traitor in your thoughts. Do everything that is necessary in Proper time.
User avatar
sunewbie
Level 5
Level 5
 
Posts: 509
Joined: Sun Sep 04, 2011 12:55 pm
Location: Mumbai, India

Re: update-grub not adding an entry to grub.cfg

Postby hal8000 on Sat Apr 07, 2012 11:08 am

sunewbie wrote:
hal8000 wrote:
sunewbie wrote:Alternatively, sometimes, GRUB does not overwrite itself. So Install XP / Win 7 bootloader through repair option, which will wipe GRUB. Then again reinstall GRUB2

Hope you figure out the problem and find the solution



I have found the problem and its related to the hapless os_prober script. The size of /boot/grub.cfg grew to 29k !!. Doesn't sound much but grub2 has to parse this file and all options.
Orac burg # ls -l grub.cfg
-r--r--r-- 1 root root 29327 2012-04-07 13:57 grub.cfg


I disabled 10_linux and 30_os_prober and have all manual entries. The size of each file is about 500 bytes:
ls -l /etc/grub.d
total 88
-rwxr-xr-x 1 root root 8753 2011-10-15 19:11 00_header
-rw-r--r-- 1 root root 4756 2011-10-15 19:11 10_linux
-rw-r--r-- 1 root root 4756 2012-04-07 13:28 10_linux.bak
-rw-r--r-- 1 root root 6620 2012-04-07 13:55 30_os-prober
-rw-r--r-- 1 root root 6620 2012-04-07 13:28 30_os-prober.bak
-rwxr-xr-x 1 root root 630 2012-04-07 14:50 40_custom
-rwxr-xr-x 1 root root 531 2012-04-07 14:26 41_custom
-rwxr-xr-x 1 root root 471 2012-04-07 15:16 42_custom
-rwxr-xr-x 1 root root 542 2012-04-07 15:05 43_custom
-rwxr-xr-x 1 root root 307 2012-04-07 14:58 44_custom
-rwxr-xr-x 1 root root 591 2012-04-07 15:04 45_custom
-rwxr-xr-x 1 root root 465 2012-04-07 15:17 46_custom
-rwxr-xr-x 1 root root 314 2012-04-07 15:38 47_custom
-rwxr-xr-x 1 root root 552 2012-04-07 15:35 48_custom
-rwxr-xr-x 1 root root 313 2012-04-07 15:37 49_custom


This is a much faster way of booting grub2 when you have multiple distros installed.
However if a kernel is updated then you have to manually update the custom script and
re-run sudo update-grub

This is no problem as update-grub failed to properly detect most of the distributions anyway.
I have installed burg now (same in Ubuntu or Mint 12) so have icons alongside each system
as well.
User avatar
hal8000
Level 3
Level 3
 
Posts: 161
Joined: Sun May 04, 2008 2:04 pm
Location: UK

Re: update-grub not adding an entry to grub.cfg

Postby sunewbie on Sat Apr 07, 2012 11:44 am

nice to know that you have figured out the problem :)

As you have said, update grub might not detect all distros, but you can manually add them with 40_custom

I have heard of Brug and have seen some videos on youtube, looks very eye candy, but I do not want to play with GRUB, when everything is working fine.
Linux Beginners Search Engine | more details | Google CSE Page
Acceptance = Relief, Resistance = Stress | Strength become Habit, Habit becomes Weakness
Be not a traitor in your thoughts. Do everything that is necessary in Proper time.
User avatar
sunewbie
Level 5
Level 5
 
Posts: 509
Joined: Sun Sep 04, 2011 12:55 pm
Location: Mumbai, India

Linux Mint is funded by ads and donations.
 

Return to Installation & Boot

Who is online

Users browsing this forum: bumi11, Exabot [Bot] and 28 guests