Page 1 of 1

preload virtio kernel at boot

Posted: 2019/10/31 09:44:52
by admin8000
hello forum,
i am new to this forum, at first.

i got to ask here, cause my problem is CentOS 5 related, but touches maybe also centos 6,7,8...
i created a virtual machine in KVM / Qemu and rsynced an old CentOS 5 Physical Server to it.
With a lot fiddeling around i "re-installed" grub and after some strong headache i foud out to what i have to modify /boot/grub/
and /etc/mtab. At the end the MBR was written and Grub re-installed.

i also did an "virtio.modules" text file in /etc/sysconfig/modules/ and set chmod +x to this file
the content:

modprobe virtio
modprobe virtio_net

On first tries, machine booted but ends with kernel panic cant find /proc /dev /sys , missing fstab.sys and so on.

I then re-created the initramfs with mkinitrd ... ... --preload=virtio --with=virtio --with=virtio_net --without-dmraid <initramfs> <kernel>

i used --without-dmraid cause the origin physical server was on raid-1.
i rebooted the virtual machine then and kernel panic again.

I then set the disk in the virtual machine instead of "virtio" to "sata" and VOILA !! the machine boots.

My question now is, how can i load the virtio kernel modules at boottime, to start the virtual machine with "vitio" settings?
Is it possible to start the virtual machine with disk in "virtio" ?
On the origin physical server it works when i do "# modprobe virtio & # modprobe virtio_net".... so it should work i guessed.
But i think building the initramfs with --preload=virtio does not what i guessed it shall do..... am i right?

So how do i build a new initramfs with the virtio kernel modules in it , that they can be accessed at boot time?
Anyone here had / have the knowledge about that?

thanks for any ideas / sollutions

kind regards
marko aka admin8000

Re: preload virtio kernel at boot

Posted: 2019/10/31 15:43:18
by TrevorH
You need ALL of the virtio modules that are needed, some of them depend on others that you have not told it about. Try modinfo on each and it lists the dependencies there, add those, repeat.