# loader.conf messed up with nvidia-modeset_load="YES" on encrypted zfs FreeBSD 13.0 stable system fresh install



## dahikino (Jun 30, 2021)

Hello,

I can't boot anymore, the boot hang on loading nvidia driver because of the loader.conf messed up.

My system is encrypted just installed yesterday, how i can have access to loader.conf and remove this fucking line avec nivida... ?

in boot, line command, i don't see how to boot with minimal module loaded and have access 

if you have a idea !

Thanks
Best regards
Dahikino.


----------



## mer (Jun 30, 2021)

If you have a device with a rescue image you may be able to import the pool and then navigate or mount the installed pool (zroot) and navigate down to the dataset:  it's probably named something like zroot/ROOT/default
When you import make sure you do with a -o altroot so you don't try and mount over the rescue image


----------



## dahikino (Jun 30, 2021)

but even encrypted, i can have access to the pool ?


----------



## Alain De Vos (Jun 30, 2021)

Is it necessary to put it in loader.conf or can you put also in rc.conf instead which is a better choice.


----------



## dahikino (Jun 30, 2021)

My problem now is to have access to the file loader.conf to modify it, i can't boot, it is hanging just at loading module process during boot, with error :
EFI framebuffer information :
     efi_check_space : Unable to expand staging area !


----------



## mer (Jun 30, 2021)

You want the drm/video drivers in /etc/rc.conf in the kld_list variable.

dahikino I don't know the answer to that. I've not done any encrypted root installs (no need to), so I may be speculating here.  I'm assuming the install was "Native ZFS Encryption" not GELI or GBDE?  Did you reboot the system before you added the line to loader.conf?  If so, did it ask for a passphrase?  If it did, when you import it into the rescue image, it may ask there.  If it does, you should be able to get to things.  If not, I'm out of ideas except "prepare for an install and don't do that again" is all I can offer.


----------



## mer (Jun 30, 2021)

dahikino said:


> My problem now is to have access to the file loader.conf to modify it, i can't boot, it is hanging just at loading module process during boot, with error :
> EFI framebuffer information :
> efi_check_space : Unable to expand staging area !


I'm out of my knowledge base here, you may wind up at simply reinstalling.


----------



## Alain De Vos (Jun 30, 2021)

There is a trick to unload and load the kernel and to boot. And then mount the filesystem in read/write , no ?


----------



## Fuzzbox (Jun 30, 2021)

Alain De Vos said:


> There is a trick to unload and load the kernel and to boot. And then mount the filesystem in read/write , no ?



This post ?


----------



## Alain De Vos (Jun 30, 2021)

That's it. And it works on my pc.


----------



## dahikino (Jul 1, 2021)

Fuzzbox said:


> This post ?


i did try yesterday evening, but i don't know via mountroot which is the the name of the root partition, ada0.., da0... etc... i did try with zfs:zroot/ROOT/default but i had a error : zfs:zroot/ROOT/default failed with error 2: unknown file system
i don't understand why because i used the standard install with memstick 13.0 stable with default zfs encryption settings !


----------



## T-Daemon (Jul 1, 2021)

The guide from the link seems not to work with root-on-ZFS.

To get still access to file /boot/loader.conf in geli(8) encrypted pool:

Boot a FreeBSD installer image
Enter passphrase
Enter "Shell" or "Live CD"
Attach encrypted ZFS partition (assuming ada0p2)


```
geli attach ada0p2                # enter passphrase
mkdir /tmp/a
zpool import -R /tmp/a zroot
zfs mount zroot/ROOT/default
ee /tmp/a/boot/loader.conf        # remove nvidia-modeset
zpool export zroot
poweroff
```
Remove installer image, boot system.


----------



## T-Daemon (Jul 2, 2021)

Alternatively, instead of booting a FreeBSD installer image to edit /boot/loader.conf, boot affected system, drop to loader prompt, load only necessary kernel modules, boot into single user mode, mount file sytem read/write.


T-Daemon said:


> The guide from the link seems not to work with root-on-ZFS.


System 13.0-RELEASE, for root-on-ZFS execute at the loader prompt:

```
OK  load boot/kernel/kernel -s
OK  load boot/kernel/zfs.ko
# when geli(8) encrypted root-on-ZFS
OK  load boot/kernel/geom_eli.ko
OK  boot
```

In case someone doesn't know how to mount the pool read/write from single user mode to edit file /boot/loader.conf:

```
zfs set readonly=off zroot/ROOT/default     # replace pool name 'zroot' if differs
```


----------

