PDA

View Full Version : [ubuntu] Grub2 introduction



ranch hand
October 29th, 2009, 11:22 PM
DON'T PANIC

There is a lot of great information on grub2 on this forum.

I wrote this up to give folks a flying start. This will not make you an expert but it will, hopefully, get you headed in the right direction.

A lot of people have trouble, right after installation, with other OS' being missing from the menu. The first thing to do for this is go to your terminal and;


sudo update-grub
This is all it takes a majority of the time.
EDIT (10-28-09)
There is another way to update grub;


sudo grub-mkconfig
This is supposed to be the default and will, I believe, soon replace update-grub altogether.
END EDIT

Grub2 is completely different from grub-legacy. If you are using grub2 be prepared to learn something new.


The menu that you see on the screen when you boot up comes from the /boot/grub/grub.cfg file.


The /boot/grub/grub.cfg file is generated everytime “update-grub” is run. This is run everytime you get a kernal update and many times when you get a grub update. It does not make sence to edit this file.


Grub.cfg is generated by scripts in /etc/grub.d.


00_header gets the ball rolling and gets your timeout and hidden menu information for the menu.


05_debian-theme sets up how your menu looks on the screen.


10_linux is the one that gives you the menu entry for the OS that you are on.


20_memtest86+ is what sets the memtest on your menu.


30_os-prober is what is responcible for finding the rest of your OS'.


40_custom is designed so that you can make custom entries.


Grub2 gets its time out information and sets up a hidden menu for you in /etc/default/grub.


If you need to edit a menu entry that does not work do not mess with grub.cfg. It is silly to do so. It will be over written.


Go to /etc/grub.d and add to the 40_custom file. For instance;
30_os-prober does not generate a functional menu entry for my Mandriva installs. So I have a custom entry that works every time and comes right up on the menu every time. It is not over written because it is regenerated every time that “update-grub” is run.


menuentry "linux-nonfb (on /dev/sda12)" {
insmod ext2
set root=(hd0,12)
search --no-floppy --fs-uuid --set c23ad2ca-67a5-4a42-8fcc-3baa6d8e454e
linux /boot/vmlinuz BOOT_IMAGE=linux-nonfb root=UUID=c23ad2ca-67a5-4a42-8fcc-3baa6d8e454e resume=UUID=59fe476e-6d4f-e390-ced9-f29328538dfc
initrd (hd0,11)/boot/initrd.img
}
As you can see the partition is defined as being in two different places in this entry. It will not boot. The entry below will boot very well indeed.



menuentry "Mandriva-Gnome" {
linux (hd0,12)/boot/vmlinuz
initrd (hd0,12)/boot/initrd.img
}
This also works very well for your non-grub2 Ubuntu OS'.


I use a slightly different entry for grub2 Ubuntu installs;


menuentry "Kinky-Grub2-A2 on sda10 2.6.31-11-generic" {
set root=(hd0,10)
linux /vmlinuz root=/dev/sda10 so quiet splash
initrd /initrd.img
}
This entry works even if you change the OS on the partition.

Your custom entries must be in the proper form. The first thing to do is start your favorite text editor (I use gedit). Go to preferences and set it so that there is NO test wrapping.

Then, in your 40_custom file put in an entry such as;


echo "Adding Kinky-Grub2-A2 on sda10 (2.6.31-11-generic)" >&2
cat << EOF
menuentry "Kinky-Grub2-A2 on sda10 2.6.31-11-generic" {
set root=(hd0,10)
linux /vmlinuz root=/dev/sda10 so quiet splash
initrd /initrd.img
}
EOF
That is the entire entry for that OS. It is the one that I use for experimenting on grub2. The part that does the work is between the { }s. Make sure that they are where they belong.


If you save this file as 06_custom it will appear at the top of menu you see on the screen. If you save it as 40_custom it will appear at the bottom of menu you see on the screen.


Now, what is the advantage of this rigamarole compared to grub-leagacy.


Well, if you have three OS' on your drive and you set up a custom menu you do not need any other menu entries at all. So you change the permissions on 10_linux, 20_memtest86+, 30_custom so that they are not executable. They will not run when “update-grub” is run and so the onoy thing on your menu is your custom entries. There is nothing that can mess with these entries except you.


You must remember to run;


sudo update-grub
Everytime you do anything that is to change your menu. This will overwrite your /boot/grub/grub.cfg file and thus the menu that shows up on your screen.


Here are some links, some more useful than others, that I have collected.

Some grub2 links;


http://members.iinet.net/~herman546/p20.html (http://members.iinet.net/%7Eherman546/p20.html)

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

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

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

http://grub.enbug.org/

http://grub.enbug.org/Manual

http://grub.enbug.org/CommandList

https://wiki.ubuntu.com/Grub2#Adding...0to%20Grub%202 (https://wiki.ubuntu.com/Grub2#Adding%20Entries%20to%20Grub%202)

https://wiki.ubuntu.com/Grub2#Recove...20via%20LiveCD (https://wiki.ubuntu.com/Grub2#Recover%20Grub%202%20via%20LiveCD)

http://members.iinet.net/~herman546/p20/GRUB2%20CLI%20Mode%20Commands.html#cli_loopback (http://members.iinet.net/%7Eherman546/p20/GRUB2%20CLI%20Mode%20Commands.html#cli_loopback)

http://members.iinet.net/~herman546/p20/GRUB2%20Splashimages.html (http://members.iinet.net/%7Eherman546/p20/GRUB2%20Splashimages.html)

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

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

https://help.ubuntu.com/community/Grub2#Using%20CLI%20to%20Boot

In case grub2 is just too much, you may want to take a look at this;

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

Some other links that are just interesting and may help or inspire some one;

http://ubuntuforums.org/showpost.php...9&postcount=16 (http://ubuntuforums.org/showpost.php?p=8099549&postcount=16)

http://ubuntuforums.org/showthread.p...98#post8100252 (http://ubuntuforums.org/showthread.php?t=1285098#post8100252)

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

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


HAVE FUN
__________________
Dell 480 XPS 3G ram Quad Core 2.40GHz 3x320G HDD, 320G External, GRUB 2 Introduction (http://ubuntuforums.org/showthread.php?t=1285897)
(http://ubuntuforums.org/showthread.php?t=1285897)
Last edited by ranch hand (http://ubuntuforums.org/posthistory.php?p=8072177); 1 Day Ago at 11:28 AM..

Muffinabus
October 29th, 2009, 11:25 PM
I just have one quick question. If Grub2 automatically detects my Windows 7 drive, will it do anything to the Windows MBR? I liked Grub legacy because I could edit the file knowing it would only affect this hard drive, now I'm unsure. I don't want Grub 2 to touch that hard drive AT ALL.

To clarify, I want Grub 2 to be able to boot to my separate Windows 7 drive, but don't want it to modify the Windows 7 MBR.

ranch hand
October 30th, 2009, 01:00 AM
While I have no problem with you having Win JerryLewis Pro on your box, I do not, and will not on mine.

So I am not the best guy to advise on this. Hopefully one of the other guys from testing will jump in here.

I believe, though, that you can set it up the same way you had it in grub-legacy.

darthmob
November 1st, 2009, 11:25 AM
Damn that's a lot to read into. Seems like things have taken a few steps into the direction of way more complicated. ;)

Luckily changing the timeout of the grub menu is still a matter of changing one line in a config. Change it in /etc/default/grub and execute a grub-update via terminal.

ranch hand
November 1st, 2009, 04:17 PM
Damn that's a lot to read into. Seems like things have taken a few steps into the direction of way more complicated. ;)

Luckily changing the timeout of the grub menu is still a matter of changing one line in a config. Change it in /etc/default/grub and execute a grub-update via terminal.
When you consider how many new types of bootable storage hardware keeps turning up, and different file systems, grub2 has the flexibility to deal with these things in the future.

Grub-legacy was, and is, a fantastic bootloader. I think that grub2 is going to be better.

It is not really that complicated. It is very different and new. If you dig up the Karmic Testing Forum you will see a whole lot of people real bewildered when alpha2 came out and we got grub2. I have 91 threads saved from that forum on grub2. It really does grow on you,

On thing that is not more complicated is updating multiboot systems. If you have 4 flavors on your box and one gets a kernel update you have to go in and edit the /boot/grub/menu.lst of the OS that is the boot/root (assuming it is not hte one with the new kernel).

Grub2 will pick up that kernel by simply running update-grub. If you use the right type of menu entry in a custom menu it will not need updated at all (this is what I do).

oldos2er
November 1st, 2009, 05:41 PM
ranch hand, thank you for posting this.

ranch hand
November 1st, 2009, 05:56 PM
I like the tiered snow fence they use in WY. I tell folks it is where you sit to watch the deer and the antelope play. Well, they do look like bleachers.

LewRockwell
November 1st, 2009, 06:16 PM
we've only been linking to two places:

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

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


there are some errors in one and/or both but it's mostly common sense

(like in one place "sudo apt-get update" is used...where "sudo update=grub" should have been noted)

.

timsdeepsky
November 1st, 2009, 06:17 PM
Thanks ranch hand....
Although this process did not work for me,,,,it worked on my sons computer....My XPS would fail to launch grub2 at all....I could install 9.04,,and upgrade to 9.10,,,,but this was not using grub2....This seemed to originate from my using 2 operating systems on separate hard drives....I ended up unplugging one hard drive,,,,installing 9.10,,,,then plugging it back in and running
sudo update-grub....This worked perfect for me....

ranch hand
November 1st, 2009, 07:09 PM
Wow, that is interesting.

I am actually having a problem booting another drive. I may try wiping my device map and trying that.

Grub2 is new and we have a lot to learn.

Upgrading is pretty rough. There are a lot of changes and some of the residual stuff from 9.04 is not real compatible with 9.10.

ranch hand
November 6th, 2009, 03:41 AM
I have redone my test platform to get ready for 10.04 testing. I reinstalled Mandriva2009-1 (spring) as we got an update on grub2that has not made it to the 9.10 repo yet.

It, unfortunately did not correct the os-prober problem. I still get the generated menuentry with two different partition definitions. In this new drive set up in now calls for (hd0,10) in the first instance (correct) and (hd0,9) in the second instance (wrong)

I am bummed but not surprised as it was a grub2 update, not an os-prober update.

kansasnoob
November 6th, 2009, 04:34 AM
My most recent try at letting grub-update have it's own way was still a total disaster (all bogus entries in bold):


menuentry "Microsoft Windows XP Home Edition (on /dev/sda1)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set c02402022401fc62
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry "Ubuntu 9.04, kernel 2.6.28-16-generic (on /dev/sda10)" {
insmod ext2
set root=(hd0,10)
search --no-floppy --fs-uuid --set 3128dea7-b986-4b45-8004-0b48bf97f9dd
linux /boot/vmlinuz-2.6.28-16-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro quiet splash vga=769
initrd /boot/initrd.img-2.6.28-16-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-16-generic (recovery mode) (on /dev/sda10)" {
insmod ext2
set root=(hd0,10)
search --no-floppy --fs-uuid --set 3128dea7-b986-4b45-8004-0b48bf97f9dd
linux /boot/vmlinuz-2.6.28-16-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro single
initrd /boot/initrd.img-2.6.28-16-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-15-generic (on /dev/sda10)" {
insmod ext2
set root=(hd0,10)
search --no-floppy --fs-uuid --set 3128dea7-b986-4b45-8004-0b48bf97f9dd
linux /boot/vmlinuz-2.6.28-15-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro quiet splash vga=769
initrd /boot/initrd.img-2.6.28-15-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-15-generic (recovery mode) (on /dev/sda10)" {
insmod ext2
set root=(hd0,10)
search --no-floppy --fs-uuid --set 3128dea7-b986-4b45-8004-0b48bf97f9dd
linux /boot/vmlinuz-2.6.28-15-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro single
initrd /boot/initrd.img-2.6.28-15-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-14-generic (on /dev/sda10)" {
insmod ext2
set root=(hd0,10)
search --no-floppy --fs-uuid --set 3128dea7-b986-4b45-8004-0b48bf97f9dd
linux /boot/vmlinuz-2.6.28-14-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro quiet splash vga=769
initrd /boot/initrd.img-2.6.28-14-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-14-generic (recovery mode) (on /dev/sda10)" {
insmod ext2
set root=(hd0,10)
search --no-floppy --fs-uuid --set 3128dea7-b986-4b45-8004-0b48bf97f9dd
linux /boot/vmlinuz-2.6.28-14-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro single
initrd /boot/initrd.img-2.6.28-14-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-13-generic (on /dev/sda10)" {
insmod ext2
set root=(hd0,10)
search --no-floppy --fs-uuid --set 3128dea7-b986-4b45-8004-0b48bf97f9dd
linux /boot/vmlinuz-2.6.28-13-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro quiet splash vga=769
initrd /boot/initrd.img-2.6.28-13-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-13-generic (recovery mode) (on /dev/sda10)" {
insmod ext2
set root=(hd0,10)
search --no-floppy --fs-uuid --set 3128dea7-b986-4b45-8004-0b48bf97f9dd
linux /boot/vmlinuz-2.6.28-13-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro single
initrd /boot/initrd.img-2.6.28-13-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-12-generic (on /dev/sda10)" {
insmod ext2
set root=(hd0,10)
search --no-floppy --fs-uuid --set 3128dea7-b986-4b45-8004-0b48bf97f9dd
linux /boot/vmlinuz-2.6.28-12-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro quiet splash vga=769
initrd /boot/initrd.img-2.6.28-12-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-12-generic (recovery mode) (on /dev/sda10)" {
insmod ext2
set root=(hd0,10)
search --no-floppy --fs-uuid --set 3128dea7-b986-4b45-8004-0b48bf97f9dd
linux /boot/vmlinuz-2.6.28-12-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro single
initrd /boot/initrd.img-2.6.28-12-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-11-generic (on /dev/sda10)" {
insmod ext2
set root=(hd0,10)
search --no-floppy --fs-uuid --set 3128dea7-b986-4b45-8004-0b48bf97f9dd
linux /boot/vmlinuz-2.6.28-11-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro quiet splash vga=769
initrd /boot/initrd.img-2.6.28-11-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-11-generic (recovery mode) (on /dev/sda10)" {
insmod ext2
set root=(hd0,10)
search --no-floppy --fs-uuid --set 3128dea7-b986-4b45-8004-0b48bf97f9dd
linux /boot/vmlinuz-2.6.28-11-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro single
initrd /boot/initrd.img-2.6.28-11-generic
}
menuentry "Linux Mint 7 Gloria, kernel 2.6.28-15-generic (on /dev/sda10)" {
insmod ext2
set root=(hd0,10)
search --no-floppy --fs-uuid --set 3128dea7-b986-4b45-8004-0b48bf97f9dd
linux /boot/vmlinuz-2.6.28-15-generic root=/dev/sda7 ro quiet splash
initrd /boot/initrd.img-2.6.28-15-generic
}
menuentry "Linux Mint 7 Gloria, kernel 2.6.28-15-generic (recovery mode) (on /dev/sda10)" {
insmod ext2
set root=(hd0,10)
search --no-floppy --fs-uuid --set 3128dea7-b986-4b45-8004-0b48bf97f9dd
linux /boot/vmlinuz-2.6.28-15-generic root=/dev/sda7 ro single
initrd /boot/initrd.img-2.6.28-15-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-16-generic (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 6ceb25f1-5904-490b-a7cc-d14b9d63c3b7
linux /boot/vmlinuz-2.6.28-16-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro quiet splash vga=769
initrd /boot/initrd.img-2.6.28-16-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-16-generic (recovery mode) (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 6ceb25f1-5904-490b-a7cc-d14b9d63c3b7
linux /boot/vmlinuz-2.6.28-16-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro single
initrd /boot/initrd.img-2.6.28-16-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-15-generic (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 6ceb25f1-5904-490b-a7cc-d14b9d63c3b7
linux /boot/vmlinuz-2.6.28-15-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro quiet splash vga=769
initrd /boot/initrd.img-2.6.28-15-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-15-generic (recovery mode) (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 6ceb25f1-5904-490b-a7cc-d14b9d63c3b7
linux /boot/vmlinuz-2.6.28-15-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro single
initrd /boot/initrd.img-2.6.28-15-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-14-generic (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 6ceb25f1-5904-490b-a7cc-d14b9d63c3b7
linux /boot/vmlinuz-2.6.28-14-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro quiet splash vga=769
initrd /boot/initrd.img-2.6.28-14-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-14-generic (recovery mode) (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 6ceb25f1-5904-490b-a7cc-d14b9d63c3b7
linux /boot/vmlinuz-2.6.28-14-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro single
initrd /boot/initrd.img-2.6.28-14-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-13-generic (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 6ceb25f1-5904-490b-a7cc-d14b9d63c3b7
linux /boot/vmlinuz-2.6.28-13-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro quiet splash vga=769
initrd /boot/initrd.img-2.6.28-13-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-13-generic (recovery mode) (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 6ceb25f1-5904-490b-a7cc-d14b9d63c3b7
linux /boot/vmlinuz-2.6.28-13-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro single
initrd /boot/initrd.img-2.6.28-13-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-12-generic (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 6ceb25f1-5904-490b-a7cc-d14b9d63c3b7
linux /boot/vmlinuz-2.6.28-12-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro quiet splash vga=769
initrd /boot/initrd.img-2.6.28-12-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-12-generic (recovery mode) (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 6ceb25f1-5904-490b-a7cc-d14b9d63c3b7
linux /boot/vmlinuz-2.6.28-12-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro single
initrd /boot/initrd.img-2.6.28-12-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-11-generic (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 6ceb25f1-5904-490b-a7cc-d14b9d63c3b7
linux /boot/vmlinuz-2.6.28-11-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro quiet splash vga=769
initrd /boot/initrd.img-2.6.28-11-generic
}
menuentry "Ubuntu 9.04, kernel 2.6.28-11-generic (recovery mode) (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 6ceb25f1-5904-490b-a7cc-d14b9d63c3b7
linux /boot/vmlinuz-2.6.28-11-generic root=UUID=6ceb25f1-5904-490b-a7cc-d14b9d63c3b7 ro single
initrd /boot/initrd.img-2.6.28-11-generic
}
menuentry "Linux Mint 7 Gloria, kernel 2.6.28-15-generic (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 6ceb25f1-5904-490b-a7cc-d14b9d63c3b7
linux /boot/vmlinuz-2.6.28-15-generic root=/dev/sda7 ro quiet splash
initrd /boot/initrd.img-2.6.28-15-generic
}
menuentry "Linux Mint 7 Gloria, kernel 2.6.28-15-generic (recovery mode) (on /dev/sda5)" {
insmod ext2
set root=(hd0,5)
search --no-floppy --fs-uuid --set 6ceb25f1-5904-490b-a7cc-d14b9d63c3b7
linux /boot/vmlinuz-2.6.28-15-generic root=/dev/sda7 ro single
initrd /boot/initrd.img-2.6.28-15-generic
}
menuentry "Linux Mint 7 Gloria, kernel 2.6.28-15-generic (on /dev/sda7)" {
insmod ext2
set root=(hd0,7)
search --no-floppy --fs-uuid --set 51ebb887-909b-43cb-b022-1300ddd78074
linux /boot/vmlinuz-2.6.28-15-generic root=/dev/sda7 ro quiet splash
initrd /boot/initrd.img-2.6.28-15-generic
}
menuentry "Linux Mint 7 Gloria, kernel 2.6.28-15-generic (recovery mode) (on /dev/sda7)" {
insmod ext2
set root=(hd0,7)
search --no-floppy --fs-uuid --set 51ebb887-909b-43cb-b022-1300ddd78074
linux /boot/vmlinuz-2.6.28-15-generic root=/dev/sda7 ro single
initrd /boot/initrd.img-2.6.28-15-generic
}
### END /etc/grub.d/30_os-prober ###


The one that really blows my mind is that Karmic's own /home is on sda10, but grub2 decided to see it as both a 9.04 and Mint OS.

That's sad when a boot-loader can't recognize the /home of the same OS it's installed in. And it even saw the Jaunty / as both Jaunty and Mint.

And despite trying and trying I can't for the life of me get Windows to chainload on multi-drive setups. I can only get it to work if I use grub-install to place grub on the mbr of the Windows drive and some people get freaky about that.

I tried one with Win XP on one drive, Win 7 on another, and Ubuntu on a third. Just couldn't get it to work so I reverted it to legacy grub.

It's all great fun to me but I can see some people possibly getting very frustrated.

I saw a reply from someone recently saying that Lucid would be built so you have to use grub2, but I doubt that. I mean I still use Lilo in a very few remote applications like some pen drive installs.

ranch hand
November 6th, 2009, 05:15 AM
It may be, and I do not know where the information would have come from, that an upgrade will install grub2 instead of using grub-legacy if that is what you are using.

This, to me, seems like a good thing due to all the problems of "cross pollination" we are suffering from.

I think that making it so you HAD to use grub2 would be a lot tougher than it is to say it. For that reason, alone, I doubt that it would be introduced into the LTS. That would take a massive rebuild of the kernel itself, I would think.

Amazing the things people come up with when rumors start flying.
EDIT
I always wondered what lilo was actually good for.

kansasnoob
November 6th, 2009, 06:39 AM
I see they finally approved my How To if you'd care to edit the link in your Intro:

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

ranch hand
November 6th, 2009, 07:14 AM
Well, I'll be giggered, I thought I had. Sorry.

It is done. They ought to approve it, I have seen a couple of posts where people have had trouble with that, can't remember where, wasn't on this forum. Wasn't the Stoner forum (I need to update that post too).

kansasnoob
November 6th, 2009, 07:40 AM
It was just approved 12 hours ago.

I noticed when I was searching for that thread about making it impossible to change boot-loaders, couldn't find it though.

I do hope since the next release is LTS, and knowing that a lot of Hardy users will jump over, that they'll complete the conversion so upgrades from Hardy will either switch to Grub2 or be presented with a choice.

I'm betting Lucid will be totally awesome. The one problem with Karmic that has me totally jiggered is random hard-lockups. There doesn't seem to be a "common cause" and I'll go days without having one, then other times it'll freeze 4 or 5 times right in a row.

The other stuff (printer that works in Jaunty but not Karmic and a change in alsa-utils that my sound card doesn't like) are things I think I could figure out if I spent some time at it.

Don1500
November 7th, 2009, 03:32 PM
Bump just to keep the link.
BTW, Grub2 and 9.10 works fine for me. Just sayin'

44tr
November 8th, 2009, 02:09 AM
How do you change the SPLASH screen to one of those cool custom ones? All of the instructions say to edit your menu.lst file ...

Now I'm a bit lost with Grub2, but I can see the advantages when all the instructions for modifications on different websites take it into account.

I did try to find the answer, but there is just too much to go through that I mostly don't understand. Thanks.

ranch hand
November 8th, 2009, 03:55 AM
In Grub2 this is all done in the /etc/grub.d/05_debian-theme file.

There are two ways of going abut it. One is to download "gub2-splashimages". This will guve yo several images to choose from. I did this in the example below. Note that where it defines where the image is it refers t o/usr/share/images/grub. That file is not there by default it is benerageted when you download the splashimeages.

Make sure that this path is correct because by default it calls for /usr/share/images/desktop-base.

You can also just put the image you want to use in /usr/share/images/desktop-base.

Then you need to put the title of the image in. My title is "menu" (see example). Make sure that the / is before it and the . after it. Png files work fine, by the way.

Down toward the bottom of the example I have changed the font color to show up on my image, from "black/black" and "magenta/black" to "white/black" and "yellow/black".


# check for usable backgrounds
use_bg=false
if [ "$GRUB_TERMINAL_OUTPUT" = "gfxterm" ] ; then
for i in {/boot/grub,/usr/share/images/grub}/menu.{png,tga} ; do
if is_path_readable_by_grub $i ; then
bg=$i
case ${bg} in
*.png) reader=png ;;
*.tga) reader=tga ;;
*.jpg|*.jpeg) reader=jpeg ;;
esac
if test -e /boot/grub/${reader}.mod ; then
echo "Found Debian background: `basename ${bg}`" >&2
use_bg=true
break
fi
fi
done
fi

# set the background if possible
if ${use_bg} ; then
prepare_grub_to_access_device `${grub_probe} --target=device ${bg}`
cat << EOF
insmod ${reader}
if background_image `make_system_path_relative_to_its_root ${bg}` ; then
set color_normal=white/black
set color_highlight=yellow/black
else
EOF

44tr
November 8th, 2009, 01:25 PM
thanks! Will give it a try, though it does look harder than "SPLASH = ..."

old_salt
November 8th, 2009, 03:10 PM
Question. Ubuntu is bragging about their boot times yet I'm not seeing anything but double that because of Grub2. I'm afraid that Ubuntu is going to get a black eye because of this.

I think the Devs should have pushed Grub2 way off like they did with Oo 3.x. They cite stability as their excuse for a lot of programs folks want & other distros provide yet they seem to have a propensity to push "Bleeding Edge" crap when it suits them or is to their best interests.

Is there any way to revert back to the legacy Grub for now?

ranch hand
November 8th, 2009, 06:13 PM
Yes there is a way to go back this is from my first post in this thread;


In case grub2 is just too much, you may want to take a look at this;

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

Use that guide. There are a couple pitfalls that you want to avoid and those directions are the safe way.

I have greatly improved boot time. I do not think that grub2 has much to do with it, mainly the xsplash and new GDM.

This is not a LTS release. 10.04 is. I believe a lot of these changes were thrown in here so that they can be used in 10.04.

Good luck in going back to grub-legacy.

Norm24
November 8th, 2009, 06:47 PM
I originally did an upgrade from Jaunty but I really had to see what Grub2 and Ext4 partioning could do so I backed up /home and went for a clean install.

My boot time has improved significantly.This version has been the greatest single improvement in a distro that I've seen.Can't wait till 10.04.

sappermajor
November 10th, 2009, 12:58 AM
Ranch Hand,

Thank you for your How To



EDIT

What follows is rubbish Ignore it

End Edit

I tried to renumber the 30_os-prober file from the FileBrowser from the Places menu and I found that I did not have the required permission; so I went back to the web and found how to Navigate in Terminal (which is on the Applications / Accessories menu)

To change directory
.....$ cd /etc/grub.d
then to rename the file I used the mv command to put Windows ahead of Linux by renaming the file, I put a sudo in to resolve permission issues.

......$ sudo mv 30_os-prober 07_os_prober
then

......$ ls
to check the directory listing

and finally

....$ sudo update-grub

Maybe obvious to you ... :D but a brainteaser for a nubie.

Nick aka Sappermajor

ranch hand
November 10th, 2009, 01:11 AM
That is interesting. Why on earth did you want to do that for? I am sure there is a good reason but I can't see it from here.

Thank you for your kind words.

sappermajor
November 10th, 2009, 01:43 AM
I'm clearly missing something I need windows to start first for my family as they are v conservative. If there is a better way of changing file names please let me know as it seems a bit round the houses. Maybe that I am muddling up the order and the default??

Nick

ranch hand
November 10th, 2009, 01:59 AM
Run;


gksudo gedit /boot/grub/grub.cfg

Count every menu entry in there down to and including your MS entry. Start your counting at 0.

Run;


gksudo gedit /etc/default/grub

Edit the line "GRUB_DEFAULT=0" to have the number you came up with instead of the 0.

Run'


sudo update-grub

Reboot and see if you got it right, I bet you do.

sappermajor
November 10th, 2009, 02:19 AM
Thanks that was much better. So much to learn....

ranch hand
November 10th, 2009, 02:42 AM
Grub2 is different. It is also more flexible.

You should consider a custom menu using the "generic" menuentry for Ubuntu. You could with a custom menu, do away with the executable permission on 10_linux, 30_os-prober and have a short menu that you never need to edit for kernels (I am assuming no more OS' on the box) or even if you upgrade to 10.04 when it comes out.

Of coarse you would have to change your default again.

HAVE FUN

Sissy13
November 10th, 2009, 07:49 AM
Thanks for posting these helpful hints! I was a bit panicked when I couldn't find /boot/grub/menu.lst, until I stumbled upon your thread. :)

ranch hand
November 10th, 2009, 08:22 AM
We hit grub2, knowing it was coming, when karmic(testing)Alpha2 was put out. It does come as a shock when you have gotten used to grub-legacy.

The first three link are great. The 2 guys responsible for the first 3 can make grub2 sit up and beg.

drs305 is very active on the forums here. Real good stuff.

Glad I was of some help. Some times it is nice if the thing is kept simple until you learn a little bit.

emeraldgirl08
November 10th, 2009, 08:27 AM
Thanks ranch hand!

I was also a little puzzled about the new Grub menu I saw at start up. This thread is a life-saver!

ranch hand
November 10th, 2009, 08:32 AM
An awful lot of folks here on the forums put up with some pretty simple questions when I join. Some time you have to give a little back.

You really need to check the links though. Those are really great. And in a lot more detail.

Glad I could help.

emeraldgirl08
November 10th, 2009, 08:22 PM
Looks like I got a different kernel in this morning. During installation of the updates I got a prompt asking if I wanted to keep grub settings, go with the suggested, etc. I went with the first option on the pull-down menu. Sorry I forget what it said exactly.

Okay in Jaunty I once chose a different option and Jaunty would boot the older kernel and not the newer version. To fix that I had to manually add the newer kernel name into /grub/boot/menu.lst and save. This worked with the older GRUB.

However- since Grub2 is new I am not sure what the kernel my laptop should be loading.

Any idea??? TIA.

ranch hand
November 10th, 2009, 08:58 PM
If you are real worried about it just run;


sudo update-grub

If you are just using the generated menu that will always keep it up to date.

If you do not want to look at all the menu entries for all of your kernels but want to keep them incase of some problem, you could try creating a custom menu.

All that entails is creating an entry in /etc/grub.d/40_custom that looks like this;


echo "Adding Lounge on sda7" >&2
cat << EOF
menuentry "Lounge on sda7" {
set root=(hd0,7)
linux /vmlinuz root=/dev/sda7 so quiet splash
initrd /initrd.img
}
EOF

That is a symbolic entry that just points grub at a partition. It will boot the most resent kernel present so it never needs updated.

The one above would need edited for your box with the correct partition indicated. The only part that really does anything is between the { and the }. You can edit the rest to suit your self if you leave the form alone. The title is between " and " what you put there is up to you.

Make sure the { and } are placed where shown. Do not forget the EOF at the end.

Rename the file when you save it to 06_custom and your entry will appear at the top of the menu on your screen.

Of coarse you must run;


sudo update-grub

To get this change written to your /boot/grub/grub.cfg file.

Z2.
November 16th, 2009, 09:21 AM
Thanks for your post RH - I was having a bit of a time with Grub2, now I know why (more or less) :-)

halovivek
November 16th, 2009, 11:30 AM
HI
IF i upgrade to GRUB 2 from the GRUB 1.
After upgrading my system from 9.04 to 9.10.
will the GRUB 2 Error 15 will arise?
Please let me know.
So i can go ahead and install the same.
Thanks

ranch hand
November 16th, 2009, 07:17 PM
HI
IF i upgrade to GRUB 2 from the GRUB 1.
After upgrading my system from 9.04 to 9.10.
will the GRUB 2 Error 15 will arise?
Please let me know.
So i can go ahead and install the same.
Thanks
If you have not yet upgraded 9.04 there are a couple things I would do first;
A>revert to the generic video driver.
B>rename or delete /etc/X11/xorg.conf (9.10 will generate the xorg.conf file if needed)
C>remove "grub" and "grub-common"
D>install "grub-pc" and "grub-common"

If you have already upgraded then yes I believe that will help and you should have this link too;
https://wiki.ubuntu.com/Grub2#Recover%20Grub%202%20via%20LiveCD

Gregmond
November 18th, 2009, 08:40 AM
Damn that's a lot to read into. Seems like things have taken a few steps into the direction of way more complicated. ;)

Luckily changing the timeout of the grub menu is still a matter of changing one line in a config. Change it in /etc/default/grub and execute a grub-update via terminal.

Damn I was going insane looking at this. I had a problem with my mouse, found an article that said add "noapic acpi=off" to the menu.lst (which I knew how to do for grub v1), and then started pulling my hair out tryiong to apply it to a clean install of Karmic Koala. Original post is very informative, but a little over the top for what I needed. Darthmob - thanks, your comment gave me an easy fix. Modifed the default file and did a sudo grub-update and it worked.. Mouse is now fixed by the looks of it.


:KS

Jasman
November 23rd, 2009, 06:37 PM
Thanks for this great source of grub2 info. Now, forgive me if this is a stupid question, but what happened to declaring a resume partition in the bootloader? I can't figure out where an how to do it. Should I be trying to?

ranch hand
November 23rd, 2009, 08:28 PM
I am not the best person to advise you on this. My box is either on or off.

That said, I thought that the swap partition was what carried the load in suspend/hibernate. I think you need to make sure that all your files that have to do with "resume" point to the correct partition.

It is pretty old but the files seem to be here in my 10.04testing OS so it probably works;

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

connor4312
January 29th, 2010, 01:43 PM
OMG THANKS SO MUCH! It's taken about a week of scouring the web to get Windows ExPee on my menu, and all it took was a little sudo grub-mkconfig. Thanks!:popcorn::D:D:D

Jjohn
February 11th, 2010, 09:22 AM
Thanks for the grub-update Ranch Hand

Will.V.King
March 17th, 2010, 10:04 PM
sudo update-grub
and
sudo grub-mkconfig

doesn't work for me.



I notice that the sentence in your grub.cfg is " so quiet splash" but ours are "ro quiet splash"

What's the difference between "so" and "ro"?



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

### BEGIN /etc/grub.d/10_lupin ###
menuentry "Ubuntu, Linux 2.6.31-20-generic" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set ce5041095040f9ab
loopback loop0 /ubuntu/disks/root.disk
set root=(loop0)
linux /boot/vmlinuz-2.6.31-20-generic root=/dev/sda1 loop=/ubuntu/disks/root.disk ro quiet splash
initrd /boot/initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-20-generic (recovery mode)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set ce5041095040f9ab
loopback loop0 /ubuntu/disks/root.disk
set root=(loop0)
linux /boot/vmlinuz-2.6.31-20-generic root=/dev/sda1 loop=/ubuntu/disks/root.disk ro single
initrd /boot/initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set ce5041095040f9ab
loopback loop0 /ubuntu/disks/root.disk
set root=(loop0)
linux /boot/vmlinuz-2.6.31-14-generic root=/dev/sda1 loop=/ubuntu/disks/root.disk ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set ce5041095040f9ab
loopback loop0 /ubuntu/disks/root.disk
set root=(loop0)
linux /boot/vmlinuz-2.6.31-14-generic root=/dev/sda1 loop=/ubuntu/disks/root.disk ro single
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_lupin ###

### BEGIN /etc/grub.d/20_memtest86+ ###PS: I can log on to 2.6.31-14. And I can't log on to 2.6.31-20. error You need to load the kernel first. or invalid media number (maybe it's "media" maybe another word, can't remember.)



lenovo@ubuntu:/$ sudo blkid -c /dev/null
/dev/loop0: UUID="0471a47f-e141-4b03-9edd-040ee2a1a9fc" TYPE="ext4"
/dev/sda1: UUID="CE5041095040F9AB" TYPE="ntfs"
/dev/sda5: UUID="B4F84896F84858AE" LABEL="D" TYPE="ntfs" I installed Ubuntu as an application on Windows System partition.


lenovo@ubuntu:/$ sudo update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.31-20-generic
Found initrd image: /boot/initrd.img-2.6.31-20-generic
Found linux image: /boot/vmlinuz-2.6.31-14-generic
Found initrd image: /boot/initrd.img-2.6.31-14-generic
Found Windows NT/2000/XP on /dev/sda1
done

I have read other discussions, but I am too tired to solve this problem. the morning is coming, I should have a rest. And then carry on solving this problem.....

ranch hand
March 17th, 2010, 10:55 PM
First off, the "so" is a typo on my part that got copy/pasted several times before I noticed it. This is stupid as the "ro" is "read only" and really should be there. The lesson here is be better at fyping than I am when editing files or be very sure to double check things.

You might want to go to synaptic and check to make sure that all the same packages are there for the "20" kernel as for the "14" kernel.

Add this to your /etc/grub.d/40_custom file;


echo "Adding Main on sda1" >&2
cat << EOF
menuentry "Main on sda1" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro quiet splash
initrd /initrd.img
}
EOF

and update grub.

The stuff in between the quotation marks is what you see on the menu screen and when you run update-grub. Edit to your hearts content.

Make sure that 40_custom is executable.

The entry should show up at the end (bottom) of your menu list.

This should;
A>boot to that partition
B>boot to the newest kernel

Boot and run;


uname -a

to see what you have booted to.

That is the only kind of entry I use as it does not need updated, ever. You can install some other debian based distro on the partition and that entry will still work.

Will.V.King
March 17th, 2010, 10:57 PM
wa so fast thanks.
I just restarted my computer, and had a try.

Before I restart my computer, I changed the 40_custom file, add like the following:


echo "Adding Ubuntu, Linux 2.6.31-20-generic on sda1" >&2
cat << EOF
menuentry "Ubuntu, Linux 2.6.31-20-generic" {
linux (hd0,1)/boot/vmlinuz-2.6.31-20-generic
initrd (hd0,1)/boot/initrd.img-2.6.31-20-generic
}
EOFIt doesn't work.

And I try to press E on the default line(the first line in the menu list).

and click "Control" + X
it says "invalid magic number"
and If I delete the line "linux /boot/vmlinuz-2.6.31-20-generic", it will say "You need to load kernel first".

OK, let me try what you told. Thanks a lot.

Before I restart my computer I want describe somethings that I can't understand.


lenovo@ubuntu:/$ cd /
lenovo@ubuntu:/$ ls
bin etc initrd.img.old mnt sbin tmp vmlinuz.old
boot home lib opt selinux usr xorg.conf.new
cdrom host lost+found proc srv var
dev initrd.img media root sys vmlinuz
lenovo@ubuntu:/$
first, there is a initrd.img file, in it's properties, it point to "/boot/initrd.img-2.6.31-20.generic" and the "/boot/initrd.img-2.6.31-20.generic" 's type is "Gzip archive".I can't use "sudo gzip -d initrd.img-2.6.31-20.generic" to decompress it.

but I notice the file type of "/boot/initrd.img-2.6.31-14.generic" is "31-14-generic document"

files under /boot/:

lenovo@ubuntu:/$ cd boot
lenovo@ubuntu:/boot$ ls
abi-2.6.31-14-generic memtest86+.bin
abi-2.6.31-20-generic System.map-2.6.31-14-generic
config-2.6.31-14-generic System.map-2.6.31-20-generic
config-2.6.31-20-generic vmcoreinfo-2.6.31-14-generic
grub vmcoreinfo-2.6.31-20-generic
initrd.img-2.6.31-14-generic vmlinuz-2.6.31-14-generic
initrd.img-2.6.31-20-generic vmlinuz-2.6.31-20-generic
lenovo@ubuntu:/boot$

/usr/src

lenovo@ubuntu:/boot$ cd /usr/src
lenovo@ubuntu:/usr/src$ ls
linux-headers-2.6.31-14 linux-headers-2.6.31-20-generic
linux-headers-2.6.31-14-generic nvidia-185.18.36
linux-headers-2.6.31-20
lenovo@ubuntu:/usr/src$

ranch hand
March 17th, 2010, 11:26 PM
Copy paste the one I sent. You do not want any reference to the kernel. That type of entry is "symbolic". It just points to the partition where your root ought to be and looks for a kernel to boot. Boots the most recent, viable kernel.

If that doesn't work get this script and run it. You will get a results file on your desktop. Post it.

http://sourceforge.net/projects/bootinfoscript/

This is a handy script that will tell you all about your boot condition. I have a copy and use it once in a while just to check on things.

Will.V.King
March 17th, 2010, 11:33 PM
I add

echo "Adding Main on sda1" >&2
cat << EOF
menuentry "Main on sda1" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro quiet splash
initrd /initrd.img
}
EOFto 40_custom
and

sudo update-grudand restart -> choose "Main on sda1" and get a message "You need to load the kernel first"
and I focus on "Main on sda1" press E and ctrl + X get "fill not found"

Thanks and I finished the searching:

Boot Info Script 0.55 dated February 15th, 2010

============================= Boot Info Summary: ==============================

=> Windows is installed in the MBR of /dev/sda

sda1: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows XP
Boot files/dirs: /boot.ini /ntldr /NTDETECT.COM /wubildr.mbr
/ubuntu/winboot/wubildr.mbr /wubildr
/ubuntu/winboot/wubildr /ubuntu/disks/root.disk
/ubuntu/disks/swap.disk

sda1/Wubi: __________________________________________________ _______________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 9.10
Boot files/dirs: /boot/grub/grub.cfg /etc/fstab

sda2: __________________________________________________ _______________________

File system: Extended Partition
Boot sector type: -
Boot sector info:

sda5: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info: According to the info in the boot sector, sda5 starts
at sector 63.
Operating System:
Boot files/dirs:

sda3: __________________________________________________ _______________________

File system:
Boot sector type: -
Boot sector info:
Mounting failed:
mount: unknown filesystem type ''

=========================== Drive/Partition Info: =============================

Drive: sda ___________________ __________________________________________________ ___

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
Disk identifier: 0xf0b1ebb0

Partition Boot Start End Size Id System

/dev/sda1 * 63 125,837,144 125,837,082 7 HPFS/NTFS
/dev/sda2 125,837,145 282,679,739 156,842,595 f W95 Ext d (LBA)
/dev/sda5 125,837,208 282,679,739 156,842,532 7 HPFS/NTFS
/dev/sda3 282,679,740 312,576,704 29,896,965 12 Compaq diagnostics


blkid -c /dev/null: __________________________________________________ __________

Device UUID TYPE LABEL

/dev/loop0 0471a47f-e141-4b03-9edd-040ee2a1a9fc ext4
/dev/sda1 CE5041095040F9AB ntfs
/dev/sda5 B4F84896F84858AE ntfs D

============================ "mount | grep ^/dev output: ===========================

Device Mount_Point Type Options

/dev/loop0 / ext4 (rw,errors=remount-ro)
/dev/sda1 /host fuseblk (rw)


================================ sda1/boot.ini: ================================

[boot loader]
timeout=7
default=C:\wubildr.mbr
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect
C:\GHLDR=һŒGHOST v2008.08.08 ˰
C:\wubildr.mbr = "Ubuntu"

======================== sda1/Wubi/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 /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
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 ###
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/10_lupin ###
menuentry "Ubuntu, Linux 2.6.31-20-generic" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set ce5041095040f9ab
loopback loop0 /ubuntu/disks/root.disk
set root=(loop0)
linux /boot/vmlinuz-2.6.31-20-generic root=/dev/sda1 loop=/ubuntu/disks/root.disk ro quiet splash
initrd /boot/initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-20-generic (recovery mode)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set ce5041095040f9ab
loopback loop0 /ubuntu/disks/root.disk
set root=(loop0)
linux /boot/vmlinuz-2.6.31-20-generic root=/dev/sda1 loop=/ubuntu/disks/root.disk ro single
initrd /boot/initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set ce5041095040f9ab
loopback loop0 /ubuntu/disks/root.disk
set root=(loop0)
linux /boot/vmlinuz-2.6.31-14-generic root=/dev/sda1 loop=/ubuntu/disks/root.disk ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set ce5041095040f9ab
loopback loop0 /ubuntu/disks/root.disk
set root=(loop0)
linux /boot/vmlinuz-2.6.31-14-generic root=/dev/sda1 loop=/ubuntu/disks/root.disk ro single
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_lupin ###

### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows NT/2000/XP (on /dev/sda1)" {
insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set ce5041095040f9ab
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.
echo "Adding Main on sda1" >&2
cat << EOF
menuentry "Main on sda1" {
set root=(hd0,1)
linux /vmlinuz root=/dev/sda1 ro quiet splash
initrd /initrd.img
}
EOF
### END /etc/grub.d/40_custom ###

============================= sda1/Wubi/etc/fstab: =============================

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/host/ubuntu/disks/root.disk / ext4 loop,errors=remount-ro 0 1
/host/ubuntu/disks/swap.disk none swap loop,sw 0 0

================= sda1/Wubi: Location of files loaded by Grub: =================


3.7GB: boot/grub/grub.cfg
.7GB: boot/initrd.img-2.6.31-14-generic
2.0GB: boot/initrd.img-2.6.31-20-generic
2.0GB: boot/vmlinuz-2.6.31-14-generic
6.4GB: boot/vmlinuz-2.6.31-20-generic
2.0GB: initrd.img
.7GB: initrd.img.old
6.4GB: vmlinuz
2.0GB: vmlinuz.old

ranch hand
March 17th, 2010, 11:41 PM
Did you check to see if all the packages were the same for 14 and 20 in synaptic. Be sure to check the sizes as there may be a problem there.

The way this sounds is that there is a problem with your kernel. The other kernel boots.

I think that I would be removing the kernel and reinstalling it.

Will.V.King
March 17th, 2010, 11:55 PM
8 hours ago, the update manager says there're new updates, so I began to update.
when I try to go to bed, about 6 hours before, I have a look at the screen. The update manager said I should put jdk-6u10-docs.zip to /tmp. So I download a jdk-6u10-docs.zip, and put it to the /tmp. Then update carried on and finished and need a restart to complete. Then I denied the restart, searched the Internet for a few minutes. And restart the computer manually.
Then I can boot to 20 generic.

I have checked the /boot , /usr/src . If there's a 14 there is a 20. and the size of the similar name files of 14 and 20 are almost the same.

I will reinstall the kernel. Thank you very much.~

You see every 14 or 20 file has a type. But I found vmlinuz-2.6.31-20-generic's type is UNKOWN! Although it's size is the same as vmlinuz-2.6.31-14-generic's.

ranch hand
March 18th, 2010, 12:07 AM
I do not understand exactly what you are saying here (could be clear but I am tired). You are saying that you could boot to the 20 kernel somehow?

I think that I know the basic problem here. Quit using Update Mangler. I admit that it is my opinion but I think it causes more trouble than good results. Use synaptic if you want a gui. Otherwise use apt or aptitiude. I prefer apt but there again that is me. One of he first things I do on any new install is to go to System>Administration>Software Sources and to the Updates tab and make sure that there is no check mark for Automatic Updates. This pretty much get UM out of my hair.

The motto here is "UM - just say no".

Will.V.King
March 18th, 2010, 12:29 AM
En, you are right, the auto update can't be sure that everything will be OK. Recently I just installed the eclipse and tomcat,First I choose to install them from the "Ubuntu Software Centre" and synaptic, but there're always some problems. So I download the compressed package from official web site manually . And installed them from the Terminal. Finally everything is OK.

Thanks again for your help. Thank you very much.

Will.V.King
March 18th, 2010, 01:31 AM
After using synaptic to reinstall all the 3 choices about linux-2.6.31.-20
I can't boot from any kernel now. there's no menu list after I choose boot from Ubuntu....
there's only a terminal I can press Tab to see what command I can use...
Now I am on winodws....

ranch hand
March 18th, 2010, 02:16 AM
Try this;

https://wiki.ubuntu.com/Grub2#Recover%20Grub%202%20via%20LiveCD

and you may be interested to have this link too

https://help.ubuntu.com/community/Grub2#Using%20CLI%20to%20Boot

I am assuming that you are using Ubuntu in some kind of virtual environment. I am not at all familiar with any problems that may come up there. I have tried it once with Virtual box to try SUSE.
Didn't think much of it. I prefer multi booting (probably a character flaw on my part).

I do know that if I were to allow a MS product in my house it would be the one in the virtual environment. Having a large security hole enclosing a more secure OS just seems backwards to me.
An old friend of mine only uses MS but uses it in a virtual environment for that very reason (I think it is in a Red Hat server - haven't seen it, or him, for years - too many miles).

Will.V.King
March 18th, 2010, 02:22 AM
I try again with the information I left here


insmod ntfs
set root=(hd0,1)
search --no-floppy --fs-uuid --set ce5041095040f9ab
loopback loop0 /ubuntu/disks/root.disk
set root=(loop0)
linux /boot/vmlinuz-2.6.31-14-generic root=/dev/sda1 loop=/ubuntu/disks/root.disk ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic


and it seems i get into the terminal,case I can use "cd" command and see some folders and folder tree.
But it told me that there's under init files in the "init" folder... looks like crashed or something else...
Now I am going to reinstall the whole system. I will be careful next time~
Change is not bad...

Yes wubi. Ubuntu installed as an application of Windows. If it's possible for me, I would like to install it as an independent OS. Actually I have an independent Ubuntu OS on another computer, it's 8.04 installed in last year~ and works good~

ranch hand
March 18th, 2010, 03:02 AM
If you look at my info in the left column (below the posters name) you will see that I still claim Hardy as my main OS. Do not really use it a lot but it is my "secure" OS and we use it for business that needs to be safe. Not exciting but a very solid OS.

I also have a copy of my Hardy that I have upgraded to 10.04-testing. I used apt to upgrade. Worked fine. Also have 2 new clean installs of 8.04.4 that I upgraded. That is all on the test drive that I am on now. When the time comes to upgrade the real thing it will be a fresh install, ext4 and the new grub all nice and shiny. Then I can wade through a couple years of files and transfer them and delete the dross.

Doesn't it take just as much room to be on your MS install as another partition would take? I have heard of wubi but never seen it. I got into Linux because I had decided that MS had to go or I would have a stroke so it was never an option for me. That is why I know nothing about it. I have never mixed the two types of OS' at all.

I do have a number of different OS' but they are all Linux.

Will.V.King
March 18th, 2010, 02:47 PM
Before I never installed the Ubuntu to my laptop, which I am using now, and also where the 9.10 installed on.

The size of the hard drive on the laptop is 160Gib. I divided it into two part, one 64Gib for Windows System, and another 80Gib for Data. As a student of software engineering, I have a lot large software need to use. If i installed all the software on one Windows OS, the speed of the OS will be slow down too much. So I made several versions of the OS backup images.
For example, I installed MS Visual Studio and MS SQL Server on to the Data Partition. And there are configures in the OS already. So I backup the System Partition to a image.
And saved the image file to my movable hard disk. Then restore the system back to the pure system status. And install My Eclipse and so on to Data Partition too. Then backup the System partition as another version of backup image.
When I need to use MS Visual Studio, I restore from the 1st image. When I need to use My Eclipse,I restore system from the 2nd image.

There's only 14Gib free space on the Data Partition. And it's dangerous to use all the free space. And there is about 33 Gib free space. So I decide to install Ubuntu to the System Partition.(I'm nearly graduated, and no need to run Windows recently.) To install the Ubuntu as an application of Windows, running on wubi, It will take several Gib free space. You should decide the size of the space at the beginning of the installation. And once you decide give the space to Ubuntu/wubi to use, The windows will treat it as an used space. No matter how much space you are really used in Ubuntu. And also the size for the Ubuntu/wubi can't be changed after Ubuntu installed. So I give 17Gib to Ubuntu. The default size is 17Gib.

PS: I believe the data deleted from the trash box in Linux can be also recoverable. If you need to deleted it entirely (not easy to be recovered), the data need to be overwritten after system change its status to deleted. Some software can help you to do that (but I don't know any of them, just know they are exist). Also I heard that data deleted in Windows 7 are harder to be recovered than it be deleted in Windows XP. Maybe it's the way that the systems deal with deleted files are different.

ranch hand
March 18th, 2010, 04:08 PM
Sounds like a very interesting set up. Sounds like it does need careful management.

I'd look into a bigger HD or a good external but those things do want paid for which may be tough on someone that has been in school for a while.