Welcome! Log In Create A New Profile

Advanced

Kernal upgrade

Posted by optim 
Kernal upgrade
September 16, 2013 11:52AM
I have a Goflex home booting off of an 80G hd. I am not much of a linux person, but I pick stuff up here and there.

I did a 'apt-get update', then I did a 'apt-get upgrade' and it says that it replaced my 2.6.35 kernel with 2.6.41 or something along those lines, but I actually have it booting from a 3.3.2 kernel.

When I reboot is this thing going to be messed up?
Re: Kernal upgrade
September 16, 2013 03:57PM
optim Wrote:
-------------------------------------------------------
> I have a Goflex home booting off of an 80G hd. I
> am not much of a linux person, but I pick stuff up
> here and there.
>
> I did a 'apt-get update', then I did a 'apt-get
> upgrade' and it says that it replaced my 2.6.35
> kernel with 2.6.41 or something along those lines,
> but I actually have it booting from a 3.3.2
> kernel.
>
> When I reboot is this thing going to be messed up?

Optim,

Don't reboot before you check the timestamp of /boot/uImage and uInitrd, vmlinuz-3.2.xxx, initrd.img-3.2.xxx. If they have the same timestamp then ok to reboot. If they do not, then regerate uImage and uInitrd using 3.2.xx files.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kernal upgrade
September 16, 2013 08:30PM
ehhhh... Here is what I have

root@Goflex-80G:~# cd /boot
root@Goflex-80G:/boot# ls -la
total 32872
drwxr-xr-x  2 root root    4096 Sep 15 16:29 .
drwxr-xr-x 22 root root    4096 Jul  3  2012 ..
-rw-r--r--  1 root root 1006188 Feb 16  2013 System.map-2.6.32-5-kirkwood
-rw-r--r--  1 root root 1220456 Apr 23  2012 System.map-3.3.2-kirkwood-dg
-rw-r--r--  1 root root   84134 Feb 16  2013 config-2.6.32-5-kirkwood
-rw-r--r--  1 root root  107468 Apr 23  2012 config-3.3.2-kirkwood-dg
-rw-r--r--  1 root root 4536589 Sep 15 16:29 initrd.img-2.6.32-5-kirkwood
-rw-r--r--  1 root root 6996747 May 24  2012 initrd.img-3.3.2-kirkwood-dg
-rw-r--r--  1 root root 2279256 May 24  2012 uImage
-rw-r--r--  1 root root 6996811 May 24  2012 uInitrd
-rw-r--r--  1 root root 6610550 Apr 23  2012 vmlinux-3.3.2-kirkwood-dg
-rw-r--r--  1 root root 1437136 Feb 16  2013 vmlinuz-2.6.32-5-kirkwood
-rw-r--r--  1 root root 2279192 Apr 23  2012 vmlinuz-3.3.2-kirkwood-dg

Does that look right?
Re: Kernal upgrade
September 16, 2013 11:59PM
optim,

This looks OK.
-rw-r--r--  1 root root 1220456 Apr 23  2012 System.map-3.3.2-kirkwood-dg
-rw-r--r--  1 root root  107468 Apr 23  2012 config-3.3.2-kirkwood-dg
-rw-r--r--  1 root root 2279192 Apr 23  2012 vmlinuz-3.3.2-kirkwood-dg
-rw-r--r--  1 root root 6996747 May 24  2012 initrd.img-3.3.2-kirkwood-dg
-rw-r--r--  1 root root 2279256 May 24  2012 uImage
-rw-r--r--  1 root root 6996811 May 24  2012 uInitrd

This is not.
-rw-r--r--  1 root root 6610550 Apr 23  2012 vmlinux-3.3.2-kirkwood-dg

For some reason, your update-initramfs "thinks" that your rootfs is 2.6.32-5-kirkwood. So when you upgrade it generated
-rw-r--r--  1 root root 4536589 Sep 15 16:29 initrd.img-2.6.32-5-kirkwood

Since your uImage and uInitrd seem to be generated from the 3.3.2 (based on the timestamp), you can reboot. But watch netconsole to see which initrd.img is loaded. If it loads 2.6.32-5 then it might not boot. If you can see the boot progress from netconsole, then you can fix it on another Linux box if it has problem.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kernal upgrade
September 17, 2013 05:49PM
What would the command be to force it to boot the correct initrd.img? I would rather just run the command then delete the files that should no longer be there.

This GoFlex boots off of a hard drive so fixing it after a failed boot would be a little more of a chore then if I were booting off of a stick.
Re: Kernal upgrade
September 18, 2013 12:51AM
optim,

IMPORTANT: since the apt-get upgrade got confused, I'm not positive that the commands below will remove the kernel cleanly. So back up your entire /boot directory somewhere first! and to be extra paranoid, you might also want to save the content of /lib/modules.

The command to regenerate initrd.img is

update-initramfs -u

If you see errors, then you probably should remove kernel 2.6.32-5 first. Use
dpkg -l | grep -i linux-image

to list the exact name. And then
dpkg -r linux-image-2.6.32-5-kirkwood    (or something like that, use the name listed by the dpkg -l command)


After removing 2.6.32-5, regenerate the initrd.img-3.3.2-kirkwood-dg using "update-initramfs -u" again.

All of the above are educated guesses. You just have to try and see what will work. No guarantee :) If you're not sure when you see any error message, you should post the log here. The best insurance is to have a USB stick that you can boot with so you can fix whatever potential problem that might occur.
Re: Kernal upgrade
September 18, 2013 03:52PM
I ran the command: no errors

root@Goflex-80G:/boot# update-initramfs -u
update-initramfs: Generating /boot/initrd.img-3.3.2-kirkwood-dg

Then for fun I ran the dpkg command:

root@Goflex-80G:/boot# dpkg -l | grep -i linux-image
ii  linux-image-2.6-kirkwood               2.6.32+29                    Linux 2.6 for Marvell Kirkwood (meta-package)
ii  linux-image-2.6.32-5-kirkwood          2.6.32-48                    Linux 2.6.32 for Marvell Kirkwood
ii  linux-image-3.3.2-kirkwood-dg          1.1                          Linux kernel binary image for version 3.3.2-kirkwood-dg

so now I am confused.
Re: Kernal upgrade
September 19, 2013 12:11AM
optim,

Back up your /boot/uInitrd and then regenerate it:
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-3.3.2-kirkwood-dg  -d /boot/initrd.img-3.3.2-kirkwood-dg /boot/uInitrd

The reason you see 3 versions listed because you did not remove old kernel images after you're installed 3.3.2-kirkwood-dg.

Regenerate uInitrd will force the Linux to load your rootfs using 3.3.2-kirkwood-dg initrd image.

After you've satisifed that everything is working, you can remove the old kernel packages. Again, backup before execute these commands:
dpkg -r linux-image-2.6-kirkwood
dpkg -r linux-image-2.6.32-5-kirkwood


After that, reboot and make sure it works. You can then purge the boot scripts for the old images:dpkg -r linux-image-2.6-kirkwood.
dpkg --purge linux-image-2.6-kirkwood
dpkg --purge linux-image-2.6.32-5-kirkwood

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Kernal upgrade
September 19, 2013 06:44PM
Thanks a ton! Worked like a charm.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: