Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Questions about grub2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Sat Aug 13, 2011 9:38 am    Post subject: Questions about grub2 Reply with quote

Hello!
I just installed grub2 and have some questions...
The informations in the Wiki seem to be outdated, for example there is no /etc/defaults/grub entry on my system.
a) Where is this file located now? Or where do I get it from?
b) Is it possible to restore the /dev/sdX behavior instead of uuid? Or boot by label?
c) When installing a newer kernel, I always use "make install" to automatically generate a /boot/vmlinuz. So I never had to fiddle with grub, because the boot entry pointed always to this static filename. Grub2 searches for the long version of this, e.g. vmlinuz-3.0.1-gentoo and points to them exclusively. Can this be changed?
d) last but not least, how do I boot from an iso-image?
_________________
"Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction"
Back to top
View user's profile Send private message
g0del
n00b
n00b


Joined: 27 Jul 2011
Posts: 36

PostPosted: Sat Aug 13, 2011 12:30 pm    Post subject: Reply with quote

for b) On my grub2 setup I also use /dev/sdX behavior.I edit my grub.cfg manually even though it is suggested not to, however I don't have grub scanning for new operating systems and I never run update-grub. If you edit grub.cfg either by hand or with update-grub you can use the /dev/sdX.

my grub.cfg
Code:
menuentry "gentoo (on /dev/sda6)" {
        insmod part_gpt
        insmod ext2
        set root='(hd0,gpt6)'
        linux /boot/gkernel root=/dev/sda6 ro
}
As far as c) goes in my case, I make my kernels and copy the kernel bzimage to boot with another name, much like you do with vmlinuz. If however I do add another OS or just add another kernel I add an extra menuentry to grub.cfg like so
Code:
menuentry "funtoo (on /dev/sda4)" {
        insmod part_gpt
        insmod ext2
        set root='(hd0,gpt4)'
        linux /boot/sfuntoo root=/dev/sda4 ro
}

again if you use update-grub instead of editing manually like I do, it will hose your grub.cfg.

EDIT: I hate ubuntu, really I do, everything it stands for, however they have one of the best reference guides for grub2 that I have found its at https://help.ubuntu.com/community/Grub2
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Sun Aug 14, 2011 7:51 pm    Post subject: Reply with quote

Thanks for the answer.
I carefully read through the *buntu article and it is rather informative.
What disturbs me, is that I don't have a /etc/default/grub at all.
I assembled my own one after that wiki, but either it is completely wrong, or it gets completely ignored :(
Can someone be so kind and send me his default or edited one for reference?
Also I dislike the idea that make install won't work automagically anymore, so if there are any more ideas...?
Regards,
Marcus
_________________
"Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction"
Back to top
View user's profile Send private message
myceliv
Apprentice
Apprentice


Joined: 29 Nov 2007
Posts: 178

PostPosted: Mon Aug 15, 2011 4:45 am    Post subject: Reply with quote

The best documentation I've found is on the GNU site for the keys you can use in /etc/default/grub (not /etc/defaults.)

For me, copying bzimage to /boot/vmlinuz-whatever-I-want is an advantage, since I prefer shorter more descriptive names than vmlinuz-2.6.38-gentoo-r73-foo_baz even if those are the names used in /lib/modules. You needn't copy config and system map for regular simple kernels built ala Pappy method... so make install really doesn't add much if any extra value. (I get config settings from the kernel build directory or from /proc/config.gz for the running kernel.)

Then I use grub-mkconfig to automatically pick up all my kernels in boot even if I've renamed them from when I first copied them there. Much nicer than keeping track of them all by hand. Never tried using /dev/sdX or learning how, but if I change hardware I use grub-mkdevicemap to deal with that. I've never paid any attention to the UUID's at all, even though that's what grub cares about. I do use labels in /etc/fstab, though.

The only thing that's never worked correctly for me is grub-mkconfig automatically picking up a windows install on one machine. For this I entered it manually once in /etc/grub.d/40_custom and have never messed with it since.
Back to top
View user's profile Send private message
Elepole
n00b
n00b


Joined: 31 Aug 2011
Posts: 1

PostPosted: Wed Aug 31, 2011 2:08 am    Post subject: Reply with quote

TO make make install work automagically use /etc/grub.d/40_custom:

Code:

#!/bin/sh
exec tail -n +3 $0

menuentry "Gentoo" {
set root=(hd0,1)
linux /boot/vmlinuz root=/dev/sda1
}


Then grub will always point to vmlinuz. (You may want to disable 10_linux if you don't have another linux entry)

For /etc/default/grub, i was forced to edit mine also, here it is if you want to see it:

Code:

GRUB_DEFAULT=Gentoo
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
#GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR="Gentoo"
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""
GRUB_GFXMODE=1152x864,1024x768,640x480
GRUB_DISABLE_OS_PROBER=true

GRUB_BACKGROUND=/boot/grub/BlueCurls.png
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software 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