Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Thinkpad p50 install, no LVM, LUKS, BIOS boot, nvme drive
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
quadcricket
n00b
n00b


Joined: 10 Apr 2017
Posts: 4
Location: Arizona

PostPosted: Mon Apr 10, 2017 7:48 pm    Post subject: Thinkpad p50 install, no LVM, LUKS, BIOS boot, nvme drive Reply with quote

So I will do my best to detail my progress so far.

I have three drives in my p50 a standard SATA SSD with Windows 7 on it, a storage nvme, and a Linux nvme.

I have partitioned the Linux nvme with an unencrypted 256MB /boot partition and the rest of the drive is a LUKS encrypted partition /dev/nvme0n1p2 set for /dev/mapper/root

I have been following the handbook for generic x86_64 install for my Skylake processor.

I have loaded the stage 3 tar ball and chrooted to it.

I have emerged packages and make menuconfig a kernel and tried my best to select the correct kernel choices such as RAID, and cryptography.

I created an initial ramdisk with genkernel.

I attempted both manually creating a grub.conf and generating one. Neither has worked. I tried at first force-installing grub onto the nvme0 drive and got nowhere. I then tried to install grub onto the SATA drive since it is a little better supported and now my laptop will only boot to some sort of Grub rescue screen. I can no longer boot to my Windows 7 installation.

Code:

(chroot) livecd / # lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda           8:0    0 223.6G  0 disk 
|-sda1        8:1    0   100M  0 part 
`-sda2        8:2    0 223.5G  0 part 
sr0          11:0    1   2.1G  0 rom   
loop0         7:0    0     2G  1 loop 
nvme0n1     259:0    0 238.5G  0 disk 
|-nvme0n1p1 259:3    0   256M  0 part  /boot
`-nvme0n1p2 259:4    0 238.2G  0 part 
  `-root    252:0    0 238.2G  0 crypt /
nvme1n1     259:1    0 238.5G  0 disk 
`-nvme1n1p1 259:2    0 238.5G  0 part


Code:

/etc/default/grub

GRUB_DISTRIBUTOR="Gentoo"
GRUB_DISABLE_SUBMENU=y
GRUB_PRELOAD_MODULE="luks cryptodisk"
GRUB_CMDLINE_LINUX="real_root=/dev/mapper/root enc_root=/dev/nvme0n1p2 rootfstype=ext4"
GRUB_ENABLE_CRYPTODISK=y 


Code:

(chroot) livecd grub # grub-mkconfig -o /boot/grub/grub.conf
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.9.16-gentoo
Found initrd image: /boot/initramfs-genkernel-x86_64-4.9.16-gentoo
Found linux image: /boot/vmlinuz-4.9.16-gentoo.old
Found initrd image: /boot/initramfs-genkernel-x86_64-4.9.16-gentoo
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
  Volume group "root" not found
  Cannot process volume group root
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
  Volume group "root" not found
  Cannot process volume group root
/usr/sbin/grub-probe: error: disk `lvm/root' not found.
done


I don't mind hand-selecting which drive to boot from at boot time and I don't mind just having grub installed on the SATA drive and choosing from a boot menu. I also prefer to enter the drive encryption password on boot. At this moment it would just be nice to get my laptop booting again.

Edit:

This helped solve the lvmetad error during grub-mkconfig

http://unix.stackexchange.com/questions/199164/error-run-lvm-lvmetad-socket-connect-failed-no-such-file-or-directory-but

Code:

Assuming you're running Linux, in /etc/lvm/lvm.conf set:

use_lvmetad = 0
Stop LVM prior to doing that: /etc/init.d/lvm stop. Make the change and restart LVM: /etc/init.d/lvm start


I also installed os-prober and it was able to add Windows 7 to the grub configuration.

Grub is still not installing correctly though. It still sends me to the grub prompt instead of a menu.

I am not running a Windows 7 disk to repair sda so I can use my laptop for now. I should be able to boot directly to nvme0n1 when we figure out what is failing.

Thanks to anyone who can aid me in my Gentoo installation adventure.

Edit:
I needed to add device-mapper to my use flags and re-emerge grub-mkconfig and genkernel. That got rid of all errors and would allow the creation of grub.conf
I also set my /boot partition (nvme0n1p1) to legacy_bootable in parted just in case.

After running "grub-install --target="i386-pc" /dev/nvme0n1 --force" from the chroot environment and rebooting I am still getting to the grub command instead of a menu.
Back to top
View user's profile Send private message
joanandk
Tux's lil' helper
Tux's lil' helper


Joined: 12 Feb 2017
Posts: 80

PostPosted: Tue Apr 11, 2017 6:44 am    Post subject: Reply with quote

Hi,

My office Laptop is a Thinkpad P50. I have a Gentoo installation on it and two drives (1x NVME and 1x SATA). The two differences between your sw-setup and mine: I have no encryption and I use EFI.

By using EFI, I get a "sda" block device instead of nvme device.

If you are willing to switch from BIOS to EFI, I could try to support you.

BR

Quote:

[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.10.9-gentoo root=/dev/sda4 ro
....
[ 0.000000] efi: EFI v2.40 by Lenovo
[ 0.000000] efi: SMBIOS=0x57b79000 ACPI=0x57ffe000 ACPI 2.0=0x57ffe014 ESRT=0x56fef000
....
[ 1.400374] scsi 3:0:0:0: Direct-Access ATA Samsung SSD 840 6B0Q PQ: 0 ANSI: 5
[ 1.403913] sd 0:0:0:0: [sda] Write Protect is off
[ 1.405720] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[ 1.405751] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 1.409780] sda: sda1 sda2 sda3 sda4
....
Back to top
View user's profile Send private message
quadcricket
n00b
n00b


Joined: 10 Apr 2017
Posts: 4
Location: Arizona

PostPosted: Tue Apr 11, 2017 8:03 pm    Post subject: Reply with quote

Okay, sounds fine with me. I am starting over with an EFI partition layout and and kernel configuration. I will post back here after I wait for everything to compile from the stage3.

Thanks for the support.

Edit:

Okay I've installed a fresh system and chrooted into it. I've setup a vfat partition and mounted it to boot and tried to install grub:
Code:
root #grub-install --target=x86_64-efi --efi-directory=/boot


And modified whatever files seemed to make sense to have my /dev/nvme0n1p3 LUKS partition map to /dev/mapper/root
There was no /etc/crypttab though. I modified something else in etc. I will need to look into that but I am too tired right now.

Any tips or things I can try to diagnose why EFI refuses to boot this system would be appreciated.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7552
Location: Goose Creek SC

PostPosted: Wed Apr 12, 2017 12:25 pm    Post subject: Reply with quote

Quote:
tried to install grub:
suggests grub failed to install. Recommend:
Boot a system rescue cd/usb in UEFI mod.
Mount the gentoo partitions.
Enter the chroot. from the UEFI booted livecd system.
Run mount to verify /boot is in fact mounted.
Run ls /boot to verify /boot/efi exists.
Verify that /etc/portage/make.conf includes exactly GRUB_PLATFORMS="efi-64" not GRUB_PLATFORMS="pc"
Emerge grub and efivar.
Run efibootmgr to verify efivar is installed and that the kernel supports it.
Run grub-install --target=x86_64-efi --efi-directory=/boot/efi and grub-mkconfig -o /boot/grub/grub.cfg.
Run ls /boot/efi/EFI/gentoo/grubx64.efi to verify the grub executable is installed.
Run nano /boot/grub/grub.cfg, check that it makes sense.
Reboot.
Reboot.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
joanandk
Tux's lil' helper
Tux's lil' helper


Joined: 12 Feb 2017
Posts: 80

PostPosted: Wed Apr 12, 2017 1:28 pm    Post subject: Reply with quote

There is also an other way to get EFI working: If Linux is the only OS on the system, then one can copy grubx64.efi to /EFI/BOOT/BOOTX64.EFI. Thinkpad falls back to this if it fails to boot any entry:
Code:

BootCurrent: 001B
Timeout: 2 seconds
BootOrder: 0017,0019,001A,001C,001D,001E,0018,0020,0000,001B,001F,0025
Boot0000  Windows Boot Manager
Boot0010  Setup
Boot0011  Boot Menu
Boot0012  Diagnostic Splash Screen
Boot0013  Lenovo Diagnostics
Boot0014  Startup Interrupt Menu
Boot0015  Rescue and Recovery
Boot0016  MEBx Hot Key
Boot0017  USB CD
Boot0018  USB FDD
Boot0019  NVMe0
Boot001A  NVMe1
Boot001B* ATA HDD2
Boot001C  ATA HDD3
Boot001D  ATA HDD0
Boot001E  ATA HDD1
Boot001F  USB HDD
Boot0020  PCI LAN
Boot0021* IDER BOOT CDROM
Boot0022* IDER BOOT Floppy
Boot0023* ATA HDD
Boot0024* ATAPI CD
Boot0025* PCI LAN


BR
PS: On all my (U)EFI enabled systems, I am using the BOOTX64.EFI (either it is grubx64.efi or the kernel with efi-stub).

[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu]
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Wed Apr 12, 2017 1:48 pm    Post subject: Reply with quote

joanandk wrote:
If Linux is the only OS on the system, then one can copy grubx64.efi to /


Quote:
three drives => a standard SATA SSD with Windows 7 on it, a storage nvme, and a Linux nvme.


Only advise here. when you get your box running. write down how you handled grub, and keep a livemedium at hand. just in case windows overwrites your bootloader.
Back to top
View user's profile Send private message
quadcricket
n00b
n00b


Joined: 10 Apr 2017
Posts: 4
Location: Arizona

PostPosted: Wed Apr 12, 2017 6:12 pm    Post subject: Reply with quote

DONAHUE wrote:
Quote:
tried to install grub:
suggests grub failed to install. Recommend:
Boot a system rescue cd/usb in UEFI mod.
Mount the gentoo partitions.
Enter the chroot. from the UEFI booted livecd system.
Run mount to verify /boot is in fact mounted.
Run ls /boot to verify /boot/efi exists.
Verify that /etc/portage/make.conf includes exactly GRUB_PLATFORMS="efi-64" not GRUB_PLATFORMS="pc"
Emerge grub and efivar.
Run efibootmgr to verify efivar is installed and that the kernel supports it.
Run grub-install --target=x86_64-efi --efi-directory=/boot/efi and grub-mkconfig -o /boot/grub/grub.cfg.
Run ls /boot/efi/EFI/gentoo/grubx64.efi to verify the grub executable is installed.
Run nano /boot/grub/grub.cfg, check that it makes sense.
Reboot.
Reboot.


Okay this definitely helped but I'm not there yet.

It looks like I was not booting the media in EFI mode. When I did I went through this list and I did not have efivar emerged.

The grub-install worked this time around and gentoo now shows up in the EFI list!

I tried rebooting and it immediately loaded the grub rescue prompt, so definite progress.

I tried getting it to load gentoo from grub>
Code:

ls #which showed my partitions, (hd1,gpt3) was obviously my encrypted drive
set root=(hd1,gpt2) #(hd1,gpt1) is the grub partition
linux /vmlinuz-myactualkernel-gentoo
initrd /initramfs-myactualinitramfs-gentoo
cryptsetup luksOpen (hd1,gpt3) root


It asked for my passphrase and then it told me to "Check that kernel supports aes-xts-plain64 cipher"

So it looks like I missed some crypto support in the kernel. I am going to look into that next.

Thanks again, hopefully we are close.

Edit:

I checked the kernel and it had AES and XTS support. I added SHA1/SHA256/SHA512 just for fun, make -j4 && make modules_install && make install, then reinstalled efi and rebooted, still nothing.

When I set the kernel and the initramfs in grub it gets me to here:

Code:

>> Determining root device ...
!! Could not find the root block device in .
!! Please specify another value or:
!!   - press Enter for the same
!!   - type "shell" for a shell
!!   - type 'q' to skip...
root block device() ::
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7552
Location: Goose Creek SC

PostPosted: Wed Apr 12, 2017 9:11 pm    Post subject: Reply with quote

Do you see any reference to initrd/initramfs or the kernel loading?
sysresccd in UEFI mode has an option to load an existing system from the hard drive, if it works for you it will confirm the problem being in grub.cfg, initramfs, or the kernel. Does the initramfs include an nvme driver? I vaguely recall something about genkernel not handling nvme in initramfs.
boot sysresccd and run lspci -k check drivers/modules used by sysresccd against your kernel.
Run blkid. Determine PARTUUID and/or PARTLABEL for the root partition and use root=PARTUUID= or root=PARTLABEL= at the grub prompt and/or grub.cfg.
Consider pastebin of initramfs, kernel config, grub.cfg.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
quadcricket
n00b
n00b


Joined: 10 Apr 2017
Posts: 4
Location: Arizona

PostPosted: Fri Apr 14, 2017 2:18 am    Post subject: Reply with quote

I tried a few more fresh installs, I tried using LVM, I tried better-initramfs and even the Funtoo install with debian-sources and initramfs.

If I got the device mapper to work it seemed encryption wouldn't. If I got the encryption working then the nvme devices wouldn't show up.

I know making sure that grub has device-mapper support is important. I also know that something is funky with the initramfs tools that are available.

I might revisit this in the future and just do an encrypted /home partition or move Windows off of the SATA drive since it has more support.

For now though it's time to reimage Arch-OpenRC and get back to work.

Thanks for the support.
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