Problem with /boot/efi

A few weeks ago, while still using 42.3, I decided to fix what I felt was an annoying problem (albeit a tiny one).
Whenever I booted up my system, I would see (I don’t use Plymouth) an entry fly by telling me that a particular partition
was improperly unmounted and I should run fsck to possibly fix it. The contravening partition? /boot/efi (the mount point to my /dev/sda1).

So, I rebooted with a copy of Parted Magic (a hard disk management system) and ran the gparted app.
After all was done (you can imagine it, and you’d be right), my system was then unbootable.
I could access it through Parted Magic’s file management software (which alleviated some of my horror), but was unable to boot.

I took this opprtunity to upgrade my system to Leap 15.0, and went through a “System Installation” rather than an “Upgrade”, but
to no avail. I still could not boot. I then tried booting with the installation medium (usb) still in the usb slot, chose “Boot from HD”,
and was able to easily boot into the newly installed Leap 15.0.

Hence, if I want to reboot, I must have the usb installer stick in the usb slot in order to boot into Leap 15.0. Obviously (I would think),
this is not a satisfactory method of booting one’s computer and I am now tiring of doing it this way ( :wink: ).

Can anyone guide/help me on fixing this problem?

Hi
I would suggest using a Tumbleweed Live rescue or DE USB in the future, much more compatible :wink:

So, if you get the system booting via USB as you described;

Is /boot/efi mounted?


lsblk

Does the /boot/efi/EFI directory have an opesuse directory, in here are there files?

Do the boot entries exist in the BIOS nvram?


efibootmgr -v

If you have Windows, then best to use that to fix FAT partitions. You might have to first assign the partition a drive letter, then run “CHKDSK /F”. And then unassign the drive letter.

I’ve tried to fix broken FAT partition in linux with “fsck”, but it is not as successful. Usually the brokenness is small, so it doesn’t matter. But for a badly broken partition, Windows does best. Or maybe FREEDOS could be used (not sure of that).

If that fails, I don’t have a good alternative suggestion. I would probably boot from rescue media, reformat the partition, set it to be an EFI partition, then reinstall grub. Ask if you decide to try this and need help.

You need install grub2 on your HD: https://doc.opensuse.org/documentation/leap/startup/html/book.opensuse.startup/cha.trouble.html#sec.trouble.data.recover.rescue.grub


lsblk

**#** lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 931.5G  0 disk  
├─sda1   8:1    0   256M  0 part /boot/efi
├─sda2   8:2    0   9.8G  0 part [SWAP]
├─sda3   8:3    0  72.1G  0 part /
└─sda4   8:4    0 849.4G  0 part /home
sdb      8:16   0   4.6T  0 disk  
└─sdb1   8:17   0   4.6T  0 part /mnt/Multimedia4
sdc      8:32   0   3.7T  0 disk  
└─sdc1   8:33   0   3.7T  0 part /mnt/Multimedia2
sdd      8:48   0   7.3T  0 disk  
└─sdd1   8:49   0   7.3T  0 part /mnt/Multimedia1
sde      8:64   0   7.3T  0 disk  
└─sde1   8:65   0   7.3T  0 part /mnt/Multimedia3
sdf      8:80   0   4.6T  0 disk  
└─sdf1   8:81   0   4.6T  0 part /mnt/Multimedia5
sr0     11:0    1  1024M  0 rom

Does the /boot/efi/EFI directory have an opesuse directory, in here are there files?

**#** mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,size=4807040k,nr_inodes=1201760,mode=755)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
/dev/sda3 on / type ext4 (rw,relatime,data=ordered)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=36,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=969)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
/dev/sdf1 on /mnt/Multimedia5 type ext4 (rw,relatime,data=ordered)
/dev/sdd1 on /mnt/Multimedia1 type ext4 (rw,relatime,stripe=8191,data=ordered)
/dev/sdc1 on /mnt/Multimedia2 type ext4 (rw,relatime,data=ordered)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/sde1 on /mnt/Multimedia3 type ext4 (rw,relatime,stripe=8191,data=ordered)
/dev/sdb1 on /mnt/Multimedia4 type ext4 (rw,relatime,stripe=8191,data=ordered)
/dev/sda4 on /home type ext4 (rw,relatime,data=ordered)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=963044k,mode=700,uid=1000,gid=100)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
tracefs on /sys/kernel/debug/tracing type tracefs (rw,relatime)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)

**#** ls -la /boot/efi
total 24
drwxr-xr-x 3 root root 16384 Dec 31  1969 **.**
drwxr-xr-x 4 root root  4096 Nov 10 10:27 **..**
drwxr-xr-x 4 root root  4096 Sep 11  2017 **EFI**
**#** ls -la /boot/efi/EFI/
total 28
drwxr-xr-x 4 root root  4096 Sep 11  2017 **.**
drwxr-xr-x 3 root root 16384 Dec 31  1969 **..**
drwxr-xr-x 2 root root  4096 Sep 11  2017 **boot**
drwxr-xr-x 2 root root  4096 Sep 11  2017 **opensuse**
**#** ls -la /boot/efi/EFI/boot/
total 1544
drwxr-xr-x 2 root root    4096 Sep 11  2017 **.**
drwxr-xr-x 4 root root    4096 Sep 11  2017 **..**
-rwxr-xr-x 1 root root 1208968 Oct 31 16:05 bootx64.efi
-rwxr-xr-x 1 root root  358768 Oct 31 16:05 fallback.efi
**#** ls -la /boot/efi/EFI/opensuse/
total 3492
drwxr-xr-x 2 root root    4096 Sep 11  2017 **.**
drwxr-xr-x 4 root root    4096 Sep 11  2017 **..**
-rwxr-xr-x 1 root root 1158688 Oct 31 16:05 MokManager.efi
-rwxr-xr-x 1 root root      58 Oct 31 16:05 boot.csv
-rwxr-xr-x 1 root root     155 Oct 31 16:05 grub.cfg
-rwxr-xr-x 1 root root 1060704 Oct 31 16:05 grub.efi
-rwxr-xr-x 1 root root  123904 Nov  1 08:48 grubx64.efi
-rwxr-xr-x 1 root root 1208968 Oct 31 16:05 shim.efi

Do the boot entries exist in the BIOS nvram?

Not sure how to retrieve that information.


efibootmgr -v

**#** efibootmgr -v
BootCurrent: 0001
Timeout: 2 seconds
BootOrder: 0000,0001
Boot0000  opensuse      VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0001* UEFI: Ut165 USB2FlashStorage0.00      PciRoot(0x0)/Pci(0x14,0x0)/USB(10,0)/HD(1,MBR,0x6b8b4567,0xa30,0x1e84)..BO

Nope. No windows on my machine (there hasn’t been for a couple decades).

Reformat? How? From what environment?

Not sure how one would set it to be an EFI partition.

Hi
So looks like the nvrm is funky… So boot from your usb device and as root user run;


efibootmgr -b 0 -B 0
efibootmgr -c -L "openSUSE" -l "\\EFI\\opensuse\\grubx64.efi"

First command deletes that funky entry (which may be a hardware BIOS/UEFI issue), the second command creates a new entry. Reboot and go into the BIOS and check the boot order, should have openSUSE in there? If so, system should boot again…

Checked out the linked document and have a question. It is mentioned that

> sudo grub2-install /dev/sda

will reinstall. Should it not be?

> sudo grub2-install /dev/sda1

Hi
Nooooo, your using efi, you just need to fix the entry in the BIOS…

Not sure how one accesses that part of the BIOS. I’ve never seen and lists in the BIOS mentioning installed OSes.I’ll reboot into the BIOS now to see if I can figure this out. Will return if’n I need help.

Well, my BIOS didn’t help inform me much. Secureboot and CSM were both disabled. Probably means that I don’t have UEFI anymore, I guess.
Not sure how to proceed at this point. May have to get more handholding in order to figure this out.

On Tue 20 Nov 2018 05:56:03 PM CST, kerijan2003 wrote:

malcolmlewis;2886786 Wrote:
> Hi
> Nooooo, your using efi, you just need to fix the entry in the BIOS…

Not sure how one accesses that part of the BIOS. I’ve never seen and
lists in the BIOS mentioning installed OSes.I’ll reboot into the BIOS
now to see if I can figure this out. Will return if’n I need help.

Hi
What is your hardware? Should be under the ‘boot’ tab in the BIOS?


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
SLES 15 | GNOME Shell 3.26.2 | 4.12.14-25.25-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

That means that you are set for UEFI booting, but without secure-boot. Which should be fine.

You can actually do that from openSUSE. I’m not sure that you should, at this stage. All of the needed files seem to be there.

Not sure how one would set it to be an EFI partition.

I would normally use “gdisk” for that. Actually, you can use “parted”. Maybe try:

parted /dev/sda print

Run that as root. It should list the partitions. And it should show the partition as “boot, esp” in the flags column. That’s what indicates that it is set as an EFI partition.

Posting output of inxi may be helpful for those trying to help:

erlangen:~ # inxi -zF
System:    Host: erlangen Kernel: 4.19.1-1-default x86_64 bits: 64 Console: tty 1 Distro: openSUSE Tumbleweed 20181116 
Machine:   Type: Desktop Mobo: ASRock model: Z170 Pro4S serial: <filter> UEFI: American Megatrends v: P3.50 date: 06/23/2016 
CPU:       Topology: Quad Core model: Intel Core i7-6700K bits: 64 type: MT MCP L2 cache: 8192 KiB 
           Speed: 4201 MHz min/max: 800/4200 MHz Core speeds (MHz): 1: 4201 2: 4200 3: 4200 4: 4204 5: 4201 6: 4200 7: 4201 
           8: 4200 
Graphics:  Device-1: Intel HD Graphics 530 driver: i915 v: kernel 
           Display: server: X.Org 1.20.3 driver: intel unloaded: fbdev,modesetting,vesa resolution: 1920x1200~60Hz 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 530 (Skylake GT2) v: 4.5 Mesa 18.1.7 
Audio:     Device-1: Intel Sunrise Point-H HD Audio driver: snd_hda_intel 
           Sound Server: ALSA v: k4.19.1-1-default 
Network:   Device-1: Intel Ethernet I219-V driver: e1000e 
           IF: enp0s31f6 state: down mac: <filter> 
           Device-2: Qualcomm Atheros AR9287 Wireless Network Adapter driver: ath9k 
           IF: wlp3s0 state: up mac: <filter> 
Drives:    Local Storage: total: 5.47 TiB used: 2.89 TiB (52.9%) 
           ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 950 PRO 512GB size: 476.94 GiB 
           ID-2: /dev/sda vendor: Western Digital model: WD40EZRX-22SPEB0 size: 3.64 TiB 
           ID-3: /dev/sdb vendor: Samsung model: SSD 850 EVO 500GB size: 465.76 GiB 
           ID-4: /dev/sdc type: USB vendor: Western Digital model: WD Elements 1048 size: 931.51 GiB 
Partition: ID-1: / size: 31.37 GiB used: 16.64 GiB (53.0%) fs: ext4 dev: /dev/nvme0n1p2 
           ID-2: /home size: 406.34 GiB used: 198.63 GiB (48.9%) fs: ext4 dev: /dev/nvme0n1p3 
           ID-3: swap-1 size: 31.90 GiB used: 51.2 MiB (0.2%) fs: swap dev: /dev/nvme0n1p1 
Sensors:   System Temperatures: cpu: 27.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Info:      Processes: 376 Uptime: 10h 54m Memory: 31.11 GiB used: 4.42 GiB (14.2%) Shell: bash inxi: 3.0.27 
erlangen:~ # 

Transition to uefi is described here: Frühjahrsputz | Karl Mistelberger

**#** parted /dev/sda print
Model: ATA ST1000DM003-1CH1 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:  

Number  Start   End     Size    File system     Name     Flags
 1      1049kB  269MB   268MB   fat16           primary  boot, esp
 2      269MB   10.8GB  10.5GB  linux-swap(v1)  Swap     swap
 3      10.8GB  88.2GB  77.5GB  ext4            Root
 4      88.2GB  1000GB  912GB   ext4            Home

Interesting reading. Very informative and well laid out document. Will keep link to it.

Did a

# dracut -f

and

# grub2-install --target=x86_64-efi
**#** efibootmgr -v
BootCurrent: 0001
Timeout: 2 seconds
BootOrder: 0001,0000
Boot0000  opensuse      VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0001* UEFI: Ut165 USB2FlashStorage0.00      PciRoot(0x0)/Pci(0x1d,0x0)/USB(1,0)/USB(6,0)/HD(1,MBR,0x6b8b4567,0xa30,0x1e84)..BO

Tried:

**#** efibootmgr -o 0000,0001
BootCurrent: 0001
Timeout: 2 seconds
BootOrder: 0000,0001
Boot0000  opensuse
Boot0001* UEFI: Ut165 USB2FlashStorage0.00

Just did a:

**#** grub2-install /dev/sda
Installing for x86_64-efi platform.
Installation finished. No error reported

**#** efibootmgr -v          
BootCurrent: 0001
Timeout: 2 seconds
BootOrder: 0000,0001
Boot0000* opensuse      HD(1,GPT,50236b58-6bf6-4681-9666-03383a34889b,0x800,0x80000)/File(\EFI\opensuse\grubx64.efi)
Boot0001* UEFI: Ut165 USB2FlashStorage0.00      PciRoot(0x0)/Pci(0x1d,0x0)/USB(1,0)/USB(6,0)/HD(1,MBR,0x6b8b4567,0xa30,0x1e84)..BO

**#** efibootmgr -o 0000,0001
BootCurrent: 0001
Timeout: 2 seconds
BootOrder: 0000,0001
Boot0000* opensuse
Boot0001* UEFI: Ut165 USB2FlashStorage0.00

**#** efibootmgr -v
BootCurrent: 0001
Timeout: 2 seconds
BootOrder: 0000,0001
Boot0000* opensuse      HD(1,GPT,50236b58-6bf6-4681-9666-03383a34889b,0x800,0x80000)/File(\EFI\opensuse\grubx64.efi)
Boot0001* UEFI: Ut165 USB2FlashStorage0.00      PciRoot(0x0)/Pci(0x1d,0x0)/USB(1,0)/USB(6,0)/HD(1,MBR,0x6b8b4567,0xa30,0x1e84)..BO

Will reboot to see if anything has changed.

Yes, that shows that it is properly configured as the EFI partition (or EFI SYSTEM PARTITION, hence ESP).