From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrey Borzenkov Date: Sun, 10 Jun 2007 11:38:14 +0000 Subject: Re: udev remove ATTR(S) not working Message-Id: <200706101538.18988.arvidjaar@mail.ru> MIME-Version: 1 Content-Type: multipart/mixed; boundary="===============0740838185==" List-Id: References: <46673B9D.3000205@bppiac.hu> In-Reply-To: <46673B9D.3000205@bppiac.hu> To: linux-hotplug@vger.kernel.org --===============0740838185== Content-Type: multipart/signed; boundary="nextPart1192665.6MtaUWT4iu"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart1192665.6MtaUWT4iu Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sunday 10 June 2007, Farkas Levente wrote: > Andrey Borzenkov wrote: > >> this's my udev rules: > >> ---------------------------------------- > >> # cat /etc/udev/rules.d/10-local.rules > >> ACTION=3D=3D"add", KERNEL=3D=3D"sd[a-z]", SUBSYSTEM=3D=3D"block", > >> ATTR{size}=3D=3D"2880", ATTRS{serial}=3D=3D"07530736300A", ATTRS{produ= ct}=3D=3D"USB > >> DISK Pro", SYMLINK+=3D"lfarkas", RUN+=3D"/root/bin/home-up > >> /dev/VolGroup00/LogVol02 lfarkas" > >> > >> ACTION=3D=3D"remove", KERNEL=3D=3D"sd[a-z]", SUBSYSTEM=3D=3D"block", > >> RUN+=3D"/root/bin/home-down lfarkas" > > > > [...] > > > >> this's working. the only problem i'd like to do it better ie somehow > >> recognize only _my_ pendrive. in case of add i can use ATTR{size}, > >> ATTRS{serial}, ATTRS{product}, but in remove i can't do any better then > >> KERNEL=3D=3D"sd[a-z]", SUBSYSTEM=3D=3D"block" which is a satisfied by = all kind > >> of removable device:-( so that's my problem. ie if i plug and remove my > >> camera it also try to remove my home partition:-( > > > > Have you ever tried udevinfo? > > > > {pts/0}% udevinfo -q env --name sda > > ID_VENDOR=3DATA > > ID_MODEL=3DIC25N020ATDA04-0 > > ID_REVISION=3DDA3O > > ID_SERIAL=3DSATA_IC25N020ATDA04-_63A63GY1081 > > ID_SERIAL_SHORT=3D63A63GY1081 > > ID_TYPE=3Ddisk > > ID_BUS=3Dscsi > > ID_ATA_COMPAT=3DIC25N020ATDA04-0_63A63GY1081 > > ID_PATH=3Dpci-0000:00:04.0-scsi-0:0:0:0 > > ID_EDD=3Dint13_dev80 > > > > notice ID_SERIAL or ID_SERIAL_SHORT? > > yes but as i wrote earlier if i write > ENV{ID_SERIAL}=3D"_USB_DISK_Pro_07530736300A" it's not working in case of > removal! that's my problem! no, earlier you wrote you tried ENV{DEVLINKS} which is not going to work. A= nd=20 if you really use the above, it won't work either - you have to use =3D=3D = not =3D --nextPart1192665.6MtaUWT4iu Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBGa+KmR6LMutpd94wRAvVpAKCdMpGc/x3ithNLaGxAHFr7blJ0iwCdEBeO nZvTq6zcHHT3jS/pwe8gPTw= =H5/o -----END PGP SIGNATURE----- --nextPart1192665.6MtaUWT4iu-- --===============0740838185== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ --===============0740838185== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel --===============0740838185==--