LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-23-2010, 02:29 PM   #1
matiasar
Member
 
Registered: Nov 2006
Location: Argentina
Distribution: Debian
Posts: 321
Blog Entries: 1

Rep: Reputation: 31
Thumbs up Grub to Grub2 - Transition and learning...


Hello!
I'm finding a little hard moving from the old Grub to the newer Grub2.
Really I found harder to add a menuentry in /etc/grub.d/40custom for Linux partitions. With Grub that used to be easy. May be there's some easy way with Grub2 too.
Within my first HD I run Debian Squeezy (with Grub2 as boot loader). I installed a second hd in which I installed Ubuntu, just for some testings Grub2 features porpouses. So, I added an entry in /etc/grub.d/40_custom

Code:
# Ubuntu
menuentry       "Ubuntu 8.04.4 LTS, kernel 2.6.24-27-generic" --class debian --class gnu-linux --class gnu --class os {
        insmod ext2
        set root='(/dev/hdb,1)'
        search --no-floppy --fs-uuid --set c3fc10db-cd1d-476b-9780-d6eb5e56ebc5[/B]
        echo Cargando Linux 2.6.24-27
        linux   /boot/vmlinuz-2.6.24-27-generic root=UUID=c3fc10db-cd1d-476b-9780-d6eb5e56ebc5 ro quiet
        echo loading initial ramdisk...
        initrd  /boot/initrd.img-2.6.24-27-generic
}
Finally it worked. But I'd like to know a few things:

1) For the entry to work I had to add: "--class debian --class gnu-linux --class gnu --class os" after the entry display name. Why is needed?

2) What is the option "search" to?

search --no-floppy --fs-uuid --set c3fc10db-cd1d-476b-9780-d6eb5e56ebc5[/B]

3) set root: In Grub2 does it support the old notation: set root=(hd1,1) ?

Really without those options Grub2 didn't runned the kernel on Ubuntu's partitions. I'd relly like to know why they are needed in Grub2.

Thanks in advance,
Matías
 
Old 04-24-2010, 08:30 AM   #2
martvefun
Member
 
Registered: Apr 2010
Location: Belgium
Distribution: Archlinux
Posts: 53

Rep: Reputation: 1
I find also grub2 harder to configure

if it can help you :

Code:
menuentry "Arch Linux" {
	insmod ext2
	set root=(hd0,7)
	search --no-floppy --fs-uuid --set 5000f957-3345-4c17-adf9-6d6e5e8c4048
	linux /vmlinuz26 root=/dev/sda10 ro init=/sbin/bootchartd
	initrd /kernel26.img
}
menuentry "Ubuntu 9.10 2.6.31-19" {
	insmod ext2
	set root=(hd0,9)
	search --no-floppy --fs-uuid --set 475c6415-680f-4155-bc0c-e91e7ebec36b
	linux /boot/vmlinuz-2.6.31-19-generic-pae root=UUID=475c6415-680f-4155-bc0c-e91e7ebec36b ro quiet splash
	initrd /boot/initrd.img-2.6.31-19-generic-pae
}
1) So no --class for me and it works fine. What happens if you remove it ?
2) I think "search" is to tell grub where the root partition is.
3) Both "root=(hd0,x)" and "root=UUID=..." works

Last edited by martvefun; 04-24-2010 at 08:32 AM.
 
Old 04-26-2010, 08:26 AM   #3
matiasar
Member
 
Registered: Nov 2006
Location: Argentina
Distribution: Debian
Posts: 321

Original Poster
Blog Entries: 1

Rep: Reputation: 31
Martvefun,

Thanks for your examples!
Grub2 actually seems harder may be because isn't so easy to find documentation.
Based in your tips I did some testing and worked. Really the "class" options are not a must.

Code:
menuentry       "Ubuntu 8.04.4 LTS, kernel 2.6.24-27-generic" {
        set root='(/dev/hdb,1)'
        search --no-floppy --fs-uuid --set /dev/hdb1
        echo Cargando Linux 2.6.24-27
        linux   /boot/vmlinuz-2.6.24-27-generic root=/dev/hdb1 ro quiet
        echo Cargando ramdisk inicial ...
        initrd  /boot/initrd.img-2.6.24-27-generic
But "search" parameter seem to be a must with Grub2.

I found some examples in /usr/share/doc/grub-common/examples/grub.cfg. But the example for GNU Linux lacks of "search" option. But for me, without search it didn't work.

Code:
#For booting GNU/Linux (example from /usr/share/doc...
menuentry "GNU/Linux" {
        set root=(hd0,1)
        linux /vmlinuz root=/dev/sda1
        initrd /initrd.img
}
I'll keep on doing some research.
Thanks a lot. Merci beaucoup!
 
Old 04-26-2010, 09:38 AM   #4
ronlau9
Senior Member
 
Registered: Dec 2007
Location: In front of my LINUX OR MAC BOX
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369

Rep: Reputation: Disabled
This might be some help www.ubuntuforums.org/showthread.php?t=1195275
 
Old 04-27-2010, 06:40 AM   #5
matiasar
Member
 
Registered: Nov 2006
Location: Argentina
Distribution: Debian
Posts: 321

Original Poster
Blog Entries: 1

Rep: Reputation: 31
That's a very good link. Thanks a lot for it.
Really one with more details on Grub2 I've found.

Regards,
Matías
 
Old 04-30-2010, 07:47 AM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Here is one more:

http://www.dedoimedo.com/computers/grub-2.html
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
grub vs grub2 miros84 Linux - Software 6 11-21-2014 02:26 AM
How do I need to format grub entry to boot from grub2 into grub legacy? mitchell7man Linux - Software 6 04-03-2010 03:03 AM
Help converting grub-legacy to grub2 ssenuta Linux - General 4 08-29-2009 10:04 AM
Transition to libata driver - SCSI system - GRUB changes kushalkoolwal Linux - Software 6 05-17-2008 01:54 PM
Grub Legacy or Grub2? RAVC Linux - Software 2 01-21-2006 09:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration