Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

DVD drive constantly spins up/down when idle on notebook. I cannot track what is causing it. The process of spinning up/down is quite noisy and disturbing.

lsof cannot find anything that have device file opened or anything that keeps any file opened. It is some regression but I don't see any update that might have caused it.

Drive is mount/unmount by usdisk.

EDIT: To answer:

  1. It is regression I need to pinpoint
  2. There is no errors in dmesg
  3. It happens when disk is mounted
  4. It worked in past with pooling
  5. The only recent chang was rebuild of udisks with patch named "Fix long hangs on probing nonexistant floppies."
share|improve this question
    
is it mounted when this is happening? are there any errors in dmesg? what have you updated? I would like to say it's possible the drive is going wonky... I've seen hardware do some crazy things (phantom clicks was my favorite for a mouse going bad) –  xenoterracide Aug 31 '10 at 0:03
add comment

1 Answer

A common cause of this behavior is device polling by deamons like hald and udevd. You can temporarily disable polling by hald and udev to see if these may be the cause in your case.

If you are running hald:

hal-disable-polling --device /dev/dvd

Note your DVD drive may not be symlinked /dev/dvd, it could be /dev/sr0, /dev/dvd0, etc. If you get an error like "Cannot find storage device /dev/dvd", you can try one of the other device names.

Now temporarily stop polling by udev with this:

udisks --inhibit-polling /dev/dvd

(this command will appear to hang - it is disabling polling until you hit Ctrl-c)

If this stops your device from frequently spinning, see my notes below about making the udev rule changes.

If disabling hald and udisks polling makes no difference, then you can re-enable hald control of the device with this:

hal-disable-polling --enable-polling --device /dev/dvd

Disabling polling of your DVD device may have the side effect of requiring you to mount optical media manually. Your drive may continue to provide notification to udev that it should take some action upon media insertion.

Making udisks ignore your optical device is a simple rule. I put mine in /etc/udev/rules.d/99-device-polling.rules:

SUBSYSTEM=="block", \
   ENV{ID_VENDOR}=="MATSHITA*", \
   ENV{ID_MODEL}=="*UJ-850*", \
   ENV{UDISKS_DISABLE_POLLING}="1"

Get your vendor and model strings from the output of udisks --show-info /dev/dvd. Make the changes active by running udevadm trigger, then re-examine udisks --show-info /dev/dvd and note the line "detection by polling:" - it should be 0.

share|improve this answer
    
It did not happend before when pooling was enable. AND it happends when disk is mounted so I guess there should be no pooling. –  Maciej Piechotka Sep 14 '10 at 10:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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