So I am creating my own copy of Linux initramfs (For learning purposes). Everything seems to be working great. I, correctly, installed shared libraries and I can run some binaries from within the initramfs. I also installed and run busybox tools without any problem. However, when trying to mount /dev/sr0, mount reports that no such device or address is found. The serial logs (Reported by Virtualbox into a text file) show that the kernel could detect the SATA hard drive but it can't detect the IDE cdrom controller. When I use my host's system original initramfs, It does detect and successfully mounts the cdrom drive but lsmod shows really lots of loaded modules and I can't try them all. So I want to detect IDE cdrom drive with my initramfs by loading the correct kernel modules but I am not sure which ones will do the job for a virtualized IDE interface.

By the way, my initramfs loads the following modules:

    modules="ahci sd_mod sr_mod virtio_blk virtio_pci" 
    modules="$modules ohci_pci ehci_pci loop ext4 isofs squashfs"

    for mod in $modules; 
        echo "Loading $mod ..."
        modprobe $mod 

The following is part of the serial log that shows that SATA disk is detected:

[    5.988202] SCSI subsystem initialized
[    6.074669] libata version 3.00 loaded.
[    6.212811] tsc: Refined TSC clocksource calibration: 2594.307 MHz
[    6.213805] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x25653a78b6d, max_idle_ns: 440795319419 ns
[    6.216298] ahci 0000:00:0d.0: version 3.0
[    6.217563] ahci 0000:00:0d.0: SSS flag set, parallel bus scan disabled
[    6.393125] ahci 0000:00:0d.0: AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
[    6.394486] ahci 0000:00:0d.0: flags: 64bit ncq stag only ccc 
[    6.396023] scsi host0: ahci
[    6.396708] ata1: SATA max UDMA/133 abar m8192@0xf0806000 port 0xf0806100 irq 21
[    6.713317] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[    6.729072] ata1.00: ATA-6: VBOX HARDDISK, 1.0, max UDMA/133
[    6.753066] ata1.00: 4194304 sectors, multi 128: LBA48 NCQ (depth 31/32)
[    6.812916] ata1.00: configured for UDMA/133
[    6.863148] scsi 0:0:0:0: Direct-Access     ATA      VBOX HARDDISK    1.0  PQ: 0 ANSI: 5
[    6.871504] sd 0:0:0:0: [sda] 4194304 512-byte logical blocks: (2.15 GB/2.00 GiB)
  • 2
    This gets closed as asking for product recommendations? Seriously? Seriously? – grawity Jun 18 at 19:14
  • Eh, maybe it's an edge case, but it's asking for the software (drivers) necessary to incorporate into another piece of software to make something work. Personally, I'd say it's a bit broad but has potential. – music2myear Jun 18 at 21:00

At minimum, you'll need the sr module for the drive itself. Beyond that, you need a driver for the chipset, but I unfortunately odn't know exactly what the relevant drivers would be. I think you need the ata_generic and pata_acpi modules, but I'm not 100% certain.

That said, the configuration provided by default by VirtualBox is actually pretty unusual by today's standards. The original reasoning for this configuration is the same as the reasoning behind actual hardware that was built like this almost a decade ago, some older software that you had to boot off of a CD only properly supported PATA access to the CD drive. These days though, such situations are pretty rare (none of the big OSes need this anymore, and pretty much any recently updated bootable utility software doesn't either).

So, given that, I'd encourage you to instead remove the IDE controller in the VirtualBox configuration completely and just add an optical drive to the SATA controller. At that point, you should just need the sr driver for the CD-ROM drive itself.

  • Thanks. That's exactly what I did and it worked very well. I used a SATA optical drive with the sr module and it worked like charm. – Karim Manaouil Jun 21 at 10:33

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.