Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

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

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
User avatar
quixote
Posts: 118
Joined: 2009-10-15 02:51
Location: Dreaming of alpacas
Been thanked: 1 time

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

#1 Post by quixote »

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/InstallingDebia ... 05th%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
dotlj
Posts: 646
Joined: 2009-12-25 17:21

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

#2 Post by dotlj »

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
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

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

#3 Post by Head_on_a_Stick »

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.
deadbang

User avatar
quixote
Posts: 118
Joined: 2009-10-15 02:51
Location: Dreaming of alpacas
Been thanked: 1 time

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

#4 Post by quixote »

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: 118
Joined: 2009-10-15 02:51
Location: Dreaming of alpacas
Been thanked: 1 time

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

#5 Post by quixote »

Not getting anywhere, I'm afraid. I finally realized, after reading the links, that what I needed was https://wiki.debian.org/InstallingDebia ... 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?

perieanuo
Posts: 4
Joined: 2018-01-26 06:26

stretch 9.3 install on Thinkpad X1 Carbon and UEFI boot

#6 Post by perieanuo »

quixote wrote:Not getting anywhere, I'm afraid. I finally realized, after reading the links, that what I needed was https://wiki.debian.org/InstallingDebia ... 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

User avatar
quixote
Posts: 118
Joined: 2009-10-15 02:51
Location: Dreaming of alpacas
Been thanked: 1 time

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

#7 Post by quixote »

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:

Post Reply