Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
upgrade to grub2, genkernel, root fs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
mpcww
Tux's lil' helper
Tux's lil' helper


Joined: 08 Apr 2003
Posts: 115

PostPosted: Tue Aug 06, 2013 3:01 pm    Post subject: upgrade to grub2, genkernel, root fs Reply with quote

I just tried to upgrade from grub-legacy to grub2 following http://wiki.gentoo.org/wiki/GRUB2_Quick_Start .
When I boot with grub2 I get a
Code:

Cannot open root device "sdc6" or unknown_block (0,0) error -6


I use genkernel since a long time.
I haven't switched to systemd yet.
grub-legacy boots with this kernel without problems.


My grub-97 -configuration is
Code:

default 0
timeout 10

title  Gentoo
root  (hd0,4)
kernel /kernel root=/dev/ram0 real_root=LABEL=G_ROOT  udev video=1920x1200-32
initrd=/boot/initramfs

title  Gentoo  systemd
root  (hd0,4)
kernel /kernel root=/dev/ram0 real_root=LABEL=G_ROOT real_init=/usr/lib/systemd/systemd udev video=1920x1200-32
initrd=/boot/initramfs

title GRUB2 Chainload
root (hd0,4))
kernel /boot/grub2/i386-pc/core.img
boot


title  Gentoo-old
root  (hd0,4)
kernel /kernel.old root=/dev/ram0 real_root=/dev/sdc6  udev
initrd=/boot/initramfs.old


title    SystemRescueCd von Festplatte
root     (hd0,8)
kernel   /sysrcd/rescuecd subdir=sysrcd setkmap=de
initrd   /sysrcd/initram.igz
boot


I suppose grub2 needs more modules compiled into the kernel directly.
But I wonder why grub-97 does its job.

When I compile modules like ata_piix, pata_acpi and some more (see modules list below) which can be compiled into the kernel not as modules,
the order of the disks changed. That is why I already started to label the disk in the fstab to be prepared for that.

But I am not sure if this is the correct approach to solve the grub2 problem.

Code:


[...]
00:1f.2 IDE interface: Intel Corporation 5 Series/3400 Series Chipset 4 port SATA IDE Controller (rev 06) (prog-if 8f [Master SecP SecO PriP PriO])
   Subsystem: Giga-byte Technology Device b002
   Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 19
[...]   Capabilities: [70] Power Management version 3
   Capabilities: [b0] PCI Advanced Features
   Kernel driver in use: ata_piix
   Kernel modules: ata_piix, pata_acpi

00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller (rev 06)
   Subsystem: Giga-byte Technology Device 5001
   Flags: medium devsel, IRQ 18
   Memory at fbffc000 (64-bit, non-prefetchable) [size=256]
   I/O ports at 0500 [size=32]
   Kernel driver in use: i801_smbus
   Kernel modules: i2c_i801

00:1f.5 IDE interface: Intel Corporation 5 Series/3400 Series Chipset 2 port SATA IDE Controller (rev 06) (prog-if 85 [Master SecO PriO])
   Subsystem: Giga-byte Technology Device b002
   Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 19
[...]
   Capabilities: [70] Power Management version 3
   Capabilities: [b0] PCI Advanced Features
   Kernel driver in use: ata_piix
   Kernel modules: ata_piix, pata_acpi

[...]
03:06.0 IDE interface: Integrated Technology Express, Inc. IT8213 IDE Controller (prog-if 85 [Master SecO PriO])
   Subsystem: Giga-byte Technology GA-EG45M-DS2H Mainboard
   Flags: bus master, medium devsel, latency 64, IRQ 17
[...]   Capabilities: [80] Power Management version 2
   Kernel driver in use: pata_it8213
   Kernel modules: pata_it8213, pata_acpi

[...]


Modules loaded after boot are:

Code:

Module                  Size  Used by
joydev                  8532  0
ip6table_filter         1260  0
ip6_tables             14336  1 ip6table_filter
iptable_filter          1304  0
ip_tables              13906  1 iptable_filter
x_tables               14287  4 ip6table_filter,ip_tables,iptable_filter,ip6_tables
it87                   22814  0
hwmon_vid               2004  1 it87
ipv6                  223857  40
uvcvideo               59353  0
snd_usb_audio          96745  1
videobuf2_vmalloc       2480  1 uvcvideo
videobuf2_memops        1527  1 videobuf2_vmalloc
snd_usbmidi_lib        15589  1 snd_usb_audio
videobuf2_core         21378  1 uvcvideo
snd_rawmidi            15555  1 snd_usbmidi_lib
videodev               84733  2 uvcvideo,videobuf2_core
snd_seq_device          4508  1 snd_rawmidi
tun                    15741  0
vboxdrv              1759567  0
coretemp                5454  0
kvm_intel             112083  0
kvm                   214091  1 kvm_intel
microcode               7268  0
pcspkr                  1779  0
snd_hda_codec_hdmi     24040  1
snd_hda_codec_realtek    50830  1
i2c_i801                8317  0
r8169                  46960  0
mii                     3411  1 r8169
snd_hda_intel          23577  3
snd_hda_codec          66169  3 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel
acpi_cpufreq            6302  0
snd_hwdep               5261  2 snd_usb_audio,snd_hda_codec
mperf                   1083  1 acpi_cpufreq
snd_pcm                59586  4 snd_usb_audio,snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel
freq_table              2162  1 acpi_cpufreq
snd_page_alloc          6282  2 snd_pcm,snd_hda_intel
snd_timer              15309  1 snd_pcm
snd                    49538  19 snd_hda_codec_realtek,snd_usb_audio,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_rawmidi,snd_usbmidi_lib,snd_hda_codec,snd_hda_intel,snd_seq_device
processor              25967  1 acpi_cpufreq
xts                     2791  0
gf128mul                5274  1 xts
aes_x86_64              7387  0
cbc                     2456  0
sha256_generic          9565  0
libiscsi               29532  0
scsi_transport_iscsi    33403  1 libiscsi
tg3                   122971  0
libphy                 17096  1 tg3
ptp                     6924  1 tg3
pps_core                5880  1 ptp
e1000                  87331  0
fuse                   56965  0
nfs                   100645  0
lockd                  52437  1 nfs
sunrpc                144977  2 nfs,lockd
btrfs                 576063  0
libcrc32c                946  1 btrfs
zlib_deflate           17643  1 btrfs
multipath               5296  0
linear                  3183  0
raid10                 33982  0
raid456                47220  0
async_pq                2900  1 raid456
async_xor               2145  2 async_pq,raid456
xor                     7292  1 async_xor
async_memcpy            1166  1 raid456
async_raid6_recov       1241  1 raid456
raid6_pq               89350  2 async_pq,async_raid6_recov
async_tx                1702  5 async_pq,raid456,async_xor,async_memcpy,async_raid6_recov
raid1                  23804  0
raid0                   6507  0
dm_snapshot            23402  0
dm_crypt               12769  0
dm_mirror              11163  0
dm_region_hash          6215  1 dm_mirror
dm_log                  7418  2 dm_region_hash,dm_mirror
dm_mod                 59437  4 dm_log,dm_mirror,dm_crypt,dm_snapshot
hid_sunplus             1393  0
hid_sony                2544  0
hid_samsung             2758  0
hid_pl                  1297  0
hid_petalynx            1874  0
hid_monterey            1489  0
hid_microsoft           2707  0
hid_logitech            6813  0
hid_gyration            2012  0
hid_ezkey               1322  0
hid_cypress             1810  0
hid_chicony             2105  0
hid_cherry              1457  0
hid_belkin              1590  0
hid_apple               4978  0
hid_a4tech              1868  0
sl811_hcd               8951  0
usbhid                 22770  0
ohci_hcd               19524  0
uhci_hcd               18785  0
usb_storage            42849  0
ehci_pci                3352  0
ehci_hcd               31584  1 ehci_pci
usbcore               128218  12 uhci_hcd,snd_usb_audio,uvcvideo,usb_storage,hid_sony,ohci_hcd,snd_usbmidi_lib,ehci_hcd,ehci_pci,usbhid,sl811_hcd
usb_common               850  1 usbcore
aic94xx                63945  0
libsas                 55025  1 aic94xx
qla2xxx               388408  0
megaraid_sas           65865  0
megaraid_mbox          23851  0
megaraid_mm             7000  1 megaraid_mbox
megaraid               36334  0
aacraid                68698  0
sx8                    10949  0
DAC960                 62494  0
cciss                  44661  0
3w_9xxx                29234  0
3w_xxxx                20859  0
mptsas                 33217  0
scsi_transport_sas     21651  3 libsas,mptsas,aic94xx
mptfc                  10412  0
scsi_transport_fc      39429  2 qla2xxx,mptfc
scsi_tgt                8184  1 scsi_transport_fc
mptspi                 11341  0
mptscsih               16553  3 mptfc,mptsas,mptspi
mptbase                55028  4 mptfc,mptsas,mptspi,mptscsih
atp870u                22664  0
dc395x                 26913  0
qla1280                19535  0
imm                     8754  0
parport                26475  1 imm
dmx3191d                8961  0
sym53c8xx              62275  0
gdth                   73213  0
advansys               49099  0
initio                 14956  0
BusLogic               19412  0
arcmsr                 23761  0
aic7xxx               104789  0
aic79xx               108906  0
scsi_transport_spi     17480  5 mptspi,sym53c8xx,aic79xx,aic7xxx,dmx3191d
sr_mod                 10935  0
cdrom                  28405  1 sr_mod
sg                     21944  0
sd_mod                 25928  18
pdc_adma                5261  0
sata_inic162x           6325  0
sata_mv                22951  0
ata_piix               22119  12
ahci                   21256  0
libahci                17458  1 ahci
sata_qstor              5012  0
sata_vsc                3929  0
sata_uli                2948  0
sata_sis                3597  0
sata_sx4                7919  0
sata_nv                18130  0
sata_via                7555  0
sata_svw                4237  0
sata_sil24             10087  0
sata_sil                7167  0
sata_promise            9687  0
pata_sl82c105           3597  0
pata_cs5530             4216  0
pata_cs5520             3582  0
pata_via                8284  0
pata_jmicron            2323  0
pata_marvell            2835  0
pata_sis               10182  1 sata_sis
pata_netcell            2153  0
pata_sc1200             2962  0
pata_pdc202xx_old       4366  0
pata_triflex            3127  0
pata_atiixp             4419  0
pata_opti               2729  0
pata_amd               10079  0
pata_ali                8965  0
pata_it8213             3370  2
pata_pcmcia             9685  0
pcmcia                 29211  1 pata_pcmcia
firmware_class          9212  8 tg3,qla1280,qla2xxx,r8169,libsas,pcmcia,aic94xx,advansys,microcode
pcmcia_core            10509  1 pcmcia
pata_ns87415            3220  0
pata_ns87410            2712  0
pata_serverworks        5068  0
pata_platform           3051  0
pata_artop              4822  0
pata_it821x             8285  0
pata_optidma            4401  0
pata_hpt3x2n            5404  0
pata_hpt3x3             2960  0
pata_hpt37x            10864  0
pata_hpt366             5008  0
pata_cmd64x             6722  0
pata_efar               3502  0
pata_rz1000             2685  0
pata_sil680             4529  0
pata_radisys            2898  0
pata_pdc2027x           6211  0
pata_mpiix              2822  0


Last edited by mpcww on Tue Aug 06, 2013 5:49 pm; edited 1 time in total
Back to top
View user's profile Send private message
mpcww
Tux's lil' helper
Tux's lil' helper


Joined: 08 Apr 2003
Posts: 115

PostPosted: Tue Aug 06, 2013 5:46 pm    Post subject: Reply with quote

Just to exlude a problem with my kernel configuration I temporarily installed a kernel based on the live-cd-config slightly changed due to my Intel-i915-graphic.
I compiled and installed that one using genkernel-3.4.45.1 .

I tried three variations of booting from my menu.lst :

  • Traditional boot with openrc ("Gentoo") => didn't find root labled G_ROOT
  • Gentoo systemd boot => didn't find root labled G_ROOT
    This is a special case see here
  • finally I jumped to grub2 just to make sure it didn't work either


Most of the partitions are separated (fstab):
Code:

LABEL=G_BOOT      /boot      ext4      discard,noauto,noatime   1 2
LABEL=G_ROOT      /      ext4      discard,noatime,errors=remount-ro      0 1
LABEL=G_SWAP      none      swap      sw      0 0
LABEL=G_USR      /usr      ext4      discard,noatime,errors=remount-ro      0 1
LABEL=G_VM      /vm      ext4      noatime      0 1
LABEL=G_VAR      /var      ext4      noatime      0 1
LABEL=G_CCACHE      /ccache      ext4      noatime      0 1
LABEL=G_OPT      /opt      ext4      discard,noatime,errors=remount-ro      0 1
LABEL=G_DISTFILES   /var/portage/distfiles      ext4      noatime      0 1
LABEL=G_MUCKE      /mucke       ext4      noatime,grpid,acl      0 1
LABEL=SRCD      /systemrescuecd   auto      discard,noatime,errors=remount-ro   0 1
LABEL=G_VIDEO      /video      ext4      noatime      0 1
LABEL=G_HOME      /home      ext4      noatime      0 1
LABEL=G_FOTOS      /Fotos      ext4      noatime,grpid,acl   0 1
Back to top
View user's profile Send private message
mpcww
Tux's lil' helper
Tux's lil' helper


Joined: 08 Apr 2003
Posts: 115

PostPosted: Wed Aug 07, 2013 3:10 pm    Post subject: Reply with quote

Meanwhile I compiled

ATA AHCI Support
Intel EXP, ICH, PIIX3, PIIX4 PATA and SATA Support
IT8213 PATA Support
ACPI firmware driver for PATA

into the kernel. So there shouldn't be an issue with missing modules any more.

With Labels in fstab and the root / real_root kernel parameter as well
these both boot alternatives

- Traditional boot with openrc ("Gentoo")
- Gentoo systemd boot

find the root device and boot.

How do I get grub2 to work with that solution ?

Hopefully there is an easier way to get grub2-mkconfig consider Labels instead of UUIDs as it is described here
http://ubuntuforums.org/showthread.php?t=1530532&page=2

Any ideas ?

By now I get a grub.cfg generated which refers on UUIDs:

Code:

if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos7 --hint-efi=hd1,msdos7 --hint-baremetal=ahci1,msdos7  bcdf019d-7e11-4abd-a960-df4f1afe8214
else
  search --no-floppy --fs-uuid --set=root bcdf019d-7e11-4abd-a960-df4f1afe8214
fi
    font="/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=de_DE
  insmod gettext
fi
terminal_output gfxterm
if sleep --interruptible 0 ; then
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-74cc509b-7c80-4c77-a2c5-a46aad7816f8' {
   load_video
   insmod gzio
   insmod part_msdos
   insmod ext2
   set root='hd1,msdos5'
   if [ x$feature_platform_search_hint = xy ]; then
     search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5  7c6dd010-a374-45c4-a375-43113eca2a38
   else
     search --no-floppy --fs-uuid --set=root 7c6dd010-a374-45c4-a375-43113eca2a38
   fi
   echo   'Linux gernkern1-x86_64-3.8.13-gentoo wird geladen …'
   linux   /kernel-gernkern1-x86_64-3.8.13-gentoo root=/dev/sdb6 ro 
}
Back to top
View user's profile Send private message
Randy Andy
Veteran
Veteran


Joined: 19 Jun 2007
Posts: 1148
Location: /dev/koelsch

PostPosted: Wed Aug 07, 2013 4:45 pm    Post subject: Reply with quote

Hi mpcww.

All the trouble, the automatism and the presettings GRUB2 came with, is why I don't like or use it.
To get it under your control, you have to study it, to get the automatism off.
Maybee it's ok for binary Distros, where everything should work OOTB, but as a Gentoo User I would do things manually with the most of control and comfort.

And after changing something manually, you have to update it, as in the good old times as we did it with LILO - ha, very comfortable.

But I know sometimes there are good reasons to use it.

Hopefully these day will never come for me, cause I'm not willing to by any UEFI System including "Restricted Boot".
Also I'm not using LVM - some day I will try Btrfs instead.

But that's a different story and only my personal preference.

*************************************************


Nevertheless 'Ive done some research in the past and guess I had the solution for your problem, without doing any crap, your refer points to in the Ubuntu Forum.

1.) Make sure your 40_custom or a 41_custom file is executable (chmod +x)
2.) Edit it in a way like this with the kernel naming entries to your needs:
Code:


#!/bin/sh
exec tail -n +3 $0
menuentry "My Gentoo" {
   search --label --no-floppy --set=root G_ROOT
   linux /boot/vmlinuz-2.6.32-5-686 root=/dev/disk-by-label/G_ROOT
   initrd /boot/initrd.img-2.6.32-5-686
}

I guess G_ROOT in the example above, is the name of your Label of the device you've named in a way like
Code:
tune2fs -L G_ROOT /dev/sdxn

or
Code:
e2label /dev/sdxn G_ROOT



3.) Update your grub in a way like this

Code:
update-grub

or
Code:
grub-mkconfig -o /boot/grub/grub.cfg


I hope this works for you, If not, please don't rant on me. I never done it by myself, no practice with GRUB2 as I said.

Much success

Andy.
_________________
If you want to see a Distro done right, compile it yourself!
Back to top
View user's profile Send private message
mpcww
Tux's lil' helper
Tux's lil' helper


Joined: 08 Apr 2003
Posts: 115

PostPosted: Wed Aug 07, 2013 9:05 pm    Post subject: Reply with quote

Hi Andy,

first of all special thanks for your introduction !
To be honest I share(d) your preference for the legacy grub.

Since a few days I fumbeld around with the upgrade to gnome 3.8 and it's depency (gdm's dependency) on systemd.
I stumbled across disk order, missing root fs etc.
In that discussion somenbody mentioned grub2 with no special technical relationship to the systemd problems I had.
But I noticed there were no more advices againgst grub2 to find in the gentoo documentation and - I confess with little caution:
I decided to change that as well .
To test it I use a chainload from grub-97 to grub2, that makes the fallback easier.

The change in 40-custom file worked as you described. I just needed to consider grub.cfg to be located at /boot/grub2/grub.cfg.
I think I have to read more of the documentation, because it complains about not finding disk G_ROOT now.

So no ranting, just saying thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing 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