Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have added the rule

$ cat /etc/udev/rules.d/00-my.rules 
ACTION=="add",    KERNEL=="sd[a-z]", SUBSYSTEM=="block", PROGRAM="/usr/sbin/mytool add %r/%k"

on my RHEL 5.8 to check the disk's partition table on disk appearance event.

After I connect the disk mytool is called by udev subsystem and udev is pass something like /dev/sdb to mytool. But mytool unable to fopen the /dev/sdb because there are no /dev/sdb file at the time of mytool executing by udev on RHEL.

How can I fopen the file /dev/sdb/ in mine mytool?

share|improve this question

Your Answer


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