Καλημέρα!
Είπα να δοκιμάσω (μετά απο 5 χρόνια απουσίας απο linux ) σε ενα virtual machine να εγκαταστήσω gentoo με encrypted root partition .
Ακολουθώντας διάφορα tutorials έχω φτιάξει τα εξής:
partition scheme fdisk /dev/sda -l
partedΚώδικας:Device Start End Sectors Size Type /dev/sda1 2048 34815 32768 16M BIOS boot /dev/sda2 34816 649215 614400 300M EFI System /dev/sda3 649216 3106815 2457600 1.2G Linux swap /dev/sda4 3108864 16775167 13666304 6.5G Linux LVM
Κώδικας:Model: ATA VBOX HARDDISK (scsi) Disk /dev/sda: 8590MB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 17.8MB 16.8MB bios_grub bios_grub 2 17.8MB 332MB 315MB ext2 boot boot, esp 3 332MB 1591MB 1258MB linux-swap(v1) 4 1592MB 8589MB 6997MB gentoolvm lvm
blkid
Κώδικας:/dev/loop0: TYPE="squashfs" /dev/sda2: LABEL="boot" UUID="63241296-665a-40c8-b6ae-af53bb6742ab" TYPE="ext2" PARTLABEL="boot" PARTUUID="2c51cea9-1abe-4784-9f47-8a4ee9b24f71" /dev/sda3: UUID="d47cb4cd-8d4c-4bc0-8a48-2bf0038e35ce" TYPE="swap" PARTUUID="ea5d81d2-3cfb-40cd-b1f7-b659f6bfc8de" /dev/sda4: UUID="d7ce53b9-e94c-46d8-b5c2-d4a3f752ed8c" TYPE="crypto_LUKS" PARTLABEL="gentoolvm" PARTUUID="79923732-9a0b-47d0-9b53-305afe8eb60d" /dev/sr0: UUID="2020-02-10-08-47-28-10" LABEL="Gentoo amd64 20200209T214502Z" TYPE="iso9660" PTUUID="485200fe" PTTYPE="dos" /dev/mapper/crypto_LUKS: UUID="fTaMB0-nhr8-loEM-SXMZ-8vFR-SKVV-NElT0B" TYPE="LVM2_member" /dev/mapper/gentoo-root: UUID="aefd47dc-50f9-42c6-a934-1f9672193d1d" TYPE="ext4" /dev/sda1: PARTLABEL="bios_grub" PARTUUID="4ba8fd44-700e-4234-b149-a4441d851c4e"
lsblk
fstabΚώδικας:NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0 7:0 0 314.3M 1 loop sda 8:0 0 8G 0 disk ├─sda1 8:1 0 16M 0 part ├─sda2 8:2 0 300M 0 part ├─sda3 8:3 0 1.2G 0 part └─sda4 8:4 0 6.5G 0 part └─crypto_LUKS 252:0 0 6.5G 0 crypt └─gentoo-root 252:1 0 6.5G 0 lvm / sr0 11:0 1 348M 0 rom sr1 11:1 1 1024M 0 rom
Κώδικας:UUID=63241296-665a-40c8-b6ae-af53bb6742ab /boot ext2 noatime 1 2 UUID=d47cb4cd-8d4c-4bc0-8a48-2bf0038e35ce none swap sw 0 0 UUID=aefd47dc-50f9-42c6-a934-1f9672193d1d / ext4 defaults 0 1
/etc/default/grub.cfg
Κώδικας:# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # # To populate all changes in this file you need to regenerate your # grub configuration file afterwards: # 'grub-mkconfig -o /boot/grub/grub.cfg' # # See the grub info page for documentation on possible variables and # their associated values. GRUB_DISTRIBUTOR="Gentoo" # Default menu entry #GRUB_DEFAULT=0 # Boot the default entry this many seconds after the menu is displayed GRUB_TIMEOUT=5 #GRUB_TIMEOUT_STYLE=menu GRUB_PRELOAD_MODULES=lvm GRUB_ENABLE_CRYPTODISK=y GRUB_DEVICE=/dev/ram0 GRUB_CMDLINE_LINK="crypt_root=/dev/sda4 real_root=/dev/mapper/gentoo-root rootfstype=ext4 dolvm quiet" # Append parameters to the linux kernel command line #GRUB_CMDLINE_LINUX="" # # Examples: # # Boot with network interface renaming disabled # GRUB_CMDLINE_LINUX="net.ifnames=0" # # Boot with systemd instead of sysvinit (openrc) # GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd" # Append parameters to the linux kernel command line for non-recovery entries #GRUB_CMDLINE_LINUX_DEFAULT="" # Uncomment to disable graphical terminal (grub-pc only) #GRUB_TERMINAL=console # The resolution used on graphical terminal. # Note that you can use only modes which your graphic card supports via VBE. # You can see them in real GRUB with the command `vbeinfo'. #GRUB_GFXMODE=640x480 # Set to 'text' to force the Linux kernel to boot in normal text # mode, 'keep' to preserve the graphics mode set using # 'GRUB_GFXMODE', 'WIDTHxHEIGHT'['xDEPTH'] to set a particular # graphics mode, or a sequence of these separated by commas or # semicolons to try several modes in sequence. #GRUB_GFXPAYLOAD_LINUX= # Path to theme spec txt file. # The starfield is by default provided with use truetype. # NOTE: when enabling custom theme, ensure you have required font/etc. #GRUB_THEME="/boot/grub/themes/starfield/theme.txt" # Background image used on graphical terminal. # Can be in various bitmap formats. #GRUB_BACKGROUND="/boot/grub/mybackground.png" # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel #GRUB_DISABLE_LINUX_UUID=true # Uncomment to disable generation of recovery mode menu entries #GRUB_DISABLE_RECOVERY=true # Uncomment to disable generation of the submenu and put all choices on # the top-level menu. # Besides the visual affect of no sub menu, this makes navigation of the # menu easier for a user who can't see the screen. #GRUB_DISABLE_SUBMENU=y # Uncomment to play a tone when the main menu is displayed. # This is useful, for example, to allow users who can't see the screen # to know when they can make a choice on the menu. #GRUB_INIT_TUNE="60 800 1"
/boot/grubgrub.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 ### 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 } if [ x$feature_default_font_path = xy ] ; then font=unicode else insmod lvm insmod ext2 set root='lvmid/owYkc3-N8V4-RaCo-gcoo-CbV6-KFu9-3diV10/erWg3P-z9dH-RD4Z-AMtv-peIV-uAl5-rNNsLQ' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint='lvmid/owYkc3-N8V4-RaCo-gcoo-CbV6-KFu9-3diV10/erWg3P-z9dH-RD4Z-AMtv-peIV-uAl5-rNNsLQ' aefd47dc-50f9-42c6-a934-1f9672193d1d else search --no-floppy --fs-uuid --set=root aefd47dc-50f9-42c6-a934-1f9672193d1d fi font="/usr/share/grub/unicode.pf2" fi if loadfont $font ; then set gfxmode=auto load_video insmod gfxterm set locale_dir=$prefix/locale set lang=en_US insmod gettext fi terminal_output gfxterm if [ x$feature_timeout_style = xy ] ; then set timeout_style=menu set timeout=5 # Fallback normal timeout code in case the timeout_style feature is # unavailable. else set timeout=5 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-/dev/ram0' { load_video if [ "x$grub_platform" = xefi ]; then set gfxpayload=keep fi insmod gzio insmod lvm insmod ext2 set root='lvmid/owYkc3-N8V4-RaCo-gcoo-CbV6-KFu9-3diV10/erWg3P-z9dH-RD4Z-AMtv-peIV-uAl5-rNNsLQ' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint='lvmid/owYkc3-N8V4-RaCo-gcoo-CbV6-KFu9-3diV10/erWg3P-z9dH-RD4Z-AMtv-peIV-uAl5-rNNsLQ' aefd47dc-50f9-42c6-a934-1f9672193d1d else search --no-floppy --fs-uuid --set=root aefd47dc-50f9-42c6-a934-1f9672193d1d fi echo 'Loading Linux 4.19.97-gentoo ...' linux /boot/vmlinuz-4.19.97-gentoo root=UUID=aefd47dc-50f9-42c6-a934-1f9672193d1d ro echo 'Loading initial ramdisk ...' initrd /boot/initramfs-4.19.97-gentoo.img } submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-/dev/ram0' { menuentry 'Gentoo GNU/Linux, with Linux 4.19.97-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.97-gentoo-advanced-/dev/ram0' { load_video if [ "x$grub_platform" = xefi ]; then set gfxpayload=keep fi insmod gzio insmod lvm insmod ext2 set root='lvmid/owYkc3-N8V4-RaCo-gcoo-CbV6-KFu9-3diV10/erWg3P-z9dH-RD4Z-AMtv-peIV-uAl5-rNNsLQ' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint='lvmid/owYkc3-N8V4-RaCo-gcoo-CbV6-KFu9-3diV10/erWg3P-z9dH-RD4Z-AMtv-peIV-uAl5-rNNsLQ' aefd47dc-50f9-42c6-a934-1f9672193d1d else search --no-floppy --fs-uuid --set=root aefd47dc-50f9-42c6-a934-1f9672193d1d fi echo 'Loading Linux 4.19.97-gentoo ...' linux /boot/vmlinuz-4.19.97-gentoo root=UUID=aefd47dc-50f9-42c6-a934-1f9672193d1d ro echo 'Loading initial ramdisk ...' initrd /boot/initramfs-4.19.97-gentoo.img } menuentry 'Gentoo GNU/Linux, with Linux 4.19.97-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.19.97-gentoo-recovery-/dev/ram0' { load_video if [ "x$grub_platform" = xefi ]; then set gfxpayload=keep fi insmod gzio insmod lvm insmod ext2 set root='lvmid/owYkc3-N8V4-RaCo-gcoo-CbV6-KFu9-3diV10/erWg3P-z9dH-RD4Z-AMtv-peIV-uAl5-rNNsLQ' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint='lvmid/owYkc3-N8V4-RaCo-gcoo-CbV6-KFu9-3diV10/erWg3P-z9dH-RD4Z-AMtv-peIV-uAl5-rNNsLQ' aefd47dc-50f9-42c6-a934-1f9672193d1d else search --no-floppy --fs-uuid --set=root aefd47dc-50f9-42c6-a934-1f9672193d1d fi echo 'Loading Linux 4.19.97-gentoo ...' linux /boot/vmlinuz-4.19.97-gentoo root=UUID=aefd47dc-50f9-42c6-a934-1f9672193d1d ro single echo 'Loading initial ramdisk ...' initrd /boot/initramfs-4.19.97-gentoo.img } } ### 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 ###
grub-install
initramfs generationΚώδικας:grub-install --modules="linux crypto search_fs_uuid luks lvm" /dev/sda
Επισης βγάζει κάποια warnings οτι δεν υπάρχει το lvmetadΚώδικας:genkernel --lvm --mdadm --luks --install initramfs
Τώρα όταν κάνω boot με πετάει απευθείας σε grub shell. Τι μπορεί να φταίει ;
Ευχαριστώ!
Εμφάνιση 1-1 από 1
-
02-03-20, 12:05 LUKS root Grub Falls to shell #1
Τελευταία επεξεργασία από το μέλος annubis : 02-03-20 στις 13:08.
Bookmarks