From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dick Repasky Date: Fri, 06 Jun 2008 11:06:52 +0000 Subject: Re: udev RUN+=: device but no partitions Message-Id: <48491A4C.9030603@indiana.edu> List-Id: References: <48486A19.1020909@indiana.edu> In-Reply-To: <48486A19.1020909@indiana.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org Thanks to you all. I've skirted the problem by inserting a delay. If my script is called=20 with no argument (as udev would call it) the script invokes itself in=20 the background with a single argument and the re-invoked script sleeps=20 for a second before doing anything. By the time that the script is=20 finished napping, the partition device files are available. Dick Repasky Kay Sievers wrote: > On Fri, Jun 6, 2008 at 12:35 AM, Dick Repasky wrot= e: >> If I use udev to run a script when a usb disk device appears, the device= file >> for the whole device is available in the script but device files for par= titions >> on the device are not. >> >> Example: usb thumbdrive that appears as sdb and has one partition sdb1. >> >> Udev entry >> >> KERNEL=3D"sdb", RUN+=3D"/usr/local/sbin/check-sdb" >> >> In check-sdb, if I run either "ls /dev/sdb*" or find /dev -name "sdb*", = only >> /dev/sdb appears but not /dev/sdb1. Is that behavior correct? When the= same >> script is run from the command-line, the partition device file appears. >=20 > You get separate events for the partitions, which you may want to hook > in, instead of expecting the partitions to be available when the disk > shows up. >=20 > In theory, the event for the disk is delayed until the partition table > is scanned and hte partitions are created. We changed that in the > kernel a while ago: > http://git.kernel.org/?p=3Dlinux/kernel/git/torvalds/linux-2.6.git;a=3D= commit;h=D4d7e5dffc4844ef51fe11f497bd774c04413a00 > Maybe that does not work for you for some reason. >=20 > Kay --=20 Dick Repasky Center for Computational Cytomics UITS Cubicle 101.08 Indiana University USA rrepasky@indiana.edu