# FYI: Kernel crash and no old kernel available



## eyebone (Apr 26, 2010)

hej folks,

after several years using freebsd i had my first(lucky me ehh??) kernel which wasn't booting my system(kernel traps in a loop). no problem i thought, as i knew kernel.old should be created on every new kernelinstall via:


```
cd /usr/src; make installkernel KERNCONF=mykernel
```

but, kernel.old is not created on the destination folder if you use


```
cd /usr/src; make installkernel KERNCONF=mykernel DESTDIR=/mnt/bootdevice
```

in this case the kernel at bootdevice is just overwritten. just to let you know, to create a backup of your working kernel before overwritting it 

(maybe this is common knowledge or i misunderstood something, please enlighten me in this case :stud)

best regards,


----------



## phoenix (Apr 26, 2010)

This is why you should always install to a new directory (use *KODIR=/boot/kernel.new* and not DESTDIR), and use nextboot() to tell the loader to use the new kernel for 1 reboot only.

If that kernel fails for any reason, just reboot, and the loader will use /boot/kernel as per normal.  

If the new kernel works, then just `# mv /boot/kernel /boot/kernel.old; mv /boot/kernel.new /boot/kernel`.


----------



## eyebone (Apr 27, 2010)

phoenix said:
			
		

> This is why you should always install to a new directory (use *KODIR=/boot/kernel.new* and not DESTDIR), and use nextboot() to tell the loader to use the new kernel for 1 reboot only.



nice, i never recognized KODIR and nextboot, thx phoenix


----------

