unload
the kernel and run boot /boot/kernel/kernel -s
(the -s will cause it to boot to single user mode). The boot
command will only load the kernel, no additional modules. In single user mode you can modify your loader.conf and remove the offending kernel module. Then just reboot. boot
boot kernelname [...]
boot -flag ...
Immediately proceeds to bootstrap the system, loading the kernel
if necessary. Any flags or arguments are passed to the kernel,
but they must precede the kernel name, if a kernel name is
provided.
WARNING: The behavior of this builtin is changed if loader.4th(8)
is loaded.
...
unload Remove all modules from memory.
I used sysrc kld_list+="amdgpu" to add it. I think it adds to the loader.conf as you wrote. I booted, but now I got something called mountroot> I have no idea how to mount the root file system manually. It is ZFS, but if I write the zfs:zroot/ROOT/default from the examples, it does not work.If it's a kernel module loaded through loader.conf that's causing panics you won't be able to boot to single user mode either.
Drop to the loader prompt. Thenunload
the kernel and runboot /boot/kernel/kernel -s
(the -s will cause it to boot to single user mode). Theboot
command will only load the kernel, no additional modules. In single user mode you can modify your loader.conf and remove the offending kernel module. Then just reboot.
From loader(8).Code:boot boot kernelname [...] boot -flag ... Immediately proceeds to bootstrap the system, loading the kernel if necessary. Any flags or arguments are passed to the kernel, but they must precede the kernel name, if a kernel name is provided. WARNING: The behavior of this builtin is changed if loader.4th(8) is loaded. ... unload Remove all modules from memory.
Looks like it boots in single user mode and it is in the rc.conf. Thanks!Boot single user (it's in the boot menu), start the standard shell, set your root fs to rw (depends on which fs you use) and edit /etc/rc.conf
I cannot remount it in rw, I triedBoot single user (it's in the boot menu), start the standard shell, set your root fs to rw (depends on which fs you use) and edit /etc/rc.conf
mount -o rw,remount /
but it writes that unknown special file or filesystem.The remount option doesn't exist on FreeBSD, that's a Linux mount option. Besides that, this is not how ZFS filesystems are mounted. It'sIt works now withmount -o rw,remount zfs:zroot/ROOT/default
zfs set readonly=off zroot/ROOT/default
. If there are other ZFS filesystems that need to be mounted (in single user mode only the root filesystem is mounted); zfs mount -a
Still it worked somehow.The remount option doesn't exist on FreeBSD, that's a Linux mount option. Besides that, this is not how ZFS filesystems are mounted. It'szfs set readonly=off zroot/ROOT/default
. If there are other ZFS filesystems that need mounted (in single user mode only the root filesystem is mounted);zfs mount -a
I run into this again and now it did not work. As if "mount" would not recognize ZFS. I had the same when I booted with "boot /boot/kernel/kernel -s" and tried to mount it. Now I realize that in that case ZFS kernel module was not loaded and that's why it failed to mount root. In this case I booted single user mode from the boot menu and it wrote the same. The system was slightly different 12.2-RELEASE in this time and 12.2-STABLE the previous time when mount worked. The "zfs set readonly=off zroot/ROOT/default" you suggested worked just fine.The remount option doesn't exist on FreeBSD, that's a Linux mount option. Besides that, this is not how ZFS filesystems are mounted. It'szfs set readonly=off zroot/ROOT/default
. If there are other ZFS filesystems that need to be mounted (in single user mode only the root filesystem is mounted);zfs mount -a
loader.4th
load
ed, but this seems to happen by default. At least I didn’t have to do anything in that regard.)show
. This will produce a list of variables.module_blacklist
. Quit the pager right there, so that you have a reference.set
command (i.e., re-type the original value and append the extra modules). For instance, if I wanted to blacklist nvidia
and nvidia-modeset
, I’d use set
like this:set module_blacklist='some previously present modules nvidia nvidia-modeset'
boot
command (wihtout any arguments)./boot/loader.conf
to prevent whatever was causing trouble from loading again. (You can also uninstall the module if it’s in a package.)/boot/loader.conf
on another system. But that might be complicated (e.g. with certain VM disk setups or on bare metal or if you dream about opening GELI on Linux).For the future reference (man mount):It works now withmount -o rw,remount zfs:zroot/ROOT/default
-u The -u flag indicates that the status of an already mounted file
system should be changed. Any of the options discussed above
(the -o option) may be changed; also a file system can be changed
from read-only to read-write or vice versa. An attempt to change
from read-write to read-only will fail if any files on the file
system are currently open for writing unless the -f flag is also
specified. The set of options is determined by applying the
options specified in the argument to -o and finally applying the
-r or -w option.
mount -uw $filesystem
to make it rw and mount -ur $filesystem
to make it ro.Why not. Just in some situations it will tell you something like "mount: the system is busy".When in single user mode. I use mount -fuo rw /
mount -uw/-ur
will just do it. Because it doesn't "remount", it changes the status "of an already mounted file system".