LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   EFI partition (https://www.linuxquestions.org/questions/slackware-14/efi-partition-4175699303/)

Toutatis 08-18-2021 01:02 AM

EFI partition
 
I have a new installation of slackware64-current with elilo boot loader.
So there is a FAT efi partition, which is in fstab

Quote:

/dev/sdb1 /boot/efi vfat defaults 1 0
(this comes from the installation process).

I see this message at boot:

Quote:

[ 10.875319] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
Is it harmful ?

teoberi 08-18-2021 01:33 AM

Depends!
You can try this:
Code:

umount /boot/efi
fsck.vfat /dev/sdb1

If errors occur, correct them.
Mount the partition with command:
Code:

mount -t vfat /dev/sdb1 /boot/efi

Toutatis 08-18-2021 01:47 AM

fsck.vfat /dev/sdb1 gives

Quote:

fsck.fat 4.2 (2021-01-31)
There are differences between boot sector and its backup.
This is mostly harmless. Differences: (offset:original/backup)
65:01/00
1) Copy original to backup
2) Copy backup to original
3) No action
I choose 3)

teoberi 08-18-2021 01:51 AM

You can also choose 1) and check again for fsck errors.

hazel 08-18-2021 05:33 AM

On my machine, the ESP doesn't like being unmounted by the general shutdown umount -a. It develops that "error" as a result. After correcting it, I suggest that you don't mount that partition automatically, only when you need it, and then unmount by hand. But if anyone can tell me why this makes a difference, I'd love to know.

teoberi 08-18-2021 05:38 AM

Same situation!
I would love to know too!:)

garpu 08-18-2021 08:24 AM

That partition is just finicky. I've seen that message (and been able to clean it with fsck) after power outages. (Yeah, I know, I should be on a UPS.)

Jeebizz 08-18-2021 08:40 AM

Wait it is not unmounting when you restart? I thought this was addressed as I noticed similar behavior awhile back. :scratch:

hazel 08-18-2021 08:41 AM

Maybe there's something slightly dicky with the kernel's vfat driver. I assume that any driver for a proprietary filesystem has to depend on occasional guesswork.

Aeterna 08-18-2021 11:01 AM

unmount /boot/efi
1) umount /boot/efi

2) run
fsck.vfat -n /dev/device_name
to check for errors

3) next run
fsck.vfat -a /dev/device_name
to fix vfat errors

4) edit /etc/fstab
comment out the reference to boot (EFI) partition

5) never see errors again

6) Mount /boot/efi partition before upgrading kernel

Chuck56 08-18-2021 12:45 PM

Quote:

Originally Posted by Aeterna (Post 6276407)
...
4) edit /etc/fstab
comment out the reference to boot (EFI) partition
...

instead of removal, just add "noauto" to the fstab entry...
Code:

UUID=SC56-2X5Y  /boot/efi  vfat  defaults,noauto  1  0
Enjoy!

Aeterna 08-18-2021 12:50 PM

Quote:

Originally Posted by Chuck56 (Post 6276444)
instead of removal, just add "noauto" to the fstab entry...
Code:

UUID=SC56-2X5Y  /boot/efi  vfat  defaults,noauto  1  0
Enjoy!

comment out: #
not the same as removal. Removing from fstab would be quite inconvenient.

whichever way: both works

enorbet 08-18-2021 04:07 PM

Wouldn't it be great if EFI would alter standards to accommodate other file systems?... even ext2. Isn't it just like Microsoft to require SecurBoot but have an insecure file system as the most fundamental component excepting BIOS/UEFI?

Jeebizz 08-18-2021 04:21 PM

Quote:

Originally Posted by enorbet (Post 6276508)
Wouldn't it be great if EFI would alter standards to accommodate other file systems?... even ext2. Isn't it just like Microsoft to require SecurBoot but have an insecure file system as the most fundamental component excepting BIOS/UEFI?

Why is there even a partition at all? Why can't the firmware boot (EFI), like legacy BIOS. Of course on the other hand, I do have a separate /boot partition , but only because you can't boot / install lilo on XFS, so thats kinda different though (plus I am not using UEFI but legacy). Then again I don't know all the specifications of UEFI, and I guess somehow fat32 is considered "universal" these days, but even I myself had questions about this when it was introduced, since this brings back the old days of pre- NT days of Windows when you only had fat 12/16/32 to work with and any sort of improper shutdown (power loss), would result in constant errors and waiting for scandisk. We seem to have, reverted/returned/regressed to that period in time.

hazel 08-19-2021 05:18 AM

All the usb keys that you buy are formatted fat32 so any OS has to be able to read that format. I guess it really is universal.

GazL 08-19-2021 05:39 AM

I like to mount my /boot/efi with ro and sync.
Code:

LABEL="SYSTEM"      /boot/efi      vfat    defaults,ro,sync        0  0
Then, when I update it, I flip it 'rw' and back.
Code:

mount -o remount,rw /boot/efi
cp vmlinuz initrd.gz /boot/efi/EFI/Slackware && sync
mount -o remount,ro /boot/efi

Possibly overkill, but it works for me.

Didier Spaier 08-19-2021 06:22 AM

Quote:

Originally Posted by GazL (Post 6276663)
I like to mount my /boot/efi with ro and sync.
Code:

LABEL="SYSTEM"      /boot/efi      vfat    defaults,ro,sync        0  0
Then, when I update it, I flip it 'rw' and back.
Code:

mount -o remount,rw /boot/efi
cp vmlinuz initrd.gz /boot/efi/EFI/Slackware && sync
mount -o remount,ro /boot/efi

Possibly overkill, but it works for me.

As an aside, if using GRUB you would only need to write in the ESP once after OS installation, to put there the OS loader, the kernels and initrds being referred to in /boot/grub/grub.cfg, which can be read by the OS loader as it is able to access many file systems outside of the ESP, including the one used for /boot, which also allows it to load the initrds and kernels stored in /boot.

Then, you won't need to mount the ESP anymore: neither ro nor rw.

Also, if another OS using GRUB is already installed when you install Slackware you won't even need to install a specific OS loader and set up an ESP for Slackware, as running as root from this OS after Slackware installation the command below will add boot entries for Slackware in GRUB's boot menu[1]:
Code:

grub-mkconfig -o /boot/grub/grub.cfg
[1]for the generic kernel, if os-prober is enabled for the other OS and Slackware's initrd is symlinked to or renamed initrd-generic-<kernel version>

enorbet 08-19-2021 09:25 AM

Quote:

Originally Posted by hazel (Post 6276654)
All the usb keys that you buy are formatted fat32 so any OS has to be able to read that format. I guess it really is universal.

True but IMHO that just emphasizes how much more important it is to update file systems than such things as BIOS/UEFI with the likes of SecureBoot. That's like turning a firehose on a candle while the rest of the house is in flames.

walecha 08-20-2021 02:13 AM

Like Didier, I'm also using grub, so I don't have to mount ESP on boot.

rkelsen 08-20-2021 07:06 PM

Quote:

Originally Posted by walecha (Post 6276988)
Like Didier, I'm also using grub, so I don't have to mount ESP on boot.

Fwiw, I use eLilo and I keep the ESP unmounted until I wish to add a kernel. I do this by adding the "noauto" option to fstab.

Haven't figured out how to use grub yet, but I appreciate that it can do things which eLilo can't... That's mainly because I've never been in a situation where eLilo doesn't work. Ain't nobody got time to figure out how to read grub's config files.


All times are GMT -5. The time now is 03:01 AM.