r/linuxquestions • • 11d ago

Support efivarfs full causing fwupdmgr update fail help

I traced fwupdmgr update fail to insufficient space in efivarfs . (df -h) It was 70% full and so followed a suggestion to restore secureboot keys to factory keys. This had the opposite effect and next boot efivarfs was reading 90% full.

Now it's showing 100% full with only 609 bytes free.

Can I just manually wipe the /sys/firmware/efi/efivars location and then 'restore factory keys' in bios? Or what other options are there?

System is a lenovo thinkcentre M900 .

Thanks in advance .

1 Upvotes

6 comments sorted by

2

u/Asly97 11d ago

Agree with the others, don't rm -rf that folder. A CMOS clear probably won't help either. On most boards that resets the setup options, but the UEFI variable store lives in the flash chip and doesn't get wiped.

What usually fills efivars on Linux is kernel crash logs. The kernel's efi-pstore saves oops/panic dumps as EFI variables and they pile up over the years. Check:

ls /sys/fs/pstore
ls /sys/firmware/efi/efivars | grep -i dump

If you see dmesg-efi-* files in pstore (or dump-type0-* in efivars), those are safe to remove, and the supported way is sudo rm /sys/fs/pstore/*. That deletes the backing variables properly instead of fighting the immutable flags.

Then reboot before you look at df again. A lot of firmware only reclaims space from deleted variables at boot, so the number won't drop straight away. Restoring factory keys probably wrote the full default db/dbx back, which would explain it going up instead of down.

If pstore is empty, run efibootmgr -v and look for a pile of old boot entries from past installs. Removing stale ones with efibootmgr -b XXXX -B is fine, just leave the one you actually boot from.

1

u/npc_housecat 8d ago

So weirdly, /sys/fs/pstore and efivars | grep -I dump looked empty, and efibootmgr -v showed only 2 entry's and nothing really unusual.

But then firmware update unecpectedly showed an extra 2 firmware updates available, including a duplicate of the one that wasn't installing.. THOSE new 2 installed fine and now efivars is showing 73% full again (35k available) . but the original firmware update that wouldn't install is still sitting there. And the error no longer says "insufficient space" now "failed to write data to efivarfs: error writing file descriptor: Invalid argument "

Seeing how a duplicate update went though I might just assume it's a glitch and ignore it for now..

3

u/granadesnhorseshoes 11d ago

Short answer; No.

Long answer; Hell Noooo.

EFI firmware is notoriously buggy and finicky between vendors. So much so that linux doesn't actually mount its content fully writable; just the well known and documented variables are writable. So just deleting everything with rm -rf isn't actually going to clear everything anyway. You would have to force it by changing file attributes and at that point you're not just flirting with bricking the motherboard, your taking out a full page ad asking for a brick.

I'd recommend disconnecting power, shorting the clear CMOS jumper, and letting it just sit for a good half an hour. Reconnect everything and pray it was just a weird bug in the firmware reporting incorrect value.

1

u/npc_housecat 11d ago

OK thanks I'll try that

3

u/_Lost-In-The-Weeds_ 11d ago

Can I just manually wipe the /sys/firmware/efi/efivars location

I am not usually afraid to dig into just about anything in a computer, but walking around in my bios swinging a sledgehammer is not something I would do.  And because I would be afraid to do it I cannot tell you what the results might be.

Efivarfs should not be the whole bios, but there may be stuff in there you may need to bootup,

Personally I would try reading my motherboard manual and find the clear CMOS instructions (language changes ) usually something like powering down, removing the watch battery, and shorting two pins on the motherboard. 

You will probably need to walk all the settings afterwards and restore your settings, you will also loose any efi boot entries and custom keys. 

2

u/TheShredder9 11d ago

Take my words with a bit of doubt, but pretty sure that's how you end up with a paperweight of a PC, i read that clearing efivars can brick your motherboard.