LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-19-2010, 05:14 PM   #1
nze
LQ Newbie
 
Registered: Mar 2010
Posts: 6

Rep: Reputation: 6
Question Grub2 chainloader


Hi,
I have a dedicated grub2 partition from where I can chainload into my arch linux grub2 with
Code:
menuentry "Arch Linux" {
        insmod ext2
        set root='(hd0,6)'
        search --no-floppy --fs-uuid --set d2c1d2c1-6b8e-4e9d-827b-1239bc470395
        chainloader +1
}
now i'd also like to go back to the grub partition, so I added this to the arch grub2:
Code:
menuentry 'OS Selector' {
        insmod ext2
        set root='(hd0,3)'   #this is sda3
        chainloader +1
}
but just get 'invalid signature' errors.

what am i doing wrong?



Okay, after another 87 reboots I got it figured out now.
Apparently grub 1.98 still uses 'chainloader' for stuff like Windows, while grub itself works more like starting a linux kernel, using the 'multiboot' keyword instead of 'linux' though, and then pointing to the right file (grub-kernel-image: core.img). The result looks like this:
Code:
menuentry 'OS Selector' {
        search --fs-uuid --set f5d9c7fc-23eb-4473-abb6-5f11fc6c3c1b
        multiboot /boot/grub/core.img
}
the 'search...' line can be replaced with a conventional 'root (hdX,Y)', but I like it better this way, as moving around partitions won't affect it. Maybe it's even valid to use both; grub2 documentation is rather sparse though..
One thing I still don't get straight, is why 'chainloader +1' still works in the first instance of grub (which might be v1.96 , maybe that's why..).

Last edited by nze; 09-19-2010 at 05:46 PM. Reason: solved
 
Old 09-21-2010, 03:43 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Thanks for posting your solution.
 
Old 09-22-2010, 06:27 AM   #3
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
You might also want to correct some typos(?):

You use """ and ''' after menuentry. Which one is correct or do both work?

set root='(hd0,3)' #this is sda3 <--- it is not. hd0,3 stands for /dev/sda4

HTH.
 
Old 09-23-2010, 04:17 AM   #4
nze
LQ Newbie
 
Registered: Mar 2010
Posts: 6

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by JZL240I-U View Post
You might also want to correct some typos(?):

You use """ and ''' after menuentry. Which one is correct or do both work?

set root='(hd0,3)' #this is sda3 <--- it is not. hd0,3 stands for /dev/sda4

HTH.
as far as i can tell both ' and " work, as grub2 does some variable expansion, i'd guess it works bash-like regarding variables. i don't think there's a big difference.

with grub2, partition numbering changed, now starting with 1 instead of 0 (as in grub legacy). device numbering still starts at 0 though. so sda3 is now referred to as (hd0,3), thus the comment

Quote:
Originally Posted by MensaWater View Post
Thanks for posting your solution.
welcome
 
1 members found this post helpful.
Old 09-24-2010, 12:58 AM   #5
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Quote:
Originally Posted by nze View Post
...with grub2, partition numbering changed...
Uargh. Those are changes of a type I hate . Thanks for pointing this out.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Booting - chainloader +1 - Error 13 new2lx *BSD 2 02-27-2008 02:49 AM
Dual Booting and Chainloader ErevRav Linux - Newbie 7 10-07-2006 06:34 PM
chainloader = (hd 0,0)+1 littleshark112 Linux - Newbie 17 09-07-2006 10:21 PM
Grub Chainloader Question gangrel1985 Linux - Newbie 4 06-21-2006 04:42 PM
Chainloader Error tonycampos Linux - Hardware 6 02-23-2006 02:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:49 PM.

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