missing disk change notification in 2.4 kernels ?

Peter L. Peres plp-ysDPMY98cNQDDBjDh4tngg at public.gmane.org
Sat Oct 23 17:01:15 UTC 2004


On Sat, 23 Oct 2004, Anton Markov wrote:

> Peter L. Peres wrote:
>> in 2.2 and earlier kernels, insertion of media into a drive would send a 
>> notification event to syslog. This does not happen anymore with 2.4 
>> kernels ? What is the equivalent option ? E.g. how do I cause media 
>> insertion to cause a hotplug or equivalent event in a 2.4 series kernel 
>> (preferrably without recompiling the kernel) ? I have looked into kernel 
>> documentation but no clues so far. I did not look at the source yet.
>
> If you are talking about CD-ROM/floppy drives, then I don't think there is 
> such a mechanism any more. I think there is a sysfs variable that can be 
> queried for this information, but you still have to check the variable 
> yourself. Of course I could be wrong.

Ow. Apparently you are right ;-(

> If you are just looking for a way to automatically mount the media, there are 
> still kernel supermount patches floating around on the net. They are not 
> perfect, but will allow you to use a CD/Floppy without using mount/unmount 
> commands (much like Windows).

I need something that exists in stock kernels (2.4). I cannot rely on 
patching the kernel or recompiling it.

> For the 2.6 kernels, Con Kolivas has an up-to-date supermount patch on his 
> patch page:
> <http://members.optusnet.com.au/ckolivas/kernel/>
> Follow the "all patches" link, look for the desired kernel version, and look 
> in the "patches" directory for the separate supermount patch.

Ok, thanks. I will look at it anyway.

> I am not sure where to get supermount for the 2.4 kernel.
>
> Note: I've heard a lot of people having various problems with supermount. 
> I've personally never had a problem with it (except that it takes a long time 
> to check my DVD drive for media), but there are probably good reasons it was 
> not included in the stock kernel.

The historical reason was that media detection was broken in many drives. 
This may still be true. You would have things like cdroms not detecting 
disk change under certain conditions and floppies that would double detect 
media changes and such.

This is not an easy thing to do because these devices do not have a 
builtin mechanism for signalling media change. In most cases it needs to 
be polled, by the kernel, or in user space. You said for yourself, that 
your system takes a long time to detect a new media insertion. If this 
worries you, the competition can take up to 10 seconds to identify and 
initialise interfaces for, f.ex. a IEEE1394 device. (by competition I mean 
XP).

thanks,

Peter
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list