# efi_check_space: Unable to expand staging area



## riesebie (May 6, 2021)

Hi all,
after installing FreeBSD 13 everything went fine. Once I put `nvidia_load="YES"` into /boot/loader.conf I get `efi_check_space: Unable to expand staging area` and the machine stops booting (frozen). Any help would be much aprreciated.
Thanks in advance


----------



## SirDice (May 6, 2021)

Put that NVidia kernel mode in `kld_list` in rc.conf. You should really only add modules to loader.conf if they're required for booting the machine (the NVidia module isn't). And with a modern NVidia card you likely need to load nvidia-modeset instead.


----------



## riesebie (May 6, 2021)

Thanks, will do. But how can I boot the machine now?


----------



## SirDice (May 6, 2021)

Is this a ZFS or UFS install? Either way, you should be able to boot from the install media, choose the "Shell" option, then import and/or mount the filesystem from the machine so you can modify it.


----------



## riesebie (May 6, 2021)

It is a ZFS install. I booted the "Shell" option and got a ro filesystem. I tried to import my zpool via `zpool import -R /mnt zroot` but can't edit nor find /boot/loader.conf


----------



## SirDice (May 6, 2021)

When you import a pool none of its filesystem will be mounted. Look for zroot/ROOT/default, that contains the 'root' filesystem (which includes /boot). Mount that, `zfs mount zroot/ROOT/default`. Then you should be able to access /mnt/boot/loader.conf.


----------



## Profighost (May 25, 2021)

I had the exact same problem. Thanks for clearing that up.
Point is, while make install the NVIDIA-driver writes the stuff in the /boot/loader.conf by itself:

```
nvidia_load="YES"
nvidia_name="nvidia"
nvidia_modeset_load="YES"
nvidia_modeset_name="nvidia-modeset"
```
hence the issue of this thread.

Also helpful to anyone else landing here having the same problem maybe another thread of this forum:
rc.conf kld_list delimiter


----------



## SirDice (May 27, 2021)

Profighost said:


> while make install the NVIDIA-driver writes the stuff in the /boot/loader.conf by itself:


Only if you use the driver from the NVidia website itself. Which you shouldn't be using, use x11/nvidia-driver (it's the exact same driver but installs in a FreeBSD proper way). The "problem" with the NVidia driver installer is that it also replaces/overwrites a couple of X11 libraries and does a few other unwanted things. Besides that, if you install the port/package then you can more easily keep track of it (updates).


----------



## Profighost (May 27, 2021)

That's what I did: The driver from NVIDIA's website - _you always shall use the most current driver available_...*sigh*
...I'll keep that in mind... especially this "unwanted things" stuff...
Thanks for your valuable tipps


----------



## jb_fvwm2 (Jul 7, 2021)

A line loading nvidia-modeset.ko in a v12 > v13 upgrade was a showstopper here.  Glad to find this thread right away. I also had a v13 `nvidia.ko` to copy into the frozen-boot system to even get that
far, since the `installworld` left the v12 one in place.
.................
I'll have the line-removed-from loader.conf fix tested within  a few hours from now on the otherwise-fully upgraded [ except for `etcupdate -B` system.
...............
BTW Re: etcupdate. I found the manual unclear, or maybe just me:
DESCRIPTION:   ambiguous
DEFAULT MODE:  half-ambiguous
  except the last paragraph
BUILD MODE :  ambiguous
DIFF MODE: unclear
RESOLVE MODE:  I think this could have used paragraphs rather
   than sentences for each item listed herein.
Posting here cause I don't think I'll ever become learned enough to 
  rewrite it, lack of time and expertise both.


----------



## Eridanos (Aug 11, 2021)

I am in the "Shell" option of install media, but cannot see any ZFS pool via zpool status to import or mount. Could it be because of GELI encryption ?


----------



## Vull (Aug 11, 2021)

Eridanos said:


> I am in the "Shell" option of install media, but cannot see any ZFS pool via zpool status to import or mount. Could it be because of GELI encryption ?


Did you try `zpool import` or `zfs get mountpoint,canmount zroot`? Please refer to this post -- following ShelLuser's advice worked for me, but is a bit complicated to explain. There is not a single easy answer.

Also it doesn't mention this, but I suggest executing `zfs unmount` to get a clean unmount before rebooting. Also zfs(8) and zpool(8) are well worth a read.


----------



## Eridanos (Aug 11, 2021)

It was GELI encryption at the end. I had to decrypt all drives as a first step - ZFS RAID10 and then to import & mount as below. 

geli attach /dev/gpt/zfs0
geli attach /dev/gpt/zfs1
geli attach /dev/gpt/zfs2
geli attach /dev/gpt/zfs3
zpool import -o altroot=/mnt zroot
zfs mount zroot/ROOT/default

Once done I could remove  nvidia_load="YES" and nvidia-modset_load="YES" from /boot/loader.conf. 
After that I added kld_list="nvidia-modeset" into /etc/rc.conf as mentioned in the driver's manual and it works now.


----------



## grahamperrin@ (Aug 15, 2021)

Eridanos said:


> `zpool import -o altroot=/mnt zroot`



Also, according to zpool-import(8):


```
-R root
                     Sets the cachefile property to none and the altroot
                     property to root.
```


----------

