From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wout Mertens Date: Tue, 09 Dec 2003 09:05:29 +0000 Subject: Re: Working on a usb-storage hotplug script Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Hi, I was wondering what the current state of auto-mount-inserted-devices is. I posted my script which is run as a hotplug agent for storage some time ago, someone else had one along the same lines, Mandrake uses devfsd to call their configuration scripts and the fstab editor, Lindows has something, Suse as well, there is the vold project which uses polling, ... It sometimes seems that everyone and their brother has their own solution :( Is there some standardized way of solving this in the works? Perhaps based on sysfs? Issues I know of hotplug-automounting in the 2.4 world: - When run by usb.agent, you need to have a different name than the kernel module usb-storage, because otherwise you only get called when that module isn't loaded. - When run by usb.agent, you don't know what the device is that sd_mod made out of it. You need to either check all attached devices or do some creative grepping on the serial number and hope that the device is unique at this point in time. - When run by devfsd, you only get called when sd_mod is loaded. If it doesn't get loaded for some reason, you don't get called. - sd_mod is very bad about detecting when a device has gone or replaced by another. You need to kick it with something like "dd if= of=/dev/null bsQ2 count=1" for it to see new partition layouts. This can be done from devfsd though. Can it be done from udev? - If you don't use supermount to mount the devices, unplugging them without closing all filedescriptors (including standing in subdirs) makes the kernel upset, and you have to umount -l or -f. Only, supermount is a hack that changes Unix semantics :(. Comments? Wout. Nov 30, an infinite number of monkeys worshipping Greg KH pounded out: > On Fri, Nov 28, 2003 at 05:19:30PM -0800, Martin wrote: > > I recently got my first USB flash drive - I have one on loan from work, > > but I finally OWN one, so I am motivated to do something with it now. > > One of the things I want to have working is hotplugging, with automatic > > mounting. The device it's mounted on doesn't matter so much but one of > > the absolutely mandatory requirements is that I not need a fstab entry. > > This became a requirement when I noticed that plugging the device in, > > then unplugging it, then plugging it BACK in resulted in it being > > attached first to sdc and then to sdd. (This is a SCSI system.) > > Have you looked at devlabel? It should solve your problem for you. > > thanks, > > greg k-h > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > 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 > ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click _______________________________________________ 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