# Fix system



## sk8harddiefast (Jul 11, 2010)

I made a change on /boot/loader.conf and now kernel don't want to boot!
How can i mount my filesystem from Freebsd cd and use fixit to remove the line from /boot/loader.conf?


----------



## Beastie (Jul 11, 2010)

Have you tried single-user mode?

If you know the device node of the root partition (e.g. /dev/ad0s1a), you can mount it on any available directory (e.g. /mnt?) then you use the absolute path of your favorite editor to change the line. I don't remember exact paths, just browse the disc a little bit. 

And double-check with the defaults in /boot/defaults/loader.conf.


----------



## sk8harddiefast (Jul 11, 2010)

Single user mode don't work.
From cd don't let me to mount nothing.
Operation not permitted


----------



## phoenix (Jul 11, 2010)

If you know which loader.conf entry is causing the problem, then select 6 (Drop to loader prompt) from the boot menu, and type *unset bad.option.name*

You can see all the loader tunables via *show*.

Once you have the bad option removed, you can boot normally (type *boot*), then edit the file on disk.


----------



## sk8harddiefast (Jul 11, 2010)

My bad option is not there.
I put on /boot/loader.conf a module that kernel cannot recognise it. So hangs and is rebooting when come the time to load this module.
I see /boot/loader.conf but how can i remove option witch is inside the file?


----------



## jalla (Jul 12, 2010)

boot from the fixit cd
mount your normal root partition somewhere (like /mnt)
edit /mnt/boot/loader.conf


----------



## sk8harddiefast (Jul 12, 2010)

is not letting me to mnt it. Is telling me Operation not permitted


----------



## adamk (Jul 12, 2010)

At the boot loader prompt, type 'unload' and it will unload all modules and the kernel.  Then 'load /boot/kernel/kernel' .  Then boot.

Adam


----------



## Keith (Jul 12, 2010)

If you put a basic install on another disk and boot from it.  the mount the bad disk as a usb moun.  then fix it.  ... when push comes to shove!


----------



## jalla (Jul 12, 2010)

sk8harddiefast said:
			
		

> is not letting me to mnt it. Is telling me Operation not permitted



That would happen if your filesystem is dirty. fsck first and then mount.


----------



## Beastie (Jul 12, 2010)

sk8harddiefast said:
			
		

> Single user mode don't work.
> From cd don't let me to mount nothing.
> Operation not permitted


What do you mean single-user mode doesn't work? What does it say?

To check and mount partitions enter the following:

```
fsck -y
mount -u /
mount -a -t ufs
```


----------



## sk8harddiefast (Jul 12, 2010)

Maybe was my fault. Now Single user mode worked


> fsck -y
> mount -u /
> mount -a -t ufs


Also worked, i delete this line and now i back on my system 
Thanks all of you for your responses.


----------



## jgh@ (Jul 12, 2010)

sk8harddiefast said:
			
		

> Maybe was my fault. Now Single user mode worked
> 
> Also worked, i delete this line and now i back on my system
> Thanks all of you for your responses.



You didn't need to do any of this, actually.

You could've gone to the loader prompt.

loader> unload (this unloads the kernel, and any modules that were loaded with it with /boot/loader.conf)
loader> load /boot/kernel/kernel
loader> load /boot/kernel/<a module file> (load any necessary modules to boot (ie. scsi, something else) )
loader> boot

This will boot your system and you could freely edit /boot/loader.conf.


----------



## sk8harddiefast (Jul 13, 2010)

Just i was a little afraid to do this because i listen for kernel and modules unloading but i was not knowing that only delete all the lines inside /boot/loader.conf


----------

