Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: rmrichesjr on May 01, 2012, 07:55:07 AM

Title: missing disk block devices in virtual machine
Post by: rmrichesjr on May 01, 2012, 07:55:07 AM
I'm running a remastered Tiny Core 4.2.1 in a virtual machine (KVM/libvirt/qemu-type) via direct kernel boot, mostly using virtio-type virtual disks.  Somewhere between 10% and 50% of the time I boot a VM, one of the virtual disks is missing from /dev, though most if not all of the time it shows up in /proc/partitions.  For example, on a recent test run, the VM was supposed to have four virtio disks: vda, vdb, vdc, and vdd.  /proc/partitions listed all four, with reasonable-looking major and minor device numbers.  However, in /dev, vdc was entirely missing.

Any suggestions for how to find the root cause of this problem?  I would guess it's udev that is supposed to create the device nodes.

It would appear that for a workaround I could simply create the block device using the major and minor node numbers from /proc/partitions.  Any ideas on whether that would work?

Thanks,

Robert
Title: Re: missing disk block devices in virtual machine
Post by: gerald_clark on May 01, 2012, 08:29:20 AM
Try adding a 'waitusb=5' boot option.
This will cause core to wait 5 second before scanning for disks.
This may give more time for the virtual drives to be ready.
Title: Re: missing disk block devices in virtual machine
Post by: rmrichesjr on May 01, 2012, 09:42:07 AM
Thank you for the suggestion to try waitusb=5.  That seemed to reduce the percentage of VM boots that show the problematic symptoms.
Title: Re: missing disk block devices in virtual machine
Post by: tinypoodle on May 01, 2012, 09:48:51 AM
Then you might want to experiment with increasing this value.
Title: Re: missing disk block devices in virtual machine
Post by: coreplayer2 on May 02, 2012, 02:11:32 AM
I'm curious about a VM that might be slow, since they are running as fast as the host, right?   On average I use 20 to 30 VMs across many hosts all with frugal installs, though  none have the usbwait option and none have shown this trait.

May I ask which VM ??
Title: Re: missing disk block devices in virtual machine
Post by: rmrichesjr on May 02, 2012, 07:30:15 AM
Which VM?  Any/all virtual machines I create--on a sporadic basis.

The virtual machines are running under KVM/libvirt/qemu, if that was the intent of the question.

So far, in essentially all observed cases where the block device nodes were missing from /dev, /proc/partitions had the info about the disk.  Since udev (or whatever should create the nodes) seems to be slacking, one workaround is to manually create them based on the major and minor numbers in /proc/partitions.  As an experiment, I waited up to 60 seconds, and the device nodes did not appear, so it's not simply that udev is a little slow.

It appears increasing the waitusb number would likely reduce the frequency of missing devices.  However, with non-deterministic network and disk I/O delays, it does not appear any practical waitusb number would completely eliminate the issue--there would always be a tail of the distribution just beyond the number I would use.

Thanks for all the responses.  The workaround of manually creating the devices appears to be working reasonably well, so far.