0

I'm trying to build a minimal Linux kernel using buildroot that I want to run on VMware, among other platforms. However, when I boot the kernel it doesn't recognize the hard drive (i.e., no /dev/sda). I think I have enabled all the drivers needed, but still nothing. It does work on Virtualbox, but not on VMware.

lspci | less
...
00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev01)
...
00:10.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 01)
...

I've started with make x86_64_defconfig And I've enabled:

SCSI device support:
    <M> SCSI disk support
    <M> SCSI generic support

Serial ATA and Parallel ATA drivers (libata)
    <M>   AHCI SATA support
    <M>   Platform AHCI SATA support
    <M>       Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support
    <M>     Generic ATA support

Is there something I am missing? Can I find a configuration file for a typical desktop kernel and base my configuration upon it? Are there any more tricks I can use to figure out which modules I need to build? Can I use some identifier to search in the source code of the kernel for example?

  • 1
    1) surely you'd prefer AHCI? 2) yes, /boot/config* 3) to disable unused modules you can run make localmodconfig in the VM unix.stackexchange.com/a/275747/29483 – sourcejedi Apr 26 '16 at 8:05
  • Added the AHCI module as well, or did you mean something else? I'll take a look at the /boot/config file – Kotte Apr 26 '16 at 8:20
  • 1
    Yep. AHCI is a better interface, and it's used across physical systems from multiple vendors. If there's a default hardware model for modern OS's, it probably uses AHCI. Except that you might also want to be able to take advantage of virt-specific drivers. E.g. wiki.archlinux.org/index.php/VMware/… Typically module names are mentioned in Kconfig and you can search for them (I think "/" key or ctrl+f in make xconfig). Or I think git grep vmw_pvscsi should find the Kconfig file and identify the corresponding CONFIG_ option. – sourcejedi Apr 26 '16 at 8:30
  • I copied the config file used on my desktop, so now I got the module. I know this since find /lib/modules/$(uname -r) -name '*.ko' -exec basename '{}' .ko ';' | xargs modprobe make /dev/sda appear. Now only to find out which module makes /dev/sda to appear :-D – Kotte Apr 26 '16 at 12:00
  • 1
    You don't want to run make localmodconfig inside the VM? To find the ata driver, look at readlink -f /sys/class/ata*/*. That will show the pci device, then you can find name of the module for it e.g. cat readlink /sys/devices/pci0000:00/0000:00:1f.2/driver/module – sourcejedi Apr 26 '16 at 15:43
0

Maybe your disk is on LVM partition . check : /dev/mapper/lvm and also you can use df or lsblk command to find that path of your disk. mount command will also helps.

  • 1
    Sorry, but this is before that. I don't even see /dev/sda to be able to set up a partition table – Kotte Apr 26 '16 at 11:30
0

I solved my problem the ugly way. I'll wait with marking this as correct as I think there is a better solution.

After trying a variety of solutions, among other trying to get information from /sys/ (readlink /sys/block/sda/device/driver etc). But I only found information that it was some kind of SCSI driver, which didn't help me. Finally I used my desktop kernel configuration, and loaded all the modules until /dev/sd* appeared. I was at first tricked by loading scsi_debug, which also presents a /dev/sda. The module i needed was mptspi, which is enabled by FUSION_SPI in the Linux kernel. I learned this after searching the source code tree. This is the script I used for identifying the driver:

for MODULE in $(find /lib/modules/$(uname -r) -name '*.ko' -exec basename '{}' .ko ';')
do
    echo "Loading $MODULE"
    modprobe -D $MODULE
    modprobe $MODULE
    ls /dev/sd* 2>&1
done

Which I ran as

./script | tee script.log

Next time I'll probably set up some solution using mdev/udev...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.