[SOLVED] stretch 9.3 install on Thinkpad X1 and UEFI boot

Help with issues regarding installation of Debian

[SOLVED] stretch 9.3 install on Thinkpad X1 and UEFI boot

Postby quixote » 2018-02-05 02:16

I'm trying to install debian on a 1 TB SSD. Win 10 is already nuked. I've wandered around the Debian sites, and was following the hints here: https://wiki.debian.org/InstallingDebianOn/Thinkpad/X1%20Carbon%205th%20Gen and the linked pages. Debian seemed to install normally to partition 2 below:
Code: Select all
>          1 MB  free space
> #1      537 MB           boot          ESP           [i.e. EFI System Partition]
> #2       30  GB                       ext4      /
> #3       17  GB                       swap     swap
> #4      977 GB                        ext4      /home
>       335kB   free space       


The installer could not turn off the boot flag on #1, or turn it on for #2, for whatever that's worth. It had the F -- for format -- designation for all four partitions.

When I try to boot, I don't get a grub menu or any other boot menu. I get a choice to boot from the SSD or PCI LAN. But when I choose the SSD, it just flips right back to the same dialogue giving me a choice of SSD or PCI LAN.

I don't need Windows for anything. What's the way to deal with this?

Thanks!
Last edited by quixote on 2018-02-10 01:52, edited 1 time in total.
User avatar
quixote
 
Posts: 95
Joined: 2009-10-15 02:51
Location: Sitooterie

Re: stretch 9.3 install on Thinkpad X1 Carbon and UEFI boot

Postby dotlj » 2018-02-05 05:02

Have a look at https://wiki.debian.org/UEFI
One thing i noticed in the link you gave was turning off TPM.
Like most things in Linux there are various ways to do this.
1. Follow the UEFI way with existing partitions. Many people use UEFI to install Debian and other distros.
2. Turn off UEFI and use MBR in BIOS settings, since you don't want Windows. I find it easier or maybe I'm just lazy, to install Debian the old way. It has always worked and probably will for some time.
I keep telling myself that I'll try UEFI next time, I did try it on a 64GB flash drive and it worked ok, but I wiped that one because I was upgrading TAILS.
There are plenty of links around as the Thinkpad X1 Carbon is a popular machine.
Keep us updated what you do and what you think about installing on the Thinkpad X1 Carbon.
User avatar
dotlj
 
Posts: 599
Joined: 2009-12-25 17:21

Re: stretch 9.3 install on Thinkpad X1 Carbon and UEFI boot

Postby Head_on_a_Stick » 2018-02-05 06:23

quixote wrote:Debian seemed to install normally to partition 2

Did the installer recognise the EFI system partition and mount it to /boot/efi?

The installer could not turn off the boot flag on #1, or turn it on for #2, for whatever that's worth. It had the F -- for format -- designation for all four partitions.

There are no "boot flags" on a GPT disk, that is just a confusing abstraction.

Also, the installer should not have attempted to change any partition types (codes) at all if you were booted in UEFI mode.

Were there any errors at the bootloader installation stage?

Please load up a "live" ISO image in UEFI mode and post the output of
Code: Select all
# efibootmgr -v

This will show if there are any UEFI boot entries for Debian.
User avatar
Head_on_a_Stick
 
Posts: 7994
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: stretch 9.3 install on Thinkpad X1 Carbon and UEFI boot

Postby quixote » 2018-02-05 14:26

Just woke up here near the Pacific. Thanks for both those replies, off to try to do / understand them now. I've never really successfully wrapped my mind around the whole EFI, GPT business, so the option to just revert to MBR appeals to me. I'll be back with the continuing story :D .
User avatar
quixote
 
Posts: 95
Joined: 2009-10-15 02:51
Location: Sitooterie

Re: stretch 9.3 install on Thinkpad X1 Carbon and UEFI boot

Postby quixote » 2018-02-07 01:43

Not getting anywhere, I'm afraid. I finally realized, after reading the links, that what I needed was https://wiki.debian.org/InstallingDebianOn/Thinkpad/X1%20Carbon%204thGen%20PCIe_SSD/jessie under the section at the bottom titled, oddly enough, Solve Problems with GRUB, Disk not-Seen and Black Screen. When all else fails read the instructions.

But I ran into problems right away.
Code: Select all
Run a shell (for example: boot live USB ->Advanced ->Rescue mode
That takes me to a list of choices, one of which is "Exit to a shell". I assume that's what they mean. But when I do that, I get a message saying (if I remember right) that /root is now in RAM and a /target dir is already made. So what do I do with the first instruction:
Code: Select all
mkdir -p /target
? Doesn't make sense that they'd want me to make another identical dir.

Then came commands some of which seem optional:
Code: Select all
fdisk -lu
// this worked fine & partition I want to install grub-efi on is *I think* the / partition, nvme0n1p2, not the EFI one nvme0n1p1
Code: Select all
cryptsetup luksOpen /dev/nvme0n1p<X> cryptrootlvm   // I don't want encryption. assumed I didn't need this
pvscan   // scans all disks for physical volumes (necessary)   // ran this but it returned nothing
vgchange -a y   // this activates the volume group
                           // do I need a volume group? don't know what it is, Assumed no, so didn't run this
lvdisplay  // useful to determine <XXX> below  // returned nothing. so I used /dev/nvme0n1p2,see under fdisk -lu
mount /dev/<XXX>/root /target
          //I used:   mount /dev/nvme0n1p2/root /target
that mounted what looked like / on /target.

However, I never had the feeling any of it made sense, so I have no idea what I was doing. Confusion reigns supreme. I have used chroot once or twice before, but then I had a clear idea which system I was chrooting *from* and *to*.

Then I went ahead and ran the rest of the commands:
Code: Select all
mount --bind /dev /target/dev
mount --bind /dev/pts /target/dev/pts
mount --bind /proc /target/proc
mount --bind /sys /target/sys
cp /etc/resolv.conf /target/etc
chroot /target /bin/bash

then:

apt-get update
apt-get install grub-efi-amd64
update-grub
grub-install --target=x86_64-efi /dev/nvme0n1


All those commands looked like they worked normally, but as I say, I'm not sure *where* I was actually running them. Then it says
Code: Select all
Exit the shell, choose "Continue without bootloader" and the system should boot.
I had to exit twice to get all the way back to Rescue, I selected "Continue without bootloader" ......... and, no. It wanted to reinstall the whole damn system. So I let it do that, but boot still fails. Whatever I did, I did not fix EFI.

I'm pretty sure when it continued without bootloader it was loading the LiveUSB. There's no way to unmount it, so I finally tried just yanking it out, but without the liveUSB it's just back to the black screen & choose media dialog.

I know I'm doing something stupid wrong, but what?

Also, if I just reformat the entire drive, is that likely to help? Or to turn my X1 into an expensive brick?
User avatar
quixote
 
Posts: 95
Joined: 2009-10-15 02:51
Location: Sitooterie

stretch 9.3 install on Thinkpad X1 Carbon and UEFI boot

Postby perieanuo » 2018-02-09 07:01

quixote wrote:Not getting anywhere, I'm afraid. I finally realized, after reading the links, that what I needed was https://wiki.debian.org/InstallingDebianOn/Thinkpad/X1%20Carbon%204thGen%20PCIe_SSD/jessie under the section at the bottom titled, oddly enough, Solve Problems with GRUB, Disk not-Seen and Black Screen. When all else fails read the instructions.

But I ran into problems right away.
Code: Select all
Run a shell (for example: boot live USB ->Advanced ->Rescue mode
That takes me to a list of choices, one of which is "Exit to a shell". I assume that's what they mean. But when I do that, I get a message saying (if I remember right) that /root is now in RAM and a /target dir is already made. So what do I do with the first instruction:
Code: Select all
mkdir -p /target
? Doesn't make sense that they'd want me to make another identical dir.

Then came commands some of which seem optional:
Code: Select all
fdisk -lu
// this worked fine & partition I want to install grub-efi on is *I think* the / partition, nvme0n1p2, not the EFI one nvme0n1p1
Code: Select all
cryptsetup luksOpen /dev/nvme0n1p<X> cryptrootlvm   // I don't want encryption. assumed I didn't need this
pvscan   // scans all disks for physical volumes (necessary)   // ran this but it returned nothing
vgchange -a y   // this activates the volume group
                           // do I need a volume group? don't know what it is, Assumed no, so didn't run this
lvdisplay  // useful to determine <XXX> below  // returned nothing. so I used /dev/nvme0n1p2,see under fdisk -lu
mount /dev/<XXX>/root /target
          //I used:   mount /dev/nvme0n1p2/root /target
that mounted what looked like / on /target.

However, I never had the feeling any of it made sense, so I have no idea what I was doing. Confusion reigns supreme. I have used chroot once or twice before, but then I had a clear idea which system I was chrooting *from* and *to*.

Then I went ahead and ran the rest of the commands:
Code: Select all
mount --bind /dev /target/dev
mount --bind /dev/pts /target/dev/pts
mount --bind /proc /target/proc
mount --bind /sys /target/sys
cp /etc/resolv.conf /target/etc
chroot /target /bin/bash

then:

apt-get update
apt-get install grub-efi-amd64
update-grub
grub-install --target=x86_64-efi /dev/nvme0n1


All those commands looked like they worked normally, but as I say, I'm not sure *where* I was actually running them. Then it says
Code: Select all
Exit the shell, choose "Continue without bootloader" and the system should boot.
I had to exit twice to get all the way back to Rescue, I selected "Continue without bootloader" ......... and, no. It wanted to reinstall the whole damn system. So I let it do that, but boot still fails. Whatever I did, I did not fix EFI.

I'm pretty sure when it continued without bootloader it was loading the LiveUSB. There's no way to unmount it, so I finally tried just yanking it out, but without the liveUSB it's just back to the black screen & choose media dialog.

I know I'm doing something stupid wrong, but what?

Also, if I just reformat the entire drive, is that likely to help? Or to turn my X1 into an expensive brick?
Uefi is bad business. Grub2 is beta almost all the way. Stick to MBR start from scratch and forget uefi.

Envoyé de mon HUAWEI NXT-L29 en utilisant Tapatalk
perieanuo
 
Posts: 4
Joined: 2018-01-26 06:26

Re: stretch 9.3 install on Thinkpad X1 Carbon and UEFI boot

Postby quixote » 2018-02-10 01:50

perieanuo, I'd just about decided the same thing. I kind of like the idea of not being limited to four primary drives or 2TB per drive, though, so I kept worrying the problem.

I reinstalled several times, each time the install finsihed normally. So the problem had to be purely the UEFI stuff and whatever bootloader I had not being able to handle that.

My attempts to get some kind of usefulness out of grub-efi never worked.

I decided to try rEFInd. When I booted a liveUSB using refind, I was finally able to boot into my install. W00T! So I installed it to the hard drive and ... still no joy :cry:

I rebooted using liveUSB and ran "refind-install" from the command line. That told me it installed fine, but a file was missing in /boot/efi/EFI/BOOT and I should copy it over. That dir didn't exist, so I created it, copied the specified file over (don't remember its name offhand, but I'll come back with an edit when I can check). And rebooted. ........

Success at long last! :mrgreen:

Can't say I like the aesthetics, but what the hell, it boots! I now have my gorgeous new Debian on my gorgeous new laptop! :lol:
User avatar
quixote
 
Posts: 95
Joined: 2009-10-15 02:51
Location: Sitooterie


Return to Installation

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable