Solved disable cdrom

I am having a problem in a VM at a hoster: my devd is spamming my logs with

Code:
Processing event '!system=CAM subsystem=periph type=error device=cd0 serial="QM00001" cam_status="0x4cc" scsi_status=2 scsi_sense="70 02 3a 00" CDB="00 00 00 00 00 00 " '

I do not want to use devd's quite mode ("-q"), but like to address this specific message.

the relevant dmesg part:

Code:
cd0 at ahcich0 bus 0 scbus1 target 0 lun 0
cd0: <QEMU QEMU DVD-ROM 2.5+> Removable CD-ROM SCSI device
cd0: Serial Number QM00001
cd0: 150.000MB/s transfers (SATA 1.x, UDMA5, ATAPI 12bytes, PIO 8192bytes)
cd0: Attempt to query device size failed: NOT READY, Medium not present

and pciconf:

Code:
ahci0@pci0:0:31:2:      class=0x010601 rev=0x02 hdr=0x00 vendor=0x8086 device=0x2922 subvendor=0x1af4 subdevice=0x1100
    vendor     = 'Intel Corporation'
    device     = '82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode]'
    class      = mass storage

Can some tell me how to use either devd to silence that device, or better: disable it using /boot/loader.conf or device.hints?
 
brute force would be to build a kernel without cd(4)
I was thinking the same but thats alot of work. BIOS disable the drive is probably better.
I was worried you lose the drive use in FreeBSD too but you could just keep both kernels and reboot to regain drive.
Either way is sub-par.
 
well he's on a (hosting) vm so probably no bios option
problem is when the cd is on a controller that does other things and you can't disable the controller because you lose disks or tapes or whaterver
also not sure if you can disable an ahci channel via hints
 
many thanks for all the suggestions!

compiling kernel is out of scope for this vm, and accessing BIOS settings is not possible.
kern.cam.cd.poll_period=604800 is a solution I had tried earlier, but I wanted to tackle it via device.hints or disabling the thing completely.
hint.ahci.0.disabled="1" was the thing I settled with. I previously tried
hint.cd.0.disabled="1" and hint.ahcich0.0.disabled="1" - neither of which worked.

On a side note: on this system I am using syslog-ng and at first used a filter for the log destination in the config:
filter f_not_cdrom_errors { not match("system=CAM subsystem=periph type=error device=cd0 serial=\"QM00001\" cam_status=\"0x4cc\" scsi_status=2 scsi_sense" value("MESSAGE")); };
which also worked but did not exactly what I wanted.
 
The only reason I offered that is I wonder about how storage system acts without AHCI. I don't know your setup.
I would do rudimentry benchmark with diskinfo -t before and after.
 
Last edited:
according to dmesg, the disk uses a different driver:

da0 at vtscsi0 bus 0 scbus0 target 0 lun 0
da0: <QEMU QEMU HARDDISK 2.5+> Fixed Direct Access SPC-3 SCSI device
da0: 300.000MB/s transfers
da0: Command Queueing enabled
da0: 39064MB (80003072 512 byte sectors)
so diskinfo -ti da0 did show quite similar figures. A question arises: is hint.ahci.0.disabled="1" the same as
sysctl dev.ahcich.0.disable_phy="1"?
 
diskinfo -ti da0 is an awesome tool. The performance data are quite useful for analysis.

Seek times:
Full stroke: 250 iter in 0.041873 sec = 0.167 msec
Half stroke: 250 iter in 0.080800 sec = 0.323 msec
Quarter stroke: 500 iter in 0.159347 sec = 0.319 msec
Short forward: 400 iter in 0.141383 sec = 0.353 msec
Short backward: 400 iter in 0.118050 sec = 0.295 msec
Seq outer: 2048 iter in 0.110049 sec = 0.054 msec
Seq inner: 2048 iter in 0.111059 sec = 0.054 msec

Transfer rates:
outside: 102400 kbytes in 0.242590 sec = 422111 kbytes/sec
middle: 102400 kbytes in 0.675709 sec = 151545 kbytes/sec
inside: 102400 kbytes in 0.226539 sec = 452019 kbytes/sec

Asynchronous random reads:
sectorsize: 59052 ops in 3.005911 sec = 19645 IOPS
4 kbytes: 62324 ops in 3.006245 sec = 20732 IOPS
32 kbytes: 12470 ops in 3.022349 sec = 4126 IOPS
128 kbytes: 3141 ops in 3.508534 sec = 895 IOPS
1024 kbytes: 607 ops in 4.306946 sec = 141 IOPS
 
Back
Top