Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Grub selecting wrong root block device
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
Dylanus
n00b
n00b


Joined: 02 Jun 2018
Posts: 40

PostPosted: Wed Jul 25, 2018 1:42 am    Post subject: [SOLVED] Grub selecting wrong root block device Reply with quote

Hi all,
I am attempting to install Gentoo on my laptop with an encrypted hard drive. I have installed Gentoo on a VM without encryption before, but the encryption is making things challenging. I think I have everything working, but Grub is selecting the wrong root partition. When I first attempted installation a few days ago, I wrote the /etc/fstab file. Somehow after that the UUID of /dev/sda3 changed, but I didn't notice that. I installed Grub and rebooted, and it tried to mount the old UUID. I then changed /etc/fstab, ran grub-install again, and ran grub-mkconfig. I have tried grub-install --recheck /dev/sda, but this still makes no difference. I looked at grub.cfg and there are a lot of references to both UUIDs, so I'm really not sure what it's doing or why.
At the moment I have boot on /dev/sda3, so I decrypt the drive to boot. I want to make a seperate partition to fix that, so I don't have to decrypt twice, but that is for later. I decrypt the drive, select Gentoo in the boot menu and then the system starts booting. Then it says:
Code:
Could not find the root block device in UUID=d2f7...

It then provides a prompt, to enter a shell, provide a different device or skip. Then it tries the same device again. I have tried telling it to boot /dev/sda3, but that doesn't work.
How do I fix the issue with Grub? Is there a way to completely uninstall it and start again?
Let me know if you need to see any configuration files.
Thanks


Last edited by Dylanus on Sun Jul 29, 2018 5:05 am; edited 1 time in total
Back to top
View user's profile Send private message
axl
Guru
Guru


Joined: 11 Oct 2002
Posts: 536
Location: Romania

PostPosted: Wed Jul 25, 2018 1:55 am    Post subject: Re: Grub selecting wrong root block device Reply with quote

Dylanus wrote:
Hi all,
I am attempting to install Gentoo on my laptop with an encrypted hard drive. I have installed Gentoo on a VM without encryption before, but the encryption is making things challenging. I think I have everything working, but Grub is selecting the wrong root partition. When I first attempted installation a few days ago, I wrote the /etc/fstab file. Somehow after that the UUID of /dev/sda3 changed, but I didn't notice that. I installed Grub and rebooted, and it tried to mount the old UUID. I then changed /etc/fstab, ran grub-install again, and ran grub-mkconfig. I have tried grub-install --recheck /dev/sda, but this still makes no difference. I looked at grub.cfg and there are a lot of references to both UUIDs, so I'm really not sure what it's doing or why.
At the moment I have boot on /dev/sda3, so I decrypt the drive to boot. I want to make a seperate partition to fix that, so I don't have to decrypt twice, but that is for later. I decrypt the drive, select Gentoo in the boot menu and then the system starts booting. Then it says:
Code:
Could not find the root block device in UUID=d2f7...

It then provides a prompt, to enter a shell, provide a different device or skip. Then it tries the same device again. I have tried telling it to boot /dev/sda3, but that doesn't work.
How do I fix the issue with Grub? Is there a way to completely uninstall it and start again?
Let me know if you need to see any configuration files.
Thanks


gonna just guess...

in /etc/default/grub you should have a line like:

Code:
GRUB_ENABLE_CRYPTODISK=1
Back to top
View user's profile Send private message
Dylanus
n00b
n00b


Joined: 02 Jun 2018
Posts: 40

PostPosted: Wed Jul 25, 2018 1:58 am    Post subject: Reply with quote

I do have that line. I enabled it yesterday after some other issues. grub.cfg does mention cryptouuid now, so I don't think that is the issue.
Back to top
View user's profile Send private message
axl
Guru
Guru


Joined: 11 Oct 2002
Posts: 536
Location: Romania

PostPosted: Wed Jul 25, 2018 2:01 am    Post subject: Reply with quote

ok. please post /etc/fstab, /etc/default/grub, output from blkid and any other custom thingie about your system.
Back to top
View user's profile Send private message
Dylanus
n00b
n00b


Joined: 02 Jun 2018
Posts: 40

PostPosted: Wed Jul 25, 2018 3:26 am    Post subject: Reply with quote

Alright, so here are the files:

/etc/fstab
Code:
# swap
# Not relevant, as I have not encrypted swap yet
# UUID=a575142e-313d-48b3-9023-0f9c396df34b none  swap sw                                       0 0
#/dev/mapper/cryptswap           none   swap defaults                  0 0

# vm
# This is /dev/sdb1, a second storage disk
UUID="e8c1c7fb-0b53-41e8-b568-a9f08c7c6cda" /hdd  ext4 rw,relatime,data=ordered                 0 2
# root
# root and home are /dev/sda3 and /dev/sda4, SSD
UUID="922abf3d-1ae7-43fc-a62c-bc31ff3e5e93" /     ext4 rw,relatime,data=ordered,noatime,discard 0 2
# home
UUID="a756d9e6-f36f-44f8-94bf-884b753a9c17" /home ext4 rw,relatime,data=ordered,noatime,discard 0 2


blkid output
Code:
/dev/loop0: TYPE="squashfs"
/dev/sda1: PARTLABEL="grub" PARTUUID="9164b303-8c69-4bb5-85be-4b098bd26960"
/dev/sda2: UUID="a575142e-313d-48b3-9023-0f9c396df34b" TYPE="swap" PARTLABEL="swap" PARTUUID="5ac2a45c-628f-471e-b729-7b89c3ccacd5"
/dev/sda3: UUID="922abf3d-1ae7-43fc-a62c-bc31ff3e5e93" TYPE="crypto_LUKS" PARTLABEL="rootfs" PARTUUID="d930668f-2752-4769-864a-e2676ceb5503"
/dev/sda4: UUID="a756d9e6-f36f-44f8-94bf-884b753a9c17" TYPE="crypto_LUKS" PARTLABEL="homefs" PARTUUID="5d865f07-c0a1-460a-8c8d-eb76ebc256cd"
/dev/sdb1: UUID="e8c1c7fb-0b53-41e8-b568-a9f08c7c6cda" TYPE="crypto_LUKS" PARTLABEL="vmfs" PARTUUID="f19e3231-3b82-418c-83fd-2536d2a3df0b"
/dev/sdc1: UUID="2018-04-16-01-43-43-23" LABEL="Gentoo amd64 20180415T214502Z" TYPE="iso9660" PTUUID="04252123" PTTYPE="dos" PARTUUID="04252123-01"
/dev/mapper/cryptroot: UUID="d2f7feca-9721-4340-9750-3c02ce335538" TYPE="ext4"


/etc/default/grub
Code:
# Copyright 1999-2015 Gentoo Foundation
# 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:
#     'grub2-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

# 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"
GRUB_ENABLE_CRYPTODISK=y


/etc/conf.d/dmcrypt
Code:
# /root
# Pretty sure this is not necessary. Should I delete the root entry?
target=cryptroot
source=UUID="922abf3d-1ae7-43fc-a62c-bc31ff3e5e93"
# /home
target=crypthome
source=UUID="a756d9e6-f36f-44f8-94bf-884b753a9c17"
# /hdd
target=cryptvm
source=UUID="e8c1c7fb-0b53-41e8-b568-a9f08c7c6cda"

# The file must be terminated by a newline.  Or leave this comment last.



I can also post /boot/grub/grub.cfg. Would that help?
Back to top
View user's profile Send private message
axl
Guru
Guru


Joined: 11 Oct 2002
Posts: 536
Location: Romania

PostPosted: Wed Jul 25, 2018 3:32 am    Post subject: Reply with quote

Dylanus wrote:
I can also post /boot/grub/grub.cfg. Would that help?


Well the next thing I was going to ask is how was initrd built. You can't have any of this conf without a initrd. Would grub.conf show .... that you use or not an initrd. You should. And how was it made?
Back to top
View user's profile Send private message
Dylanus
n00b
n00b


Joined: 02 Jun 2018
Posts: 40

PostPosted: Wed Jul 25, 2018 3:50 am    Post subject: Reply with quote

You're talking about initramfs? I followed the handbook instructions to generate one with genkernel.

/boot/grub/grub.cfg
Code:
#
# 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
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 part_gpt
insmod cryptodisk
insmod luks
insmod gcry_rijndael
insmod gcry_rijndael
insmod gcry_sha256
insmod ext2
cryptomount -u 922abf3d1ae743fca62cbc31ff3e5e93
set root='cryptouuid/922abf3d1ae743fca62cbc31ff3e5e93'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint='cryptouuid/922abf3d1ae743fca62cbc31ff3e5e93'  d2f7feca-9721-4340-9750-3c02ce335538
else
  search --no-floppy --fs-uuid --set=root d2f7feca-9721-4340-9750-3c02ce335538
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-d2f7feca-9721-4340-9750-3c02ce335538' {
   load_video
   if [ "x$grub_platform" = xefi ]; then
      set gfxpayload=keep
   fi
   insmod gzio
   insmod part_gpt
   insmod cryptodisk
   insmod luks
   insmod gcry_rijndael
   insmod gcry_rijndael
   insmod gcry_sha256
   insmod ext2
   cryptomount -u 922abf3d1ae743fca62cbc31ff3e5e93
   set root='cryptouuid/922abf3d1ae743fca62cbc31ff3e5e93'
   if [ x$feature_platform_search_hint = xy ]; then
     search --no-floppy --fs-uuid --set=root --hint='cryptouuid/922abf3d1ae743fca62cbc31ff3e5e93'  d2f7feca-9721-4340-9750-3c02ce335538
   else
     search --no-floppy --fs-uuid --set=root d2f7feca-9721-4340-9750-3c02ce335538
   fi
   echo   'Loading Linux 4.14.52-gentoo ...'
   linux   /boot/vmlinuz-4.14.52-gentoo root=UUID=d2f7feca-9721-4340-9750-3c02ce335538 ro 
   echo   'Loading initial ramdisk ...'
   initrd   /boot/initramfs-genkernel-x86_64-4.14.52-gentoo
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-d2f7feca-9721-4340-9750-3c02ce335538' {
   menuentry 'Gentoo GNU/Linux, with Linux 4.14.52-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.14.52-gentoo-advanced-d2f7feca-9721-4340-9750-3c02ce335538' {
      load_video
      if [ "x$grub_platform" = xefi ]; then
         set gfxpayload=keep
      fi
      insmod gzio
      insmod part_gpt
      insmod cryptodisk
      insmod luks
      insmod gcry_rijndael
      insmod gcry_rijndael
      insmod gcry_sha256
      insmod ext2
      cryptomount -u 922abf3d1ae743fca62cbc31ff3e5e93
      set root='cryptouuid/922abf3d1ae743fca62cbc31ff3e5e93'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint='cryptouuid/922abf3d1ae743fca62cbc31ff3e5e93'  d2f7feca-9721-4340-9750-3c02ce335538
      else
        search --no-floppy --fs-uuid --set=root d2f7feca-9721-4340-9750-3c02ce335538
      fi
      echo   'Loading Linux 4.14.52-gentoo ...'
      linux   /boot/vmlinuz-4.14.52-gentoo root=UUID=d2f7feca-9721-4340-9750-3c02ce335538 ro 
      echo   'Loading initial ramdisk ...'
      initrd   /boot/initramfs-genkernel-x86_64-4.14.52-gentoo
   }
   menuentry 'Gentoo GNU/Linux, with Linux 4.14.52-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.14.52-gentoo-recovery-d2f7feca-9721-4340-9750-3c02ce335538' {
      load_video
      if [ "x$grub_platform" = xefi ]; then
         set gfxpayload=keep
      fi
      insmod gzio
      insmod part_gpt
      insmod cryptodisk
      insmod luks
      insmod gcry_rijndael
      insmod gcry_rijndael
      insmod gcry_sha256
      insmod ext2
      cryptomount -u 922abf3d1ae743fca62cbc31ff3e5e93
      set root='cryptouuid/922abf3d1ae743fca62cbc31ff3e5e93'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint='cryptouuid/922abf3d1ae743fca62cbc31ff3e5e93'  d2f7feca-9721-4340-9750-3c02ce335538
      else
        search --no-floppy --fs-uuid --set=root d2f7feca-9721-4340-9750-3c02ce335538
      fi
      echo   'Loading Linux 4.14.52-gentoo ...'
      linux   /boot/vmlinuz-4.14.52-gentoo root=UUID=d2f7feca-9721-4340-9750-3c02ce335538 ro single
      echo   'Loading initial ramdisk ...'
      initrd   /boot/initramfs-genkernel-x86_64-4.14.52-gentoo
   }
   menuentry 'Gentoo GNU/Linux, with Linux 4.14.52-gentoo.old' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.14.52-gentoo.old-advanced-d2f7feca-9721-4340-9750-3c02ce335538' {
      load_video
      if [ "x$grub_platform" = xefi ]; then
         set gfxpayload=keep
      fi
      insmod gzio
      insmod part_gpt
      insmod cryptodisk
      insmod luks
      insmod gcry_rijndael
      insmod gcry_rijndael
      insmod gcry_sha256
      insmod ext2
      cryptomount -u 922abf3d1ae743fca62cbc31ff3e5e93
      set root='cryptouuid/922abf3d1ae743fca62cbc31ff3e5e93'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint='cryptouuid/922abf3d1ae743fca62cbc31ff3e5e93'  d2f7feca-9721-4340-9750-3c02ce335538
      else
        search --no-floppy --fs-uuid --set=root d2f7feca-9721-4340-9750-3c02ce335538
      fi
      echo   'Loading Linux 4.14.52-gentoo.old ...'
      linux   /boot/vmlinuz-4.14.52-gentoo.old root=UUID=d2f7feca-9721-4340-9750-3c02ce335538 ro 
      echo   'Loading initial ramdisk ...'
      initrd   /boot/initramfs-genkernel-x86_64-4.14.52-gentoo
   }
   menuentry 'Gentoo GNU/Linux, with Linux 4.14.52-gentoo.old (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.14.52-gentoo.old-recovery-d2f7feca-9721-4340-9750-3c02ce335538' {
      load_video
      if [ "x$grub_platform" = xefi ]; then
         set gfxpayload=keep
      fi
      insmod gzio
      insmod part_gpt
      insmod cryptodisk
      insmod luks
      insmod gcry_rijndael
      insmod gcry_rijndael
      insmod gcry_sha256
      insmod ext2
      cryptomount -u 922abf3d1ae743fca62cbc31ff3e5e93
      set root='cryptouuid/922abf3d1ae743fca62cbc31ff3e5e93'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint='cryptouuid/922abf3d1ae743fca62cbc31ff3e5e93'  d2f7feca-9721-4340-9750-3c02ce335538
      else
        search --no-floppy --fs-uuid --set=root d2f7feca-9721-4340-9750-3c02ce335538
      fi
      echo   'Loading Linux 4.14.52-gentoo.old ...'
      linux   /boot/vmlinuz-4.14.52-gentoo.old root=UUID=d2f7feca-9721-4340-9750-3c02ce335538 ro single
      echo   'Loading initial ramdisk ...'
      initrd   /boot/initramfs-genkernel-x86_64-4.14.52-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 ###
Back to top
View user's profile Send private message
Dylanus
n00b
n00b


Joined: 02 Jun 2018
Posts: 40

PostPosted: Thu Jul 26, 2018 1:17 am    Post subject: Reply with quote

Unfortunately I need my laptop for a presentation tomorrow, so I will have to install a different OS temporarily. I am going to reattempt Gentoo next week. I think installing everything from scratch might resolve the issue. I will report on the results when I have finished.
Thanks for your help.
Back to top
View user's profile Send private message
axl
Guru
Guru


Joined: 11 Oct 2002
Posts: 536
Location: Romania

PostPosted: Thu Jul 26, 2018 2:21 am    Post subject: Reply with quote

Dylanus wrote:
Unfortunately I need my laptop for a presentation tomorrow, so I will have to install a different OS temporarily. I am going to reattempt Gentoo next week. I think installing everything from scratch might resolve the issue. I will report on the results when I have finished.
Thanks for your help.


sorry I took to long to respond. Ok. I got it. U made your initrd with genkernel. that's fine.

in genkernel.conf (what were we talking about? .... sec)

right. in /etc/genkernel.conf you should have at least:

LUKS="yes"

something ... back of my reptilian mind tells me might need also other options in that file. but one thing is certain. you need to build your initrd with luks support on. which i guess you didn't.
Back to top
View user's profile Send private message
Dylanus
n00b
n00b


Joined: 02 Jun 2018
Posts: 40

PostPosted: Thu Jul 26, 2018 6:26 am    Post subject: Reply with quote

That makes sense. I'll look into that next week.
Thanks
Back to top
View user's profile Send private message
Dylanus
n00b
n00b


Joined: 02 Jun 2018
Posts: 40

PostPosted: Sat Jul 28, 2018 8:47 am    Post subject: Reply with quote

Alright, so I have just reinstalled Gentoo, and I am getting the same error, but with a few variations, and my config files are a bit different.

The error now reads:
Code:
Determining root device:
Block device /dev/mapper/cryptroot is not a valid root device
Could not find the root device in .
...


Not sure why it says /dev/mapper/cryptroot. The only reason I can think of is that the UUID in /etc/fstab is the decrypted one.

/etc/fstab
Code:
# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed); notail increases performance of ReiserFS (at the expense of storage
# efficiency).  It's safe to drop the noatime options if you want and to
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#

# <fs>         <mountpoint>   <type>      <opts>      <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
#
# NOTE: Even though we list ext4 as the type here, it will work with ext2/ext3
#       filesystems.  This just tells the kernel to use the ext4 driver.
#
# NOTE: You can use full paths to devices like /dev/sda3, but it is often
#       more reliable to use filesystem labels or UUIDs. See your filesystem
#       documentation for details on setting a label. To obtain the UUID, use
#       the blkid(8) command.

#LABEL=boot      /boot      ext4      noauto,noatime   1 2
#UUID=58e72203-57d1-4497-81ad-97655bd56494      /      ext4      noatime      0 1
#LABEL=swap      none      swap      sw      0 0
#/dev/cdrom      /mnt/cdrom   auto      noauto,ro   0 0

# boot - /dev/sda2
UUID="2e3a3128-5a85-4664-adae-c7bce4b82c6d" /boot   ext4   defaults               0 2
# swap - /dev/sda3
UUID="a2f0810d-8cfd-46c0-8a12-ed2c7d468d5f" none   swap   sw                  0 0
# /dev/mapper/cryptroot - /dev/sda4
UUID="fb82637f-18a4-492a-a43f-4306c68ed7b4" /      ext4   rw,relatime,noatime,discard,data=ordered   0 1
# /dev/mapper/crypthome - /dev/sda5
UUID="7df047d3-5a2c-4447-81ff-5981edc2aaf3" /home   ext4   rw,relatime,noatime,discard,data=ordered   0 2
# /dev/mapper/cryptvm (/dev/sdb - second hard drive)
UUID="b20613e8-c5e4-4e62-ac3e-e65cfcb37a50" /hdd   ext4   rw,relatime,noatime,data=ordered      0 2


/etc/conf.d/dmcrypt without the examples
Code:
# home
target=crypthome
source=UUID="6741a1c1-cebe-4fd6-a266-319cc725a5c9"
# vm
target=cryptvm
source=UUID="481855d6-2fe0-46bb-bd70-838aec676410"

# The file must be terminated by a newline.  Or leave this comment last.


I added a cryptroot entry to this, but it made no difference

output of blkid:
Code:
/dev/loop0: TYPE="squashfs"
/dev/sda1: PARTLABEL="grub" PARTUUID="baf8fda5-9298-44cd-b544-10c15706ef66"
/dev/sda2: UUID="2e3a3128-5a85-4664-adae-c7bce4b82c6d" TYPE="ext4" PARTLABEL="boot" PARTUUID="6a68edf6-bb6b-45e3-b21c-a213434689ca"
/dev/sda3: UUID="a2f0810d-8cfd-46c0-8a12-ed2c7d468d5f" TYPE="swap" PARTLABEL="swap" PARTUUID="584c01cf-c80e-4421-acac-c271e37560ff"
/dev/sda4: UUID="11a4b881-a7bd-4b22-8356-95562b23f406" TYPE="crypto_LUKS" PARTLABEL="rootfs" PARTUUID="6049318a-2162-44c2-a4e1-8d5a16a5c3a8"
/dev/sda5: UUID="6741a1c1-cebe-4fd6-a266-319cc725a5c9" TYPE="crypto_LUKS" PARTLABEL="homefs" PARTUUID="b2553391-95c6-4597-9506-01701545d0dc"
/dev/sdb: UUID="481855d6-2fe0-46bb-bd70-838aec676410" TYPE="crypto_LUKS"
/dev/sdc1: UUID="2018-04-16-01-43-43-23" LABEL="Gentoo amd64 20180415T214502Z" TYPE="iso9660" PTUUID="04252123" PTTYPE="dos" PARTUUID="04252123-01"
/dev/mapper/cryptroot: UUID="fb82637f-18a4-492a-a43f-4306c68ed7b4" TYPE="ext4"


/etc/default/grub
Code:
# Copyright 1999-2015 Gentoo Foundation
# 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:
#     'grub2-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

# 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"
GRUB_ENABLE_CRYPTODISK=1


/boot/grub/grub.cfg
Code:
#
# 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
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 loadfont unicode ; 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/mapper/cryptroot' {
   load_video
   if [ "x$grub_platform" = xefi ]; then
      set gfxpayload=keep
   fi
   insmod gzio
   insmod part_gpt
   insmod ext2
   set root='hd0,gpt2'
   if [ x$feature_platform_search_hint = xy ]; then
     search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  2e3a3128-5a85-4664-adae-c7bce4b82c6d
   else
     search --no-floppy --fs-uuid --set=root 2e3a3128-5a85-4664-adae-c7bce4b82c6d
   fi
   echo   'Loading Linux 4.14.52-gentoo ...'
   linux   /vmlinuz-4.14.52-gentoo root=/dev/mapper/cryptroot ro 
   echo   'Loading initial ramdisk ...'
   initrd   /initramfs-genkernel-x86_64-4.14.52-gentoo
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-/dev/mapper/cryptroot' {
   menuentry 'Gentoo GNU/Linux, with Linux 4.14.52-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.14.52-gentoo-advanced-/dev/mapper/cryptroot' {
      load_video
      if [ "x$grub_platform" = xefi ]; then
         set gfxpayload=keep
      fi
      insmod gzio
      insmod part_gpt
      insmod ext2
      set root='hd0,gpt2'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  2e3a3128-5a85-4664-adae-c7bce4b82c6d
      else
        search --no-floppy --fs-uuid --set=root 2e3a3128-5a85-4664-adae-c7bce4b82c6d
      fi
      echo   'Loading Linux 4.14.52-gentoo ...'
      linux   /vmlinuz-4.14.52-gentoo root=/dev/mapper/cryptroot ro 
      echo   'Loading initial ramdisk ...'
      initrd   /initramfs-genkernel-x86_64-4.14.52-gentoo
   }
   menuentry 'Gentoo GNU/Linux, with Linux 4.14.52-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.14.52-gentoo-recovery-/dev/mapper/cryptroot' {
      load_video
      if [ "x$grub_platform" = xefi ]; then
         set gfxpayload=keep
      fi
      insmod gzio
      insmod part_gpt
      insmod ext2
      set root='hd0,gpt2'
      if [ x$feature_platform_search_hint = xy ]; then
        search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  2e3a3128-5a85-4664-adae-c7bce4b82c6d
      else
        search --no-floppy --fs-uuid --set=root 2e3a3128-5a85-4664-adae-c7bce4b82c6d
      fi
      echo   'Loading Linux 4.14.52-gentoo ...'
      linux   /vmlinuz-4.14.52-gentoo root=/dev/mapper/cryptroot ro single
      echo   'Loading initial ramdisk ...'
      initrd   /initramfs-genkernel-x86_64-4.14.52-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 ###


I also added LUKS="yes" in /etc/genkernel.conf prior to creating initramfs. I ran rc-update add dmcrypt boot before generating grub config. I also followed the dmcrypt entry in the wiki to configure the kernel correctly. Is there something else I am missing? Are my configuration files correct? Thanks for your help so far. It seems like I'm really close. If you're able to point me in the right direction, that would be really appreciated.
Back to top
View user's profile Send private message
axl
Guru
Guru


Joined: 11 Oct 2002
Posts: 536
Location: Romania

PostPosted: Sat Jul 28, 2018 12:10 pm    Post subject: Reply with quote

Dylanus wrote:
Alright, so I have just reinstalled Gentoo, and I am getting the same error, but with a few variations, and my config files are a bit different.

The error now reads:
Code:
Determining root device:
Block device /dev/mapper/cryptroot is not a valid root device
Could not find the root device in .
...


Not sure why it says /dev/mapper/cryptroot. The only reason I can think of is that the UUID in /etc/fstab is the decrypted one.

/etc/fstab
Code:

UUID="fb82637f-18a4-492a-a43f-4306c68ed7b4" /      ext4   rw,relatime,noatime,discard,data=ordered   0 1


Code:

/dev/sda4: UUID="11a4b881-a7bd-4b22-8356-95562b23f406" TYPE="crypto_LUKS" PARTLABEL="rootfs" PARTUUID="6049318a-2162-44c2-a4e1-8d5a16a5c3a8"
/dev/mapper/cryptroot: UUID="fb82637f-18a4-492a-a43f-4306c68ed7b4" TYPE="ext4"



I also added LUKS="yes" in /etc/genkernel.conf prior to creating initramfs. I ran rc-update add dmcrypt boot before generating grub config. I also followed the dmcrypt entry in the wiki to configure the kernel correctly. Is there something else I am missing? Are my configuration files correct? Thanks for your help so far. It seems like I'm really close. If you're able to point me in the right direction, that would be really appreciated.


Let's keep it simple. Way too many partitions. Let's just focus on rootfs for now. We'll do the rest after rootfs. So for now, comment with "#" (in fstab) all lines that are not rootfs or the boot partition.

The reason it is trying to mount /dev/mapper/cryptroot is because that is your rootfs (decrypted). Your sda4 partition is not your root (encrypted - cannot be directly mounted). Once sda4 gets open with cryptsetup it becomes /dev/mapper/root. So what you need to do is point grub at sda4 and at cryptoroot. it's not really pointing grub to do anything, more like grub is pointing to the initramfs to do a bit of unlocking magic.

And in fstab you did it right. Ok next step. In genkernel you activated luks with LUKS="yes"; you need to also activate lvm. LVM="yes". No need to redo the kernel, just the initramfs again. genkernel initramfs. that's enough.

Next step /etc/default/grub. You enabled GRUB_ENABLE_CRYPTODISK=1. good. You also need to specify the crypto_root. Like so:

GRUB_CMDLINE_LINUX="rootwait crypt_root=/dev/sda4 dolvm"

And you should be set. Don't modify grub.conf manually. Grub will automatically generate root based of crypt_root.

After rootfs was resolved, work on the other partitions. although i don't know if dmcrypt is still a thing. maybe you should look into crypttab. Not sure about that one. But what I am sure is that the decrypting / mounting of rootfs is handled by initramfs. and it's different from the rest of the partitions. On systemd systems, dmcrypt has been replaced with systemd internals, and thus is different from OpenRC stuff. But again, we should first finish with the rootfs/initramfs/kernel.
Back to top
View user's profile Send private message
Dylanus
n00b
n00b


Joined: 02 Jun 2018
Posts: 40

PostPosted: Sat Jul 28, 2018 1:46 pm    Post subject: Reply with quote

Thanks for your reply. I just implemented all that, and unfortunately I got the same error back.
I commented out everything except for boot and root in /etc/fstab. I then added LVM="yes" in /etc/genkernel.conf and ran the command from the handbook, genkernel --install initramfs. Then I added the line you mentioned for /etc/default/grub. Is that line exact? Is it meant to be crypt_root? Or crypto_root, or cryptroot?
I then ran grub-mkconfig -o /boot/grub/grub.cfg. When I rebooted the error was the same. Did I miss a step?
Back to top
View user's profile Send private message
axl
Guru
Guru


Joined: 11 Oct 2002
Posts: 536
Location: Romania

PostPosted: Sat Jul 28, 2018 2:17 pm    Post subject: Reply with quote

Dylanus wrote:
Thanks for your reply. I just implemented all that, and unfortunately I got the same error back.
I commented out everything except for boot and root in /etc/fstab. I then added LVM="yes" in /etc/genkernel.conf and ran the command from the handbook, genkernel --install initramfs. Then I added the line you mentioned for /etc/default/grub. Is that line exact? Is it meant to be crypt_root? Or crypto_root, or cryptroot?
I then ran grub-mkconfig -o /boot/grub/grub.cfg. When I rebooted the error was the same. Did I miss a step?


According to the manual (https://wiki.gentoo.org/wiki/Full_Disk_Encryption_From_Scratch_Simplified):

GRUB_CMDLINE_LINUX="dolvm crypt_root=UUID=6a7a642a-3262-4f87-9540-bcd53969343b root=/dev/mapper/vg0-root"

So, let's substitute for your system:

GRUB_CMDLINE_LINUX="dolvm crypt_root=UUID=11a4b881-a7bd-4b22-8356-95562b23f406 root=/dev/mapper/cryptroot"

it's crypt_root to specify which real disk contains an encrypted partition. I checked the scripts inside the initrd. It has to be crypt_root. and then, could be /dev/sda4 or LABEL=rootfs or UUID=11a4b881-a7bd-4b22-8356-95562b23f406.

and as far as root is concerned it has to be root=/dev/mapper/something. something can be changed to somethingelse, but /dev/mapper/ is necessary because that's where decrypted things are in /dev.

Once again, try to understand. Your sda4 partition is not usable. Not directly. So it can't be in fstab AT ALL. Once you cryptsetup open it, it will be available in /dev/mapper/whatevername. So you choose a name, put it in /etc/default/grub, it will automatically go in grub.conf once you redo grub.conf and should also put the same name in fstab as /dev/mapper/whatevername / ext4 blabla.

Anyway, on your first message you said the error was cannot find root device with uuid something. Now message must have at least changed. And upper of the error message you should see at least a few lines about luks. Initrd spits some out. Should have at least asked you for password to unlock the device. Does it ask for password? Or are you using keys or ?

Is cryptsetup USE flag activated for genkernel? is cryptsetup built static?
Back to top
View user's profile Send private message
Dylanus
n00b
n00b


Joined: 02 Jun 2018
Posts: 40

PostPosted: Sat Jul 28, 2018 2:31 pm    Post subject: Reply with quote

Everything you just said makes a lot of sense. I didn't realise there was a manual page on this topic, which is why I followed the wiki entry on dm-crypt. I have done all of this on Arch before, so what you're telling me to check makes sense, I just didn't know how to tell the computer all of this. Arch of course writes fstab for you.
It's late now, so I can't try all of that tonight. I will check it all tomorrow.
I am expecting to be asked for a password. I don't have a key file. As for cryptsetup, I simply ran emerge --ask. I didn't specify any options, so I'm not sure if that means it's built static or not.
I also have not set any use options for genkernel. Is that done in genkernel.conf? Or make.conf?
If you could clarify that for me, I will try all this out tomorrow. It definitely sounds promising. Thanks for your help so far.
Back to top
View user's profile Send private message
axl
Guru
Guru


Joined: 11 Oct 2002
Posts: 536
Location: Romania

PostPosted: Sat Jul 28, 2018 2:34 pm    Post subject: Reply with quote

Dylanus wrote:
I also have not set any use options for genkernel. Is that done in genkernel.conf? Or make.conf?


both.

Code:
emerge -pv genkernel-next

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-kernel/genkernel-next-68::gentoo  USE="cryptsetup mdadm plymouth -dmraid -gpg -iscsi (-selinux)" 2,347 KiB


You need both useflag AND luks/lvm in genkernel.conf in order for all things to be included in the initramfs file. And I assume that once genkernel will be rebuilt with cryptsetup, cryptsetup will have to be build in static mode. U'll see, the ebuild is smart enough to know that if it's not built static it has to include way too many libs inside initramfs. So that's why it will ask you to put static in package.use.
Back to top
View user's profile Send private message
Dylanus
n00b
n00b


Joined: 02 Jun 2018
Posts: 40

PostPosted: Sat Jul 28, 2018 11:12 pm    Post subject: Reply with quote

Alright, so I followed the instructions you gave me, and this time the boot loader asked me for the password for /dev/sda4. That's the first time it's done that, so I see this as great progress! However it then still told me /dev/mapper/cryptroot was not a valid root block device. What's going on there? I have the UUID for /dev/mapper/cryptroot in fstab and the UUID for /dev/sda4 in /etc/default/grub.
The boot loader asked me for the password for /dev/sda4, then it said it was scanning and opening lvm devices, then determining root device, then it gave me the exact same message I have been receiving from the start. I did reinstall genkernel with cryptsetup use flag. I used genkernel instead of genkernel-next, as that is what I installed the first time, based on the handbook, and it complained when I tried to install genkernel-next at the same time. This doesn't seem like it should be the problem, but should I be uninstalling genkernel and replacing it with genkernel-next? I also reinstalled cryptsetup with -dynamic, as that is what the system asked for. It didn't recognise static, but I'm assuming that removing dynamic achieves the same goal. Emerge complained at the end about configuration files, before I reinstalled cryptsetup. I told it to use the existing genkernel.conf, with luks and lvm enabled.
Why is it still insisting that /dev/mapper/cryptroot is not valid?
Back to top
View user's profile Send private message
axl
Guru
Guru


Joined: 11 Oct 2002
Posts: 536
Location: Romania

PostPosted: Sat Jul 28, 2018 11:24 pm    Post subject: Reply with quote

Dylanus wrote:
Alright, so I followed the instructions you gave me, and this time the boot loader asked me for the password for /dev/sda4. That's the first time it's done that, so I see this as great progress! However it then still told me /dev/mapper/cryptroot was not a valid root block device. What's going on there? I have the UUID for /dev/mapper/cryptroot in fstab and the UUID for /dev/sda4 in /etc/default/grub.
The boot loader asked me for the password for /dev/sda4, then it said it was scanning and opening lvm devices, then determining root device, then it gave me the exact same message I have been receiving from the start. I did reinstall genkernel with cryptsetup use flag. I used genkernel instead of genkernel-next, as that is what I installed the first time, based on the handbook, and it complained when I tried to install genkernel-next at the same time. This doesn't seem like it should be the problem, but should I be uninstalling genkernel and replacing it with genkernel-next? I also reinstalled cryptsetup with -dynamic, as that is what the system asked for. It didn't recognise static, but I'm assuming that removing dynamic achieves the same goal. Emerge complained at the end about configuration files, before I reinstalled cryptsetup. I told it to use the existing genkernel.conf, with luks and lvm enabled.
Why is it still insisting that /dev/mapper/cryptroot is not valid?


I honestly do not remember why I have genkernel-next and not genkernel. Was a few years back. Never considered it too much. I just updated.

Wish I could say it's all due to genkernel/genkernel-next stuff, but I honestly don't know. Could be. Genkernel/next is the one doing the initramfs. I have no idea how it does it. I just xz decompress it, then cpio decompress it, and to be honest it says right there in the /init file inside the initramfs file that crypt_root is there just for old time sake. compatibility reasons. If it says that in genkernel-next, what the hell does it say inside the genkernel generated file? have no idea. possibly the same thing? I don't know.

But you were asked for a password. Let's talk about the progress. If i remember correctly, (and i do, maybe we get back to this genkernel issue) when you handle luks partitions in this case you get a choice. shell. what is your root partition. it's a colorized menu. right? do you just get an error and that it? or you get the option to interact with the system?

because you see... in genkernel-next initramfs images, you get to interact with your system. if you also get that in genkernel images, disregard my remark.

if you get to interact with system and you can get a shell, just ls /dev/mapper. see what's there. try to manually unlock the partition. cryptsetup open /dev/sda4 cryptroot. put in the password exit shell. see what that does.

Really I'm pretty sure the initramfs image lets you play a bit with it. if not, update genkernel to -next.
Back to top
View user's profile Send private message
Dylanus
n00b
n00b


Joined: 02 Jun 2018
Posts: 40

PostPosted: Sun Jul 29, 2018 5:05 am    Post subject: Reply with quote

I got it! It's working!
It was a really simple problem this time. In /etc/default/grub I pointed it to /dev/mapper/cryptroot, as you recommended, but I forgot that the system would not know what this label is. When I entered the shell and checked /dev/mapper, it had an entry for root. I'm guessing that that is because I labelled the partition root in parted when I made it. I can assign custom labels to crypthome and cryptvm in dmcrypt, but the system had no way of knowing what to label /dev/sda4 after decrypting. After I changed /etc/default/grub to expect /dev/mapper/root, everything worked perfectly.
I have now uncommented the other partitions in /etc/fstab and dmcrypt, and they now prompt for a password and mount at system startup as well. I have a bunch of other problems to sort out for configuration now, but the issue of this post is solved.
Thank you very much for your patient assistance.
Back to top
View user's profile Send private message
axl
Guru
Guru


Joined: 11 Oct 2002
Posts: 536
Location: Romania

PostPosted: Sun Jul 29, 2018 12:41 pm    Post subject: Reply with quote

Dylanus wrote:
I got it! It's working!
It was a really simple problem this time. In /etc/default/grub I pointed it to /dev/mapper/cryptroot, as you recommended, but I forgot that the system would not know what this label is. When I entered the shell and checked /dev/mapper, it had an entry for root. I'm guessing that that is because I labelled the partition root in parted when I made it. I can assign custom labels to crypthome and cryptvm in dmcrypt, but the system had no way of knowing what to label /dev/sda4 after decrypting. After I changed /etc/default/grub to expect /dev/mapper/root, everything worked perfectly.
I have now uncommented the other partitions in /etc/fstab and dmcrypt, and they now prompt for a password and mount at system startup as well. I have a bunch of other problems to sort out for configuration now, but the issue of this post is solved.
Thank you very much for your patient assistance.


My pleasure and congratulations :)
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