Solved how to boot with messed up /boot/loader.conf ?

meine

Member

Reaction score: 35
Messages: 82

Hi,

I messed up my /boot/loader.conf by adding 'vesa_load="YES"' without installing the VESA files first -- n00b mistake...

The FreeBSD boot menu has an option to choose

6. Configure Boot Options...
...
2. Load System Defaults

I presume this option boots only with /boot/defaults/loader.conf and skips the user-tweaked /boot/loader.conf

However, the option 'System Defaults' also results in a panic message.

Checking with more /boot/defaults/loader.conf through '3. Escape to loader prompt' reveals that the default file in FreeBSD 11.1 has a line where /boot/loader.conf is loaded.

My question is how I can boot my box skipping that VESA line in /boot/loader.conf or the entire file

(I promise, I'll never do this again...)

TIA
 

Snurg

Aspiring Daemon

Reaction score: 330
Messages: 793

You probably have to boot from rescue medium, mount the root filesystem and reverse that edit.

I had a similar problem recently, and when investigating this, it turned out that this is not straightforward on FreeBSD, because the developers decided to flag the root filesystem as "unmountable".

Thus there are some additional steps involved to make the computer able to mount the root filesystem manually.
See these threads for more information:
Trying to access root directory of another system's root disk
Is there a way to turn on canmount property for root volumes?

P.S.: The VESA driver is bugged and causes a number of problems, especially for NVIDIA users.
For this reason I always build a custom kernel to get rid of it.
 
Last edited by a moderator:

Datapanic

Well-Known Member

Reaction score: 172
Messages: 354

Boot up the system, press any key to get to the OK prompt, then type:

disable-module vesa

Type "boot" to continue, then you can login and fix /boot/loader.conf
 
OP
OP
meine

meine

Member

Reaction score: 35
Messages: 82

Boot up the system, press any key to get to the OK prompt, then type:

disable-module vesa

Type "boot" to continue, then you can login and fix /boot/loader.conf
TNX! did the job and I was able to comment the line in /boot/loader.conf

great that there is a way to keep booting when a not-yet-superuser messes up ;-)
 
OP
OP
meine

meine

Member

Reaction score: 35
Messages: 82

P.S.: The VESA driver is bugged and causes a number of problems, especially for NVIDIA users.
For this reason I always build a custom kernel to get rid of it.
OK, TNX.

This means that I have to look further to use console with preferably 1600x900 without using NVidia. In Fedora Linux I was lucky to get a very good 'nouveau' driver instead, but otherwise NVidia is a real PITA...

I'll look and perhaps start another tread on a high(er) resolution console without using NVidia -- suggestions welcome!
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,183
Messages: 29,471

In Fedora Linux I was lucky to get a very good 'nouveau' driver instead, but otherwise NVidia is a real PITA...
Neither driver has anything to do with the console resolution.
 

mcochris

New Member

Reaction score: 1
Messages: 6

On FreeBSD 12.0 RELEASE, here's what worked for me:

1 - press the ESC key at the boot menu to get the loader prompt
2 - at the OK prompt, type set module_blacklist="vesa"
3 - at the OK prompt, type boot
4 - Once in multi-user model, edit /boot/loader.conf (or /boot/loader.conf.local) to fix the problem

This may work for other kernel modules that hang your boot process.

You may want to check the contents of the module_blacklist variable from the OK prompt (via the show command) to see what other modules are disabled. You can add them to the blacklist if necessary ( set module_blacklist="vesa drm")

I'd hoped that removing /boot/loader.conf.local from the "loader_conf_files" variable (loader.conf(5)) would change the boot process, but that didn't seem to have any effect.
 
Top