# [pls help] cannot load kernel



## rx_b10 (Mar 4, 2009)

hi all, i am newbie pls help 






i upgrade my FreeBSD7.1, i add some gnome component and 
after that i restart. then appear this error 


how to fix my kernel ? 



thx u all


----------



## ale (Mar 4, 2009)

Try typing

```
unload kernel
boot /boot/kernel.old/kernel
```


----------



## mickey (Mar 4, 2009)

You may try the following at the loader prompt:


```
boot /boot/kernel/kernel
```

if that fails, try:


```
boot /boot/kernel.old/kernel
```

If this still does not succeed, try this:

Boot your system off a 7.1-RELEASE CD
Enter the "fixit" mode
Mount the harddisk partition containing your root filesystem (and the /boot directory with your kernel)
See what's wrong with the kernel on your harddisk
See if there is another kernel you could possibly boot (kernel.GENERIC, etc)
Eventually copy over the GENERIC kernel from the CD to your HD.
Try booting from your harddisk again using the kernel you found/restored from CD.


----------



## rx_b10 (Mar 4, 2009)

mickey said:
			
		

> You may try the following at the loader prompt:
> 
> 
> ```
> ...




thx all for reply, 

i try 

```
boot /boot/kernel.prev
```

this is working, how to copy kernel.prev to kernel ??? 

i install freebsd to learn C++ program. so i want xwindow. after i add a gnome packet. i want when i type STARTX, gnome desktop will show. but another window appear like this ??? 





what should i do to make i login to gnome desktop ???

thx u


----------



## SirDice (Mar 4, 2009)

Edit ~/.xinitrc:


```
exec gnome-session
```

That greenish stuff is the default TWM window manager.


----------



## mickey (Mar 4, 2009)

rx_b10 said:
			
		

> this is working, how to copy kernel.prev to kernel ???



Try this:


```
cd /boot/kernel.prev
tar -cf - . | (cd ../kernel; tar -vxpf -)
```



			
				rx_b10 said:
			
		

> what should i do to make i login to gnome desktop ???



If you have installed the full gnome2 package, then you should have gdm, the graphical gnome login. To enable it, add the following line to the file /etc/rc.conf:


```
gnome_enable="YES"
```

Thereafter you should reboot the machine, and when it comes back up, you should see a graphical login window appearing.


----------



## SirDice (Mar 4, 2009)

If you use GDM or XDM, you will need to put that "exec gnome-session" in ~/.xsession instead of ~/.xinitrc.


----------



## mickey (Mar 4, 2009)

SirDice said:
			
		

> If you use GDM or XDM, you will need to put that "exec gnome-session" in ~/.xsession instead of ~/.xinitrc.



This holds true only for XDM. When using GDM, there is no need to have .xinitrc nor .xsession files. The system wide gdm setup will do just the right thing.

Despite this, using xdm to log into gnome is not preferable, as xdm as of yet has no console-kit support.


----------



## SirDice (Mar 4, 2009)

mickey said:
			
		

> This holds true only for XDM. When using GDM, there is no need to have .xinitrc nor .xsession files. The system wide gdm setup will do just the right thing.


Ah.. I never use either :e GDM however did in the past?


----------



## ale (Mar 4, 2009)

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x11-wm.html
but I would suggest you to read also the other chapters.


----------



## rx_b10 (Mar 5, 2009)

mickey said:
			
		

> Try this:
> 
> 
> ```
> ...



i've try but there some error "cannot write in some file" 

now i am trying to install my FreeBSD again... 

thx u all for reply if i've a question. i'll ask again


----------



## mickey (Mar 5, 2009)

rx_b10 said:
			
		

> i've try but there some error "cannot write in some file"



Then I guess the target directory (/boot/kernel) was not empty, causing tar to complain.


----------



## rx_b10 (Mar 6, 2009)

hi all, i've reinstall FreeBSD 

and i've enable gdm_enable = "YES" 

thx for reply this forum very helpfull


----------

