Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to chainloader
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
conoscenza
Tux's lil' helper
Tux's lil' helper


Joined: 25 Dec 2011
Posts: 105
Location: Spinazzola (bt) | Brescia | Parma

PostPosted: Sun Apr 08, 2012 8:39 pm    Post subject: how to chainloader Reply with quote

hi to all.
I don't understand how to chainloader in my pc.
there 3 SO: windows, a distro by slackware and gentoo.

This is my output:
Quote:

blkid
/dev/sda1: UUID="9AEC72D6EC72AC5F" TYPE="ntfs"
/dev/sda2: LABEL="HP_RECOVERY" UUID="04B262BDB262B33A" TYPE="ntfs"
/dev/sda4: UUID="ac14f7c7-0570-464f-b75d-4f5dd5a31602" TYPE="swap"
/dev/sda5: LABEL="boot" UUID="3f6da8d8-d003-4eb8-b429-cffeff309ba7" TYPE="ext2"
/dev/sda6: LABEL="Gentoo" UUID="99d78743-8b92-4db6-81cf-acb6239ceb71" TYPE="ext4"
/dev/sda7: LABEL="home" UUID="2f25d262-dffe-4a6a-b5bb-48340afadfb2" TYPE="ext4"
/dev/sda8: LABEL="boot Salice" UUID="14610283-7603-47e4-bc75-1d43830d1077" TYPE="ext2"
/dev/sda9: LABEL="Salice X" UUID="cf256b0c-9779-4386-b499-9dfd55400ed9" TYPE="ext4"


from distro by slackware:
Quote:

grub-mkconfig -o /boot/grub/grub.cfg
Generating grub.cfg ...
Found background: /boot/grub/salix.jpg
Found linux image: /boot/vmlinuz-huge-2.6.37.6
No volume groups found
Found Windows Vista (loader) on /dev/sda1
Found Windows Vista (loader) on /dev/sda2
Found Gentoo Base System release 2.0.3 on /dev/sda6
done


and it generated:
Quote:

cat /boot/grub/grub.cfg
#
# 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
load_env
fi
set default="${saved_entry}"
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 load_video {
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos9)'
search --no-floppy --fs-uuid --set=root cf256b0c-9779-4386-b499-9dfd55400ed9
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=auto
load_video
insmod gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set=root 14610283-7603-47e4-bc75-1d43830d1077
set locale_dir=($root)/grub/locale
set lang=it_IT
insmod gettext
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set=root 14610283-7603-47e4-bc75-1d43830d1077
insmod jpeg
background_image -m stretch /grub/salix.jpg
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Salix 13.37.0 GNU/Linux, con Linux 2.6.37.6' --class salix --class gnu-linux --class gnu --class os {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set=root 14610283-7603-47e4-bc75-1d43830d1077
echo 'Caricamento Linux 2.6.37.6...'
linux /vmlinuz-huge-2.6.37.6 root=/dev/sda9 ro vt.default_utf8=1 resume=/dev/sda4 quiet vga=791
}
menuentry 'Salix 13.37.0 GNU/Linux, con Linux 2.6.37.6 (modalità ripristino)' --class salix --class gnu-linux --class gnu --class os {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='(hd0,msdos8)'
search --no-floppy --fs-uuid --set=root 14610283-7603-47e4-bc75-1d43830d1077
echo 'Caricamento Linux 2.6.37.6...'
linux /vmlinuz-huge-2.6.37.6 root=/dev/sda9 ro single vt.default_utf8=1 resume=/dev/sda4
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows Vista (loader) (on /dev/sda1)" --class windows --class os {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 9AEC72D6EC72AC5F
chainloader +1
}
menuentry "Windows Vista (loader) (on /dev/sda2)" --class windows --class os {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set=root 04B262BDB262B33A
chainloader +1
}
menuentry "Gentoo Linux 3.2.12 (on /dev/sda6)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set=root 99d78743-8b92-4db6-81cf-acb6239ceb71
linux /boot/kernel-3.2.12-gentoo root=/dev/sda6
}
### 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 ###


and grub.conf in Gentoo is:
Quote:

cat /boot/grub/grub.conf
# This is a sample grub.conf for use with Genkernel, per the Gentoo handbook
# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2
# If you are not using Genkernel and you need help creating this file, you
# should consult the handbook. Alternatively, consult the grub.conf.sample that
# is included with the Grub documentation.

default 0
timeout 1
#splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title Gentoo Linux 3.2.12
root (hd0,5)
kernel /boot/kernel-3.2.12-gentoo root=/dev/sda6


and:
Quote:

ls -la /boot/
totale 4768
drwxr-xr-x 4 root root 4096 1 apr 22.55 .
drwxr-xr-x 20 root root 4096 23 feb 00.38 ..
-rw-r--r-- 1 root root 0 27 mar 21.39 .keep
lrwxrwxrwx 1 root root 1 26 mar 21.08 boot -> .
drwxr-xr-x 2 root root 4096 4 apr 00.55 grub
-rw-r--r-- 1 root root 4841392 1 apr 22.55 kernel-3.2.12-gentoo
drwx------ 2 root root 16384 21 feb 23.24 lost+found


Why when I choose to boot Gentoo from salix's grub, I have an error "file not found".
what is wrong?

thanks to all...

EDIT:
I run:
Quote:

#grep -v rootfs /proc/mounts > /etc/mtab
# grub-install --no-floppy /dev/sda5
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(fd0) /dev/fd0
(hd0) /dev/sda

to install grub on gentoo system.
Back to top
View user's profile Send private message
Arkhelion
Apprentice
Apprentice


Joined: 07 Sep 2010
Posts: 151
Location: France

PostPosted: Mon Apr 09, 2012 8:30 am    Post subject: Reply with quote

Why do you try to install 2 GRUB? One is enough.
_________________
Arkhelion
Back to top
View user's profile Send private message
conoscenza
Tux's lil' helper
Tux's lil' helper


Joined: 25 Dec 2011
Posts: 105
Location: Spinazzola (bt) | Brescia | Parma

PostPosted: Mon Apr 09, 2012 8:44 am    Post subject: Reply with quote

Because I've 2 Linux systems and each one have their kernels.

I try to edit the section:
Quote:

menuentry "Gentoo Linux 3.2.12 (on /dev/sda6)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set=root 99d78743-8b92-4db6-81cf-acb6239ceb71
linux /boot/kernel-3.2.12-gentoo root=/dev/sda6
}


in:
Quote:

menuentry "Gentoo Linux 3.2.12 (on /dev/sda6)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set=root 99d78743-8b92-4db6-81cf-acb6239ceb71
linux /boot/kernel-3.2.12-gentoo root=/dev/sda6
chainloader +1
}


but I've the same error... "File not found".

How should I edit its?
Back to top
View user's profile Send private message
Veldrin
Veteran
Veteran


Joined: 27 Jul 2004
Posts: 1945
Location: Zurich, Switzerland

PostPosted: Mon Apr 09, 2012 9:03 am    Post subject: Reply with quote

why not unify their boot partitions and grub installations into one?

your command wont work like this.
chainloader essentially tells the bootloader to load another bootloader located a somewhere.

in a nutshell, it should look like this. assuming that your chainloader target is in/on (hd0,1)
Code:
menuentry "Linux" {
   insmod chain
   insmod ext2
   set root=(hd0,1)
   chainloader +1
}

_________________
read the portage output!
If my answer is too concise, ask for an explanation.
Back to top
View user's profile Send private message
conoscenza
Tux's lil' helper
Tux's lil' helper


Joined: 25 Dec 2011
Posts: 105
Location: Spinazzola (bt) | Brescia | Parma

PostPosted: Mon Apr 09, 2012 9:07 am    Post subject: Reply with quote

Veldrin wrote:
why not unify their boot partitions and grub installations into one?


I installed this SO because I to do some test. I would indipendet system... maybe a day I'll create an unique partition.

Anyway I edit, in the first grub, the section:
Quote:

menuentry "Gentoo Linux 3.2.12 (on /dev/sda6)" --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos6)'
search --no-floppy --fs-uuid --set=root 99d78743-8b92-4db6-81cf-acb6239ceb71
linux /boot/kernel-3.2.12-gentoo root=/dev/sda6
}


in:
Quote:

menuentry 'Gentoo grub' {
set root='(hd0,5)'
chainloader +1
}


right?
Back to top
View user's profile Send private message
conoscenza
Tux's lil' helper
Tux's lil' helper


Joined: 25 Dec 2011
Posts: 105
Location: Spinazzola (bt) | Brescia | Parma

PostPosted: Mon Apr 09, 2012 10:57 am    Post subject: Reply with quote

But the boot partion of Gentoo is /dev/sda5 and the root partition /dev/sda6.

I believe that I don't understand this grub method!

EDIT: ...there's another messagge before!


Last edited by conoscenza on Mon Apr 09, 2012 11:02 am; edited 1 time in total
Back to top
View user's profile Send private message
conoscenza
Tux's lil' helper
Tux's lil' helper


Joined: 25 Dec 2011
Posts: 105
Location: Spinazzola (bt) | Brescia | Parma

PostPosted: Mon Apr 09, 2012 11:01 am    Post subject: Reply with quote

Veldrin wrote:

in a nutshell, it should look like this. assuming that your chainloader target is in/on (hd0,1)
Code:
menuentry "Linux" {
   insmod chain
   insmod ext2
   set root=(hd0,1)
   chainloader +1
}


insmod chain... is used by "chainloader +1"?
In my case I edit in:
Quote:

menuentry "Linux" {
insmod chain
insmod ext2
set root=(hd0,5)
chainloader +1
}


/dev/sda5 is Gentoo's boot
/dev/sda6 is Gentoo's root
Back to top
View user's profile Send private message
Veldrin
Veteran
Veteran


Joined: 27 Jul 2004
Posts: 1945
Location: Zurich, Switzerland

PostPosted: Mon Apr 09, 2012 11:03 am    Post subject: Reply with quote

it only cares about where grub is installed. honestly I never tried it on a partition, I always used the mbr.

V.
_________________
read the portage output!
If my answer is too concise, ask for an explanation.
Back to top
View user's profile Send private message
conoscenza
Tux's lil' helper
Tux's lil' helper


Joined: 25 Dec 2011
Posts: 105
Location: Spinazzola (bt) | Brescia | Parma

PostPosted: Mon Apr 09, 2012 11:10 am    Post subject: Reply with quote

I run:
grub-install --no-floppy /dev/sda5
to install grub into boot partition.

But I'm thinking need to specify the option "--boot-directory"...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum