Skip to contentSkip to conversation

udev rules and noflushd

DISCUSSION X O R 3 participants 3 messages Jan 4, 2010

lore
Share & tools
lore

X O R

author
#0 lore raw

Hello,

I have Debian router. With noflushd and tmpfs I was able to spin down the hard disk completely. Now with the recent versions of udev I am unable to do that :(

I am using echo 1 > /proc/sys/vm/block_dump to check which process is waking up the hard drive. After several minutes of disk inactivity I can hear my disk is spinning down, then immediately it spins up again. In logs I can see the cause of that is blkid, in particular this rule from 60-persistent-storage.rules:

KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"

First I was able to solve that by commenting the line. But if I (or some update) do update-initramfs system becomes unbootable. I guess this rule is used (by grub2) to detect hard disks at boot.

So I was doing this.

1. Comment the rule
2. /etc/init.d/udev restart
3. Uncomment rule

But with recent update it seems that udev is reading rules on the fly. There is no need to restart the service. So as soon as I change the rule to "uncommented", udev "sees" that change and makes my hard drive to be unable to spin down.

Please help

#1 lore raw
Quoted 12 lines · X O R

Hello,

I have Debian router. With noflushd and tmpfs I was able to spin down the hard disk completely. Now with the recent versions of udev I am unable to do that :(

I am using echo 1 > /proc/sys/vm/block_dump to check which process is waking up the hard drive. After several minutes of disk inactivity I can hear my disk is spinning down, then immediately it spins up again. In logs I can see the cause of that is blkid, in particular this rule from 60-persistent-storage.rules:

KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"

First I was able to solve that by commenting the line. But if I (or some update) do update-initramfs system becomes unbootable. I guess this rule is used (by grub2) to detect hard disks at boot.

Quoted 7 lines

So I was doing this.

1. Comment the rule
2. /etc/init.d/udev restart
3. Uncomment rule

But with recent update it seems that udev is reading rules on the fly. There is no need to restart the service. So as soon as I change the rule to "uncommented", udev "sees" that change and makes my hard drive to be unable to spin down.

I'm not sure the correct solution, but adding ACTION="add" in that rule may limit it to only bootup. What's happening now is that spinning down the disk is causing a uevent to be triggered by the kernel, but it's a change event rather than an add event. The right thing to do may be to fix the kernel so that spinning down the disk doesn't emit a uevent. I'm pretty sure limiting the above rule to "add" means you'll miss live metadata changes like labels.

--
Dan

#2 lore raw
In reply to X O R
Quoted 3 lines · X O R

Hello,

I have Debian router. With noflushd and tmpfs I was able to spin down the hard disk completely. Now with the recent versions of udev I am unable to do that :(

noflushd probably opens the device writable, which causes udev to re-check it after possible changes. It should probably just read the device read-only, and prevent that behavior.

Kay