From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrey Borzenkov Date: Thu, 17 May 2007 02:48:52 +0000 Subject: Re: How to find mounted path from usb hotplug? Message-Id: <200705170648.58159.arvidjaar@mail.ru> MIME-Version: 1 Content-Type: multipart/mixed; boundary="===============0072391894==" List-Id: References: In-Reply-To: To: linux-hotplug@vger.kernel.org --===============0072391894== Content-Type: multipart/signed; boundary="nextPart2672598.FXCHN5ClTO"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart2672598.FXCHN5ClTO Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 17 May 2007, Greg wrote: > How can I find out where my USB stick was mounted using /sbin/ > hotplug? I have a simple script in /etc/hotplug.d/usb/ that is run > when the key is attached, but I need to know the full path of where > the USB key is mounted to, and I can't seem to figure out how the > environment variables can tell me that: > Because at this stage it is not known yet. What makes you believe it will b= e=20 mounted at all? Once upon a time there were mount/umount events but I believe they are gone= =20 now. To not depend on the method of mounting just poll /proc/mounts. If you are= =20 sure your system is using HAL to mount, you can just watch for=20 PropertyChanged for correspsonding device (and check mounted state). HTH =2Dandrey > SUBSYSTEM=3Dusb > DEVPATH=3D/devices/pci0000:00/0000:00:10.4/usb1/1-5/1-5:1.0 > PATH=3D/sbin:/bin:/usr/sbin:/usr/bin > ACTION=3Dadd > MODALIAS=3Dusb:v0457p0150d0100dc00dsc00dp00ic08isc06ip50 > PWD=3D/ > HOME=3D/ > SHLVL=3D2 > DEVICE=3D/proc/bus/usb/001/004 > INTERFACE=3D8/6/80 > PRODUCT=3D457/150/100 > TYPE=3D0/0/0 > PHYSDEVBUS=3Dusb > > Any help would be greatly appreciated! > > - Greg > > ------------------------------------------------------------------------- > 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/ > _______________________________________________ > 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 --nextPart2672598.FXCHN5ClTO Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBGS8KWR6LMutpd94wRApUhAKDVkGCYFp0QMQk/VZYhI9em+T9yfgCfVX6F KZPo/obKNhZAgPAM+x2QIiw= =1/8v -----END PGP SIGNATURE----- --nextPart2672598.FXCHN5ClTO-- --===============0072391894== 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/ --===============0072391894== 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 --===============0072391894==--