View previous topic :: View next topic |
Author |
Message |
thorres n00b
Joined: 16 Jan 2014 Posts: 3
|
Posted: Mon Jan 20, 2014 8:15 pm Post subject: [gelöst] Grub2 startet nicht korrekt. GPT, LVM und Crypto. |
|
|
Hallo,
ich fürchte ich brauche eure Hilfe.
Ich habe die Platte mit einer GPT-Partitionstabelle versehen und darauf zwei Partitionen erstellt.
Die erste für /boot, die zweite ist verschlüsselt und darauf liegt ein LVM für die restlichen Partitionen.
Das Problem ist jetzt, dass der Rechner beim booten nur "GRUB loading" meldet und danach sofort neustartet.
Nach dem Durchsuchen diverser Seiten bin ich mittlerweile mit meinem Latein am Ende.
Folgende Schritte habe ich durchgeführt, um Grub zu installieren:
wurde mit parted durchgeführt.
Grub habe ich mit dem Befehl Code: | USE=device-mapper emerge grub | übersetzt.
In der /etc/default/grub wurden die Optionen GRUB_PRELOAD_MODULES=lvm und GRUB_CRYPTDISK_ENABLE=y eingefügt.
Zum Bauen des Kernels:
Code: | genkernel --no clean --menuconfig --save-config --luks --lvm all |
und ich habe auch darauf geachtet, dass folgende Module enthalten sind:
http://www.funtoo.org/Rootfs_over_encrypted_lvm#Kernel_options
(Diverse andere Webseiten schlagen auch noch andere Module vor)
Das Initramfs wurde mit Code: | genkernel --lvm --luks --install initramfs |
erstellt und installiert.
Installieren von Grub2:
Code: | grub2-install --modules="part_gpt ext2" /dev/sda |
Erstellen der Config:
Code: | grub2-mkconfig -o //boot/grub/grub.cfg |
Ich bin mir sicher, dass die so noch nicht komplett ist, um das System zu booten.
Das sollte aber m.E. keinen Einfluss darauf haben, ob Grub selber startet.
Die Software auf dem Rechner sollte aktuell sein.
Meine aktuelle make.conf sieht folgendermaßen aus:
Code: |
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-O2 -pipe -march=k8"
#CFLAGS="-O2 -pipe"
CXXFLAGS="${CFLAGS}"
FFLAGS="${CFLAGS}"
FCFLAGS="${CFLAGS}"
MAKEOPTS="-j2"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="x86_64-pc-linux-gnu"
# These are the USE flags that were used in addition to what is provided by the
# profile used for building.
USE="bindist mmx sse sse2 3dnowext 3dnow dri opengl gtk -gnome -kde -qt4 -qt5 dvd a52 css alsa cdr branding bzip2 crypt gnutls ssl flac mp3 ogg vorbis musepack mp4 theora x264 mplayer vcd ipv6 jabber scanner spell startup-notification symlink systemd unicode usb vim-syntax -bluetooth"
#USE="bindist mmx sse sse2 unicode"
PORTDIR=/usr/portage
DISTDIR="${PORTDIR}/distfiles"
PKGDIR="${PORTDIR}/packages"
GENTOO_MIRRORS="http://de-mirror.org/gentoo http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
PORTAGE_RSYNC_RETRIES="-1"
AUTOCLEAN="yes"
PORTAGE_TMPDIR="/var/tmp"
DISTCC_DIR="${PORTAGE_TMPDIR}/.distcc"
PORTAGE_ELOG_CLASSES="log warn error"
PORTAGE_ELOG_SYSTEM="save"
|
und das hier ist die grub.cfg:
Code: |
#
# DO NOT EDIT THIS FILE
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
insmod lvm
if [ -s $prefix/grubenv ]; then
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
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 {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
terminal_input console
terminal_output console
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-ea9f2e86-83b0-41b1-8759-0090452c5548' {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 d6de96f8-c18b-4ae0-a4f2-1c37ccda53f5
else
search --no-floppy --fs-uuid --set=root d6de96f8-c18b-4ae0-a4f2-1c37ccda53f5
fi
echo 'Loading Linux x86_64-3.10.25-gentoo ...'
linux /kernel-genkernel-x86_64-3.10.25-gentoo root=/dev/mapper/thor-root ro
echo 'Loading initial ramdisk ...'
initrd /initramfs-genkernel-x86_64-3.10.25-gentoo
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-ea9f2e86-83b0-41b1-8759-0090452c5548' {
menuentry 'Gentoo GNU/Linux, with Linux x86_64-3.10.25-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-3.10.25-gentoo-advanced-ea9f2e86-83b0-41b1-8759-0090452c5548' {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 d6de96f8-c18b-4ae0-a4f2-1c37ccda53f5
else
search --no-floppy --fs-uuid --set=root d6de96f8-c18b-4ae0-a4f2-1c37ccda53f5
fi
echo 'Loading Linux x86_64-3.10.25-gentoo ...'
linux /kernel-genkernel-x86_64-3.10.25-gentoo root=/dev/mapper/thor-root ro
echo 'Loading initial ramdisk ...'
initrd /initramfs-genkernel-x86_64-3.10.25-gentoo
}
menuentry 'Gentoo GNU/Linux, with Linux x86_64-3.10.25-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-3.10.25-gentoo-recovery-ea9f2e86-83b0-41b1-8759-0090452c5548' {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 d6de96f8-c18b-4ae0-a4f2-1c37ccda53f5
else
search --no-floppy --fs-uuid --set=root d6de96f8-c18b-4ae0-a4f2-1c37ccda53f5
fi
echo 'Loading Linux x86_64-3.10.25-gentoo ...'
linux /kernel-genkernel-x86_64-3.10.25-gentoo root=/dev/mapper/thor-root ro single
echo 'Loading initial ramdisk ...'
initrd /initramfs-genkernel-x86_64-3.10.25-gentoo
}
}
### 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 ###
### 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 ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
|
Ich hoffe, mir kann hier jemand den entscheidenden Tipp geben. Ich freue mich über Antworten.
Last edited by thorres on Tue Jan 21, 2014 5:39 pm; edited 1 time in total |
|
Back to top |
|
|
frostschutz Advocate
Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Mon Jan 20, 2014 9:43 pm Post subject: Re: Grub2 startet nicht korrekt. GPT, LVM und Crypto. |
|
|
thorres wrote: | wurde mit parted durchgeführt. |
bios_grub und /boot sind zwei verschiedene Partitionen.
bios_grub muss dabei kein MB gross sein, wenn du also /boot von 1M-256M oder so hast, kannst du bios_grub in sektor 34-2047 reinquetschen. Alignment spielt für diese Partition keine Rolle.
Wenn Grub sich in die bios_grub Partition eingenistet hat, aber da ein Dateisystem drauf war, kann das Dateisystem auch beschädigt worden sein. fsck -f bzw. halt nochmal formatieren, Grub neu installieren, ... |
|
Back to top |
|
|
thorres n00b
Joined: 16 Jan 2014 Posts: 3
|
Posted: Tue Jan 21, 2014 5:38 pm Post subject: |
|
|
Das war es.
Nachdem ich dann noch die /etc/default/grub angepasst habe und die Grub-Config neu generiert habe habe ich jetzte einen Login-Prompt vor mir.
Die Firma dankt recht herzlich! |
|
Back to top |
|
|
|
|
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
|
|