[Linux-disciples] Re: hotplug issues (Adam Rosi-Kessel)

Brian Cooke brian at voodoochild.org
Mon Mar 7 19:58:34 EST 2005


>It sounds like you might misunderstand how hotplug works and what it's
>purpose is.
>
>  
>
That is probably the case.  Perhaps the real problem is that I don't 
know how to get the USB Drive to work at all without hotplug.  If I do

mount /dev/sda1 /mnt/ext_hd

..it tells me that sda1 is not a valid block device. This happens even 
with the usb_storage, ubscore, ide_core, and scsi_mod kernel modules 
already loaded.  I don't think autofs or something similar would be able 
to help here, would it?   After I run /etc/hotplug/usb.rc, and try 
mounting again, everything works OK.  All the documentation that I've 
found either suggests that USB drives should Just Work, or should Just 
Work With Hotplug.  So I kind of figured I needed hotplug.  But if there 
is a simpler/better way, I'm all for it. 

The drive is going to be attached to the computer all the time; I don't 
even care if it automounts when I plug it in.  I just need it to auto 
mount when the system boots up.

Brian

>If you want to see if hotplug is 'live', cat /proc/sys/kernel/hotplug.
>If there is something in there (/sbin/hotplug), then hotplug is active.
>The script in /etc/init.d just puts a value in /proc/sys/kernel/hotplug,
>to tell the kernel what to run to detect new devices and device changes.
>
>You don't need to keep running hotplug -- it's either 'on', or it's not.
>
>I'm not aware of any hotplug default functionality for automounting,
>though.  I think you could write a custom script such that when a new
>device was detected, hotplug called a mount script if it is a storage
>device--I actually did that once--but it's not really the right way to
>handle it.
>
>You probably want something at a higher level, like the automounter
>daemon (autofs), or the gnome automounter.  Check out, e.g.,
>gnome-volume-manager
><http://packages.debian.org/unstable/gnome/gnome-volume-manager>:
>
>  gnome-volume-manager is a GNOME daemon that acts as a policy agent in
>  top of the kernel, udev, d-bus and HAL. It listens to HAL events and
>  reacts with user-configurable actions. Currently it supports automount
>  of new media and hot-plugged devices, autorun, autoplay for CDs and
>  DVDs, and automatic camera management. It is expected to be simple and
>  free of polling and other evil hacks.
>
>On Sun, Mar 06, 2005 at 10:32:36PM -0500, Brian Cooke wrote:
>  
>
>>>What happens when you do those things?
>>>      
>>>
>>I don't get any results for any of the commands you listed below.  Do I 
>>need pci_hotplug installed in my kernel for this?  I was under the 
>>impression that I didn't need it if I only wanted to use hotplug for USB 
>>devices.
>>
>>    
>>
>>>What prompted you to check whether hotplug was working? Are
>>>you having troubles with USB devices?
>>>      
>>>
>>I got an external USB hard drive and I'll like it to mount automatically 
>>when the computer boots.  I have a hotplug script in my /etc/init.d/ 
>>directory, but I see no evidence that it is running (or attempting to 
>>run) despite the fact that is linked in the appropriate /etc/rc?.d 
>>directories.  So then I tried running the /etc/init.d/hotplug script 
>>manually, and I'm still not getting any output for start, stop, or 
>>status at the command line either.  I figure I will need to get it 
>>working from the command line before I can expect the startup scripts to 
>>run it...
>>
>>Brian
>>
>>    
>>
>>>When I look at
>>>
>>>dmesg |grep -i hotplug
>>>
>>>I get
>>>
>>>/*
>>>cpci_hotplug: CompactPCI Hot Plug Core version: 0.2
>>>pci_hotplug: PCI Hot Plug PCI Core version: 0.5
>>>*/
>>>
>>>When I do '/etc/init.d/hotplug start' or '[same thing] stop'
>>>I get no problems: I get the '[OK]' indicator that Ubuntu
>>>normally gives.
>>>
>>>When I do 'lsmod |grep -i plug', I get
>>>
>>>pci_hotplug            33680  2 shpchp,pciehp
>>>
>>>Finally, checking the contents of /var/log/syslog for
>>>anything matching 'hotplug' returns the same lines that
>>>dmesg gives.
>>>
>>>
>>>
>>>      
>>>
>>_______________________________________________
>>Linux-disciples mailing list
>>Linux-disciples at lists.bostoncoop.net
>>http://lists.bostoncoop.net/mailman/listinfo/linux-disciples
>>    
>>
>
>  
>



More information about the Linux-disciples mailing list