LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   installing two kernels in a single machine booting with lilo (https://www.linuxquestions.org/questions/linux-newbie-8/installing-two-kernels-in-a-single-machine-booting-with-lilo-4175443772/)

micflunu 01-02-2013 02:19 AM

installing two kernels in a single machine booting with lilo
 
I am trying to add a kernel to my ubuntu 12.04.I have a kernel version of 3.2.x.x and now I want to add kernel 3.0.x.x with out affecting the one working perfectly. But the thing is in am getting this different ideas from different sites and I don know which one to use.Is there any one who could guide me or point me to a correct reading material?
Best Regards!!!

business_kid 01-02-2013 03:14 AM

Simple enough - I do it all the time. Make sure CONFIG_LOCAL_VERSION is set to a different setting.
Then you end up with 2 module trees, 2 kernels, and one root drive. The module trees will be in
/lib/modules/<kernel version><local_version> e.g. 3.2.29-mine

Then rename each to the <kernel version><local_version> e.g. vmlinuz-3.2.29-mine & System.map-3.2.29-mine.

micflunu 01-03-2013 12:12 AM

thank for the replay i kind of did install the kernel but i don know how to create the initial ram disk image(initrd)
i tried
Code:

mkinitr
It said
Code:

command not found
Code:

mkinitramfs
and said
Code:

Kernel too old for mkinitramfs
What should i do?

business_kid 01-03-2013 08:39 AM

mkinitrd

micflunu 01-04-2013 02:16 AM

Ok that is solved thanks.Now the problem is my system boots properly with my old kernel but when i try to boot from the new kernel i get
Code:

mount:mounting /dev on /root/dev failed:no such file or directory
mount:mounting /sys on /root/sys failed:no such file or directory
mount:mounting /proc on /root/proc failed:no such file or directory
target filesystem doesn't have requested /sbin/init
No init found.try passing init=bootarg
(initramfs)_

i can not do any thing .how do i lose this (initramfs) prompt?

business_kid 01-04-2013 06:17 AM

It strikes me you have left out some fundamental piece of the jigsaw.

You need tmpfs, fuse filesystem, & your own hard disk filesystem compiled into the kernel.

Without tmpfs & a /dev/ directory, the system cannot mount the device tree on /dev so no devices get made. This is the setup from my 3.7.1 kernel, which works with no initrd.
Code:

bash-4.2$ grep -ne 'FUSE' -e 'TMPFS' -e 'EXT4' .config
1200:CONFIG_DEVTMPFS=y
1201:CONFIG_DEVTMPFS_MOUNT=y
3399:CONFIG_EXT4_FS=m
3400:CONFIG_EXT4_USE_FOR_EXT23=y
3401:CONFIG_EXT4_FS_XATTR=y
3402:CONFIG_EXT4_FS_POSIX_ACL=y
3403:CONFIG_EXT4_FS_SECURITY=y
3404:# CONFIG_EXT4_DEBUG is not set
3427:CONFIG_FUSE_FS=m
3469:CONFIG_TMPFS=y
3470:# CONFIG_TMPFS_POSIX_ACL is not set
3471:CONFIG_TMPFS_XATTR=y


NevemTeve 01-04-2013 06:21 AM

Are your sure you need initial (or otherwise) ramdisk?

jpollard 01-04-2013 07:25 AM

No, you need to make sure the mkinitrd includes the drivers for the disk controller you are using.

Something like:
Code:

mkinitrd -c -k 3.2.29 \
        -f ext4 \
        -r /dev/vda3 \
        -m ext4:virtio:virtio_balloon:virtio_blk:virtio_pci:virtio_ring

In my case, I was installing in a VM using virtual disks for speed (the vda driver). I had to tell the mkinitrd the root device (/dev/vda3) and include the driver modules (ext4 for root, virtio* for the disk).

No need to have them compiled into the kernel, though that would work too.
Modules are all that are needed - and this makes it easier to update the drivers without having to rebuild the kernel.

micflunu 01-08-2013 12:49 AM

Thank you all for your replays.Could any one please explain to me what you are saying.As i am new to this thing i am kind of confused to what you are trying to tell me.I have installed the other kernel,at list i think i do,using this site "file:///media/6824BB7F24BB4F36/pdf/fork/kernel/kernel-compile.html".I can boot my system using the original kernel but not able with the newly installed one.So how do i make the things that you are suggesting by booting from the other kernel.And could you please be a little clear about what you are telling me because i am new.

wigry 01-08-2013 01:00 AM

First it is interesting that you are using Ubuntu which in turn uses Lilo? I thought that Ubuntu uses Grub or something else? But if there is indeed Lilo, then you need to configure lilo to have an entry for the second kernel, then rerun lilo, so that all the things are set up for you, reboot and if the kernel is good, then you are good to go.

First step is to configure Lilo. You need to find the lilo config file, so go and see, if there is a file called /etc/lilo.conf and if so, please post the contents of that file into this thread. Then we can guide you further.

micflunu 01-08-2013 01:31 AM

I did all that it works just fine for the originally installed kernel.But i had to install and configure additional kernel and boot with any of the kernels.I tried to install and configure the additional kernel.Yes i did update the lilo.conf file.Lilo lets me choose from the two kernels.But the problem is with the last installed kernel it doesn't finish booting it stacks giving mi the above error messages.

business_kid 01-09-2013 03:43 AM

You need to recompile with a better choice of options. Read post #6.

vinay.bhandwalkar 01-15-2013 04:49 AM

minitrd command not found
 
hello seniors,
I am new to the forum
As I am installing new kernel 3.7.1. on my Ubuntu 12.04
in /boot folder when I run mkinitrd -o initrd.img-3.7.1 3.7.1 it says command not found
but I can see initrd.img-3.7.1 file in /boot folder

jpollard 01-15-2013 05:15 AM

You need to show the command and the errors (put them in a code block for formatting). We can't tell what your error may be associated with. mkinitrd is actually a shell script, so there may be something missing for it to work.

vinay.bhandwalkar 01-15-2013 11:53 PM

upate-grub
 
as there was error in running mkinitrd -o initrd.img-3.7.1. 3.7.1 I just updated grub without running mkinitrd command
and the kernel 3.7.1 is running efficeintly.
As I am new could plz tell me what is the basic need for running mkinitrd command and what if I didnt use it


All times are GMT -5. The time now is 07:59 AM.