Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Dec 2001 13:17:28 +0100
From:      Nils Holland <nils@tisys.org>
To:        =?iso-8859-1?Q?Jos=E9_Romildo_Malaquias?= <romildo@uber.com.br>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Restoring the original kernel
Message-ID:  <20011230131728.A2286@tisys.org>
In-Reply-To: <3C2F010B.54244A87@uber.com.br>; from romildo@uber.com.br on Sun, Dec 30, 2001 at 09:56:59AM -0200
References:  <3C2F010B.54244A87@uber.com.br>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Dec 30, 2001 at 09:56:59AM -0200, José Romildo Malaquias stood up and spoke:
> Hello.
> 
> Being a new FreeBSD user, I do not know how to restore the original
> kernel
> of my system. I have recompiled the kernel and have the following
> entries
> in the root file system:
> 
> -r-xr-xr-x    1 root     root      2558475 Nov 23 15:10 /freebsd/kernel*
> 
> -r-xr-xr-x    1 root     root      3559066 Sep 18 15:57
> /freebsd/kernel.GENERIC*
> -rwxr-xr-x    1 root     root      2553628 Nov 23 13:55
> /freebsd/kernel.old*
> drwxr-xr-x    2 root     root         3072 Nov 23 15:10 modules/
> drwxr-xr-x    2 root     root         3584 Nov 23 13:55 modules.old/
> 
> I believe the *.old entries refer to the previous kernel.

The .old kernel is always your previous kernel. So if you installed a new
kernel just now, your old kernel would by copied to kernel.old, and the
previous kernel.old would be overwritten. This is useful, because in case
you build a kernel that will not boot, you can always go back to your
previous kernel.

The kernel.GENERIC entry is the GENERIC kernel, just in the way as it was
installed at the time you installed your FreeBSD system. It could
theoretically be deleted, but can be helpful if you totally mess everything
up (which tends to happen from time to time ;-)

Hint: The modules.old directory contains your previous modules. So the
relationship between modules and modules.old is just the same as with
kernel and kernel.old.

If you easily wanted to restore your system to your previous kernel, this
should work:

rm kernel
mv kernel.old kernel
rm modules/*
mv modules.old/* modules/
reboot

It is possible that you cannot simply delete your current kernel, because
it my be specially protected. In order to change that, execute 

chflags noschg kernel

before any of the commands given above.

Another hint: You can also tell the FreeBSD boot loader to boot into your
old kernel without actually making the old kernel the default kernel (as
the above example would). That basically works by interrupting the FreeBSD
boot process and telling it to boot kernel.old instead (see "man boot" for
details).

Greetings
Nils

-- 
Nils Holland
Ti Systems - FreeBSD in Tiddische, Germany
http://www.tisys.org * nils@tisys.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011230131728.A2286>