Why is my /boot/efi partition empty?

Last night, I migrated and upgraded my BIOS Manjaro + Windows 7 dual-boot into a UEFI Manjaro + Windows 10 dual-boot onto my new SSD. I installed Windows 10 but am still using my old Manjaro install, only now it boots to a UEFI menu. The migration is working great as far as I can tell (I can actually boot either Grub MBR or Grub UEFI, depending on my computer BIOS boot priority setting). But I'm not sure if I did it right since this is my first time working with UEFI.

So I got it working mostly with the help of the "Switching from BIOS to UEFI" section of the Manjaro Wiki UEFI Install Guide. But also using the Windows 10 - Manjaro - Dual-boot - Step by Step.

Furthermore, I used Timeshift to migrate my Manjaro install which is explained in the Clone hard drive to new smaller hd / ssd without losing anything tutorial (although I knew how to do this already).

So my final layout has 3 boot partitions, 2 $esp and 1 normal(?) linux /boot.

sda1-4 is Windows. sda5-8 is Manjaro (sda5 is /boot/efi, sda8 is /boot).

gdisk
GPT fdisk (gdisk) version 1.0.4

Type device filename, or press <Enter> to exit: /dev/sda
Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sda: 976773168 sectors, 465.8 GiB
Model: CT500MX500SSD1  
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 353EC9E1-85A9-4E2F-8040-BDC9670A277F
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2029 sectors (1014.5 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         1023999   499.0 MiB   2700  Basic data partition
   2         1024000         1226751   99.0 MiB    EF00  EFI system partition
   3         1226752         1259519   16.0 MiB    0C01  Microsoft reserved ...
   4         1259520       210974719   100.0 GiB   0700  Basic data partition
   5       210974720       212023295   512.0 MiB   EF00  EFI Manjaro
   6       212023296       285423615   35.0 GiB    8300  
   7       285423616       976158719   329.4 GiB   8300  
   8       976158720       976773119   300.0 MiB   8300  
parted
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Model: ATA CT500MX500SSD1 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size    File system  Name                          Flags
 1      1049kB  524MB  523MB   ntfs         Basic data partition          hidden, diag
 2      524MB   628MB  104MB   fat32        EFI system partition          boot, esp
 3      628MB   645MB  16.8MB               Microsoft reserved partition  msftres
 4      645MB   108GB  107GB   ntfs         Basic data partition          msftdata
 5      108GB   109GB  537MB   fat32        EFI Manjaro                   boot, esp
 6      109GB   146GB  37.6GB  ext4
 7      146GB   500GB  354GB   ext4
 8      500GB   500GB  315MB   ext3
lsblk
# lsblk /dev/sda
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0   499M  0 part 
├─sda2   8:2    0    99M  0 part 
├─sda3   8:3    0    16M  0 part 
├─sda4   8:4    0   100G  0 part 
├─sda5   8:5    0   512M  0 part /boot/efi
├─sda6   8:6    0    35G  0 part /
├─sda7   8:7    0 329.4G  0 part /home
└─sda8   8:8    0   300M  0 part /boot
findmnt
# findmnt -s
TARGET                 SOURCE                                    FSTYPE OPTIONS
/boot                  UUID=6aad92cb-7507-45c0-b7f1-cfc55dc6c3fb ext3   defaults,noatime
/                      UUID=86a5e4bc-e074-4ead-b27e-53def8239055 ext4   defaults,noatime,nodelalloc,errors=remount-ro
/home                  UUID=842eb5f5-b442-47b7-bda8-761c4eb64932 ext4   defaults,noatime,nodelalloc,errors=remount-ro
/run/media/yena/ST4000 UUID=01D46B63959102F0                     ntfs   defaults,noatime,uid=1000,gid=1001,umask=022,nofail,x-systemd.device-timeout=15
/run/media/yena/FILES  UUID=01D3219CD10FBA40                     ntfs   defaults,noatime,uid=1000,gid=1001,umask=022,nofail,x-systemd.device-timeout=15
/run/media/yena/APPS   UUID=01D3328390BB87B0                     ntfs   defaults,noatime,uid=1000,gid=1001,umask=022,nofail,x-systemd.device-timeout=15,noauto
/run/media/yena/backup UUID=bc8ab2c9-ea5d-4da2-88b3-17ec3bbd01d2 ext4   defaults,noatime,data=writeback,nodelalloc,errors=remount-ro
/boot/efi              UUID=2EA8-AD1A                            vfat   defaults
df
Filesystem      Size  Used Avail Use% Mounted on
dev             7.9G     0  7.9G   0% /dev
run             7.9G  1.3M  7.9G   1% /run
/dev/sda6        35G   16G   18G  47% /
tmpfs           7.9G  130M  7.7G   2% /dev/shm
tmpfs           7.9G     0  7.9G   0% /sys/fs/cgroup
tmpfs           7.9G   41M  7.8G   1% /tmp
/dev/sda8       283M  150M  119M  56% /boot
/dev/sda7       324G   13G  295G   5% /home
/dev/sda5       511M  144K  511M   1% /boot/efi
/dev/sdc3        49G   32G   16G  68% /run/media/yena/backup
/dev/sdb6       425G  219G  207G  52% /run/media/yena/FILES
/dev/sdc2       3.6T  2.4T  1.2T  67% /run/media/yena/ST4000
tmpfs           1.6G   36K  1.6G   1% /run/user/1000

So my question is, did I do this right? I can boot Manjaro and Windows 10 fine. I can update my kernels fine. But /boot/efi is empty. The only file in that partition is /boot/efi/EFI/manjaro/grubx64.efi which is 13 KB.

:woman_shrugging:

P.S. Why do some people write $esp with the dollar sign?

1 Like

This sounds like a case for @gohlip. He loves dealing with Windows dual boot questions. :smile:

You're no rookie @korealinux, why Newbie Corner?

1 Like

well everything is working so you didnt do anything too wrong. right? there is really only a need for 1 EFI partition and you could probably eliminate the sda5 efi partition after doing a grub install to sda1 and that should become the first boot option in efibootmgr. but to be sure i would suggest the same as @tbg and wait for @gohlip to chime in as he's good with this kind of thing. and sda8 im not sure is even necessary either way, but again not exactly sure

2 Likes

I am a newbie to UEFI? Also bootloaders are confusing. And scary. :ghost:

This is a leftover from migration. My Timeshift backup had a separate /boot partition, that is the reason I had to create it. I will probably get rid of it.

1 Like

@korealinux
Some check points, just to be sure (maybe I'm just too cautious).

  1. Since you migrated from bios-legacy to uefi, check that the packages are installed (these are not required for bios-legacy)
    efibootmgr
    dosfstools
    efivar

  2. Check that Manjaro OS is booted and in uefi mode

test -d /sys/firmware/efi && echo UEFI || echo BIOS

Output must be "UEFI".

  1. Do commands (it's okay to do again) to be sure.
sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=manjaro --recheck --debug
sudo update-grub
sudo cp /boot/grub/x86_64-efi/core.efi /boot/efi/EFI/boot/bootx64.efi
sudo efibootmgr -c -d /dev/sda -p 5 -L "manjaro" -l "\EFI\Manjaro\grubx64.efi"
  1. Check with command "efibootmgr"
    You might have 2 efientries of 'manjaro' but it is okay.
    If you want to, you can delete the 'later' entry, not the first with
sudo efibootmgr -b xxxx -B

where xxxx is entry to be deleted.

Notes:
o A separate boot partition is not necessary whether in bios-legacy or in uefi.
But there is nothing wrong to have it, really.
But you have sda8 in ext3 and it is deprecated.
Best that boot partition is in ext2, not ext4
Suggest you leave it alone, though.

o I don't have your blkid output. I assume all is in order. Meaning the fstab entries correspond with blkid.

o Your /boot/efi now(after above) will contain a manjaro directory and a boot directory and inside that a boot.efi file (for boot dir) and grub.efi file (for manjaro dir).

Good luck.

[EDIT] - I changed/edited Step 3 this line

sudo efibootmgr -c -d /dev/sda -p 5 -L "manjaro" -l "\EFI\Manjaro\grubx64.efi"

Please recheck you have it corrected.
That's because your /boot/efi partition is sda5 and the directory there is \EFI\Manjaro\xxx\xxx" not \efi\manjaro\xxx\xxx". sorry.

8 Likes

does sda1 need to be specified for it to install grub on sda1 instead of sda5 ?

No. because in fstab it is already listed sda5 as /boot/efi (if blkid correspond)
But I edited the second command (which was wrong) after I posted it.
And the path needs to be changed and it needs to specify sda5. not sda1.

Thanks.

2 Likes
  1. I have all 3 packages. I installed efibootmgr when I chrooted in from the liveUSB. The other 2 were already installed.
  2. output is UEFI
  3. I had to mkdir /boot/efi/EFI/boot, but everything else went ok. I deleted the extra manjaro entry that was created in the last command.
$ efibootmgr
BootCurrent: 0004
Timeout: 1 seconds
BootOrder: 0002,0003,0000,0001
Boot0000* SATA3:ASUS    DRW-24B1ST   i  
Boot0001* SATA1:CT500MX500SSD1          
Boot0002* manjaro
Boot0003* Windows Boot Manager
blkid
/dev/sdc2: LABEL="ST4000" UUID="01D46B63959102F0" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="8e4e1f10-e8c9-01d1-880f-27c764f4e800"                                               
/dev/sdc3: LABEL="backup" UUID="bc8ab2c9-ea5d-4da2-88b3-17ec3bbd01d2" TYPE="ext4" PARTUUID="c62ad05f-c009-4489-ba10-ccde513775ec"                                                            
/dev/sda1: LABEL="Recovery" UUID="4E7674E97674D2E7" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="c182f7ac-bb46-4457-a394-9b543672a029"                                             
/dev/sda2: UUID="7278-EDDA" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="f8948a55-ea27-41e4-8bb6-9e3a0eda35e5"                                                                     
/dev/sda4: UUID="989A845F9A843C2E" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="1c78d87b-d54c-4cce-a917-5643d2546f83"                                                              
/dev/sda5: UUID="2EA8-AD1A" TYPE="vfat" PARTLABEL="EFI Manjaro" PARTUUID="373e5a2f-0491-4c22-a01c-fb80eff16893"                                                                              
/dev/sda6: UUID="86a5e4bc-e074-4ead-b27e-53def8239055" TYPE="ext4" PARTUUID="02567251-d682-4e18-9c05-f109bb34e17b"                                                                           
/dev/sda7: UUID="842eb5f5-b442-47b7-bda8-761c4eb64932" TYPE="ext4" PARTUUID="2a5565ef-4363-41a4-b812-a55fcee24752"                                                                           
/dev/sda8: UUID="6aad92cb-7507-45c0-b7f1-cfc55dc6c3fb" TYPE="ext3" PARTUUID="35ea43e8-13da-467e-a1f1-3a7c103f96f5"                                                                           
/dev/sdb2: UUID="7EF29223F291E027" TYPE="ntfs" PARTUUID="bdab6d80-02"
/dev/sdb5: LABEL="APPS" UUID="01D3328390BB87B0" TYPE="ntfs" PARTUUID="bdab6d80-05"
/dev/sdb6: LABEL="FILES" UUID="01D3219CD10FBA40" TYPE="ntfs" PARTUUID="bdab6d80-06"
/dev/sdb7: UUID="2854a08d-60a7-4f9d-9abc-984c354a309a" SEC_TYPE="ext2" TYPE="ext3" PARTUUID="bdab6d80-07"                                                                                    
/dev/sdb8: UUID="e1324e25-7e6a-43dd-8b7e-fad574d31363" TYPE="ext4" PARTUUID="bdab6d80-08"
/dev/sdb9: UUID="454000a3-b595-468c-b34c-762473d6477b" TYPE="ext4" PARTUUID="bdab6d80-09"
/dev/sdb10: UUID="a7b78ea8-e9ef-46a1-80b4-fbd9bd3466c2" TYPE="ext4" PARTUUID="bdab6d80-0a"
fstab
# <file system> <mount point> <type> <options> <dump> <pass>

UUID=6aad92cb-7507-45c0-b7f1-cfc55dc6c3fb       /boot   ext3    defaults,noatime        0       2
UUID=86a5e4bc-e074-4ead-b27e-53def8239055       /       ext4    defaults,noatime,nodelalloc,errors=remount-ro   0       1
UUID=842eb5f5-b442-47b7-bda8-761c4eb64932       /home   ext4    defaults,noatime,nodelalloc,errors=remount-ro   0       2
UUID=01D46B63959102F0   /run/media/yena/ST4000  ntfs    defaults,noatime,uid=1000,gid=1001,umask=022,nofail,x-systemd.device-timeout=15 0       0
UUID=01D3219CD10FBA40   /run/media/yena/FILES   ntfs    defaults,noatime,uid=1000,gid=1001,umask=022,nofail,x-systemd.device-timeout=15 0       0
UUID=01D3328390BB87B0   /run/media/yena/APPS    ntfs    defaults,noatime,uid=1000,gid=1001,umask=022,nofail,x-systemd.device-timeout=15,noauto  0       0
UUID=bc8ab2c9-ea5d-4da2-88b3-17ec3bbd01d2       /run/media/yena/backup  ext4    defaults,noatime,data=writeback,nodelalloc,errors=remount-ro    0       2
UUID=2EA8-AD1A /boot/efi vfat defaults 0 0

I have 2 files now.

$ ls -R /boot/efi
/boot/efi:
EFI

/boot/efi/EFI:
boot  manjaro

/boot/efi/EFI/boot:
bootx64.efi

/boot/efi/EFI/manjaro:
grubx64.efi

Thank you for going over my setup! :heart_eyes_cat:

2 Likes

Some questions to help clarify how this works now.

  1. In what sequence were the installations to the new disk ?
  2. How was the partitioning done, when from what utility?
  3. Was your old disk in GPT or MSDOS type partitioning table?
  4. Which partitions were copied to the new disk and how/which utility?
  5. More specifically how was sda1 created?
  1. Windows 10 first, then Manjaro was installed. I thought of doing it the other way, but I read Windows might take over the bootloader, so I tried to save a step. To clarify, Windows 10 was a fresh install.
  2. Windows partitions were done by Windows 10 installer and C: was resized with Windows Disk Management. Linux partitions were created with Gparted from a live environment.
  3. Original install was on a MBR partition (primary plus extended + logical partitions).
  4. I copied only the linux partitions using a Timeshift snapshot. Timeshift does not do any partition work, so I had to create them with Gparted. After Timeshift recovered the partitions to the new disk, I could boot Manjaro in BIOS mode, but not in UEFI mode (Windows 10 only boots in UEFI mode so there was no conflict).
  5. Windows created sda1.

After recovering the Timeshift snapshot and making sure I could actually use Manjaro in BIOS mode on the new disk, I booted the liveUSB again in UEFI mode to convert BIOS Manjaro into UEFI Manjaro.

I read in wiki it's better fat32

We are talking about /boot (not $esp) partition, not /boot/efi ($esp) partition. Show that wiki if you are not mistaken.

In my view of the world either /boot or /boot/efi or /efi the same things :thinking:
Here I see mount point /boot or /efi
https://wiki.archlinux.org/index.php/Partitioning#UEFI/GPT_example_layout

Here it's recommend /boot/efi
https://wiki.manjaro.org/index.php?title=UEFI_-_Install_Guide#Switching_from_BIOS_to_UEFI

I've tried different ways already, can't see the difference. It's hard for me

So, here 's what's happened (Mr. Monk):
After copying the Timeshift snapshots, you (or timeshift?) run grub-install /dev/sda. Being in MSDOS mode, grub installed grub core image to sda. I think there should be an error, because it is a GPT disk (maybe RTFM or @gohlip can verify this) and a small partition is needed to install core image, since there is no "real" MBR, unless your UEFI firmware can do that so well (mimic/fake an MBR table).

Exactly. It needed to boot in UEFI and install grub on $esp (UEFI mode).
which was done later...

The system is supposed to run mainly on UEFI mode, so there is no real benefit on using MSDOS mode (apart for the proof-of-concept, of course :laughing: ).

So, it's not empty!! :laughing:.
This file is found by UEFI (PC hardware-firmware, not bound to disks) and adds an entry in UEFI menu (normally, unless you need to add that manually). That file then points at the full grub.cfg and the rest. Like the MBR on MSDOS/MBR systems.

It's the partition flag, like boot , esp.

1 Like

I think that's because the $ sign in linux, no, computer notation denotes the value of the variable.
So set root=(hd0,5) and $root = (hd0,5)
Or abc=456789 and $abc=456789.

1 Like

It's an informal convention, I think. No real reason for the sign. It's a flag for the EFI partition.

IMHO it doesn't matter how each person views the world. The thing is, "how the world is!" :wink:

1 Like

Your fstab does not have an entry for /boot/efi !!

We can all make mistakes, it seems. Even myself!
Great men quotes

:rofl::rofl:
PS: it also mean women !!

1 Like

I would like to know how the world is. If it's better i may create a different topic.
I honestly read couple times about those efi's, boot's, so confusing.

Then I just tried different ways and no difference at all. So I decided to stop read those hypnotic reading. :grinning:

But this topic i find pretty knowledgeable.

Not to be impolite, but your view does not matter, only the truth matters.

Yes, I can see that. Your interpretation of both links are wrong too. But to help you further (without appearing condescending, I hope),

All $esp partitions needs to be fat32, whether it is /boot/efi or /boot
All non $esp partitions must not be fat32 whether it is /boot or not.
$esp for grub must be mounted as /boot/efi, not /boot
$esp for systemd-boot must be mounted as /boot, not /boot/efi
$esp for refind can be either mounted /boot/efi or /boot. Most users are on /boot/efi because they or the OS mess up grub. My preference for refind $esp is /boot. As efistub boots should be.

Cheers, take care.

1 Like

Forum kindly sponsored by