WHy is my efi partition empty and unbootable?

If none of the more specific forums is the right place to ask

WHy is my efi partition empty and unbootable?

Postby MagicPoulp » 2020-03-10 10:07

I tried to boot my debian on usb on another computer. It is bootable on the computer with which I installed. But I cannot boot on another computer. I resintalled grub using grub-install --removable. I even used /dev/sda as parameter to be sure.

In the BIOS, there is nothing in the efi partition and I cannot boot.

I mounted my efi partition and it is indeed empty. SO I wonder what did happen. WHen I installed on usb, maybe it used the efi partition of the hard drive and not the efi partition of the usb.

I can reisntall again. In the manual partitioning, there is 2 efi partitions, one on hard disk and one on usb. What can I do?

See below a proof that the efi partition is empty.

sudo fdisk -l
Disk /dev/sda: 1,8 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: Portable SSD T5
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 33553920 bytes
Disklabel type: gpt
Disk identifier: D0E5B8EE-60B4-4E3B-B8C9-4FAC199CA1A9

Device Start End Sectors Size Type
/dev/sda1 65535 786419 720885 352M EFI System
/dev/sda2 786420 977323454 976537035 465,7G Linux filesystem
/dev/sda3 3867941235 3907000094 39058860 18,6G Linux swap
/dev/sda4 977323455 3867941234 2890617780 1,4T Microsoft basic data

Partition table entries are not in disk order.


-------------------------
I mounted the efi
/dev/sda1 on /media/bob/AA15-42F8 type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)


/media/bob/AA15-42F8$ sudo ls -lah
totalt 12K
drwxr-xr-x 3 bob bob 4,0K jan 1 1970 .
drwxr-xr-x 4 root root 4,0K mar 10 11:49 ..
drwxr-xr-x 4 bob bob 4,0K mar 9 20:58 'System Volume Information'
MagicPoulp
 
Posts: 303
Joined: 2018-11-05 21:30

Re: WHy is my efi partition empty and unbootable?

Postby p.H » 2020-03-10 10:13

When you run grub-install the target EFI partition must be mounted on /boot/efi or you must specify the actual mount point with --efi-directory= (and the target /boot directory path with --boot-directory= or you will install GRUB in the current /boot directory).
p.H
 
Posts: 1333
Joined: 2017-09-17 07:12

Re: WHy is my efi partition empty and unbootable?

Postby MagicPoulp » 2020-03-10 10:41

OK thanks. I thought about just this 5 min before I read your message.

I must try.
MagicPoulp
 
Posts: 303
Joined: 2018-11-05 21:30

Re: WHy is my efi partition empty and unbootable?

Postby MagicPoulp » 2020-03-10 14:45

MagicPoulp
 
Posts: 303
Joined: 2018-11-05 21:30

Re: WHy is my efi partition empty and unbootable?

Postby MagicPoulp » 2020-03-10 17:07

With the following command, I could get grub started on the usb, but it gets stuck during the starting.
usb is the efi partition, and usb2 is the ext4 partition with debian isntalled on it. I assumed that the efi wil ltrigger to boot on the ext4.

sudo grub-install --efi-directory=/mnt/usb --boot-directory=/mnt/usb2/boot --removable
updage-grub

If I look at my hard disk, the boot sequence in the bios is using /EFI/debian/grub*.efi
when I run grub-install, it only creates /EFI/boot.

THerefore, it seems to me that my debian installation overlooked to add this /EFI/debian that is necessary to boot.

Well I do not really know.

SHould I use efibootmgr? I don't understand the example 3 here. "efibootmgr example 3 - add a new boot entry"
Or should I do this here "Force grub-efi installation to the removable media path" =
https://wiki.debian.org/UEFI

efibootmgr -v
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0002,0001
Boot0000* grub PciRoot(0x0)/Pci(0x1b,0x0)/Pci(0x0,0x0)/NVMe(0x1,8C-E3-8E-03-00-05-34-6A)/HD(1,GPT,87670c4c-84ef-499b-a475-07d4ad6c1e0a,0x800,0x100000)/File(\EFI\debian\grubx64.efi)
Boot0001* UEFI: Samsung Portable SSD T5 0 PciRoot(0x0)/Pci(0x14,0x0)/USB(16,0)/HD(1,GPT,a01c407c-50e4-467e-b6ef-6cc161592615,0xffff,0xafff5)..BO
Boot0002* usb1 PciRoot(0x0)/Pci(0x14,0x0)/USB(16,0)/HD(1,GPT,a01c407c-50e4-467e-b6ef-6cc161592615,0xffff,0xafff5)/File(\EFI\BOOT\grubx64.efi)
Last edited by MagicPoulp on 2020-03-10 17:27, edited 1 time in total.
MagicPoulp
 
Posts: 303
Joined: 2018-11-05 21:30

Re: WHy is my efi partition empty and unbootable?

Postby MagicPoulp » 2020-03-10 17:16

I could try to reinstall everything, and make sure debian uses the right EFI partition. But how? But I don't know why it did not pick the right efi partition during the installation. It showed use as esb.
MagicPoulp
 
Posts: 303
Joined: 2018-11-05 21:30

Re: WHy is my efi partition empty and unbootable?

Postby MagicPoulp » 2020-03-10 17:28

When I boot, it says:

dependency failed for /boot/efi

then it cannot open a console. it says you are in rescue mode, the root account is locked.

I checked and this is empty:
ls -l /mnt/usb2/boot/efi/
MagicPoulp
 
Posts: 303
Joined: 2018-11-05 21:30

Re: WHy is my efi partition empty and unbootable?

Postby MagicPoulp » 2020-03-10 17:46

I reinstalled grub using a chroot. It seemed to look good.

When I boot, the detected usb bootloader in /EFI/boot/BOOT..efi does not work, it jsut says sytem reset and reboots on its own.
I can customized in the bios and pick grubx...64.efi

It boots grub but then I get errors:
timeout waiting for /dev/disk/by-uuid/YUD54-324DF (modified UUID I don't remember it)
dependency failed /dev/disk/by-uuid
dependency failed /boot/efi


this is why is in fstab in the chroot
cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdb2 during installation
UUID=b726653a-b1b1-4055-aa08-57b4780e6bd2 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=981F-3549 /boot/efi vfat umask=0077 0 1
# /windows_compatible was on /dev/sdb4 during installation
UUID=A94D-2D48 /windows_compatible vfat utf8 0 0
# swap was on /dev/sdb3 during installation
UUID=c042ab2d-8fdd-4d85-a096-e37341c404b2 none swap sw 0 0
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0


and the uuid mappings

ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 15 Mar 10 18:31 0e81aca3-cd41-421c-8c1b-f239d97396f3 -> ../../nvme0n1p2
lrwxrwxrwx 1 root root 15 Mar 10 18:31 7927-04C9 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 Mar 10 18:31 807eb518-4031-4ff0-bd02-5d20f8169ee7 -> ../../nvme0n1p3
lrwxrwxrwx 1 root root 10 Mar 10 18:31 A94D-2D48 -> ../../sda4
lrwxrwxrwx 1 root root 10 Mar 10 18:31 AA15-42F8 -> ../../sda1
lrwxrwxrwx 1 root root 10 Mar 10 18:31 b726653a-b1b1-4055-aa08-57b4780e6bd2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Mar 10 18:31 c042ab2d-8fdd-4d85-a096-e37341c404b2 -> ../../sda3

SO perhaps I should change the fstab for sda1.


Anyways, is it possible to make the debian installer do all good? How?
MagicPoulp
 
Posts: 303
Joined: 2018-11-05 21:30

Re: WHy is my efi partition empty and unbootable?

Postby MagicPoulp » 2020-03-10 18:10

Update:

After I edited /etc/fstab in the chroot, I can now boot on my usb disk on another computer. Yeehoou!

Just a final question. I made this usb for a friend. It is quite annoying that the BIOS (which looks weird) autodetects an efi boot loader that does not work.

it picks /EFI/boot/BOOTX.EFI
And during the startup it gives the error below before rebooting
System BootOrder not found.

So manually, I have to pick /EFI/boot/grubx64.efi, and it works.
---------> Can I remove all the stuff in /EFI/boot except the grub.cfg and grubx64.efi?
Then the bios can only detect the oen that works.

I guess it is to support more hardware if we have so many boot loaders. But we can guess grub should work for my friend.

And also why so much work? Can't it be isntalled on the right efi by the debian installer?
MagicPoulp
 
Posts: 303
Joined: 2018-11-05 21:30

Re: WHy is my efi partition empty and unbootable?

Postby MagicPoulp » 2020-03-10 21:04

Reading the doc, it seems I should force installing in bootx64.efi as the debian installer proposes.

https://wiki.debian.org/UEFI#Force_grub ... media_path
"to the removable media path in the ESP (e.g. \EFI\boot\bootx64.efi for amd64/X64 systems)"

But I do not know how to do it afterwards. WHen I picked ot install "grub on a hard disk", it installed on the hard disk and not on the usb as I wished. And the nit asked if I want to force the removable media path.

In the rescure mode, maybe there is a way. Does anyone know?

Should I use the option --force-extra-removable of grub-install?
http://transit.iut2.upmf-grenoble.fr/cg ... -install+8
"force installation to the removable media path also. This option is only available on EFI."

Well it seems I found the solution. The vocabulary is quite clear. I remember that 99% of the times I have problems because I do not read enough the doc and the man pages.
MagicPoulp
 
Posts: 303
Joined: 2018-11-05 21:30

Re: WHy is my efi partition empty and unbootable?

Postby MagicPoulp » 2020-03-11 10:54

I was not sure how to interpret Gridley's answer. But I see that he has only one post.

I don't think windows tools can help to install debian on a usb.

I think it is very likely Gridley is "deb-fan". You are unmasked lol.
Last edited by MagicPoulp on 2020-03-11 11:02, edited 1 time in total.
MagicPoulp
 
Posts: 303
Joined: 2018-11-05 21:30

Re: WHy is my efi partition empty and unbootable?

Postby MagicPoulp » 2020-03-11 10:56

I must choose between --removable or --force-extra-removable

they say it installs in BOOTX.EFI.

this is the one that is autodetected by the bios when connecting the USB. But it does not boot even if either --removable or --force-extra-removable was used.
ANd I did not forget to use update-grub.

I also found that wihtout the option --uefi-secure-boot, the effect of --removable is totally different. A completeley different image is produced. It says "just copies the image" without using efi_signed customized by the option --removable
I think it is wiser to make an image bootable on secure boot. I will try.
MagicPoulp
 
Posts: 303
Joined: 2018-11-05 21:30


Return to General Questions

Who is online

Users browsing this forum: bester69 and 4 guests

fashionable