Solved kernel.old dir related question

Hi everyone :)

After successfully running freebsd-update (from 11.0-beta3 to 11.0-RELEASE-p1 as recommended) I have this /boot/kernel.old dir left. Don't mind that, but it seems to have a full copy of ALL my rootdir, including all the ports installed under /usr/local/. Do I really need all that after the successful update?

Secondly, before the update I've created a snapshot of my rpool/ROOT/freebsd-root filesystem (zfs) dataset containing all my system (no other filesystems mounted as /usr etc.). Always do that before any upgrades, or else what is ZFS for... It's all there except my homedir which is mounted at /home from /etc/fstab. Now a snapshot reflects changes made to the filesystem after it was taken under USED, does it not? ...So after the upgrade it shows 208M under USED which seems ok. But then, how come the size of the /boot/kernel.old dir is shown in the file browser to be several gigs, pretty much like my real system root is?

I tried to see if /boot/kernel.old is null-mounted or a soft-link, but no, by the looks of it it's a normal directory.
 
I have this /boot/kernel.old dir left. Don't mind that, but it seems to have a full copy of ALL my rootdir, including all the ports installed under /usr/local/. Do I really need all that after the successful update?
No, you don't need it. But it should contain only the old kernel, not everything else too. I've seen this issue before but I can't find the thread about it.
 
  • Thanks
Reactions: jsm
Yea, I couldn't either -- until I posted here. It is there, just the description is different...

So, this happens when booting from GRUB2, which for some reason causes kern.bootfile=/kernel while it normally must be /boot/kernel/kernel.

If it's only that, this can be helped in 3 ways:
1) add kFreeBSD.kern.bootfile="/boot/kernel/kernel" to GRUB config
2) add kern.bootfile=/boot/kernel/kernel to /etc/sysctl.conf
3) manually set that sysctl before the upgrade.

I'm testing now if this is going to work.
EDIT: YES, this works perfectly well. So, perhaps, this line should always be added to GRUB2 config:
Code:
kFreeBSD.kern.bootfile="/boot/kernel/kernel"
In order to fix this kind of problem, as this is the GRUB2 syntax for setting up the variables usually set in /boot/loader.conf.
 
So this is SOLVED. But it's indeed a duplicate of some other thread which I can't find now because it formulates a different problem in its title...
 
Back
Top