KDE3 - KDE4 - hot plug discs ?

Duncan 1i5t5.duncan at cox.net
Wed May 30 09:43:26 BST 2012


Anne Wilson posted on Tue, 29 May 2012 15:56:00 +0100 as excerpted:

> I would have thought that a hot-plug device would look, to the system,
> like a removable drive.

AFAIK, this is a very commonly held misconception, as the "removable" 
attribute refers to the media itself, not the full device.

Think of it this way:

* Optical media comes out of the device (the CD/DVD reader), so it's 
removable.

* Various magnetic-media zip drives, ls120 (IIRC that's what they were 
called, 120 MB removable media, like zip, was supposed to replace the 
floppy) drives, sparq drives (I had a sparq, IIRC 1 GB capacity, at one 
point) are removable, since the media physically comes out of the drive, 
which stays behind.

* Conventional 2.88 MB and smaller floppies would be removable, except 
they predate the standard and work on a different bus, the floppy bus.

* USB thumbdrives aren't removable (tho sometimes their firmware lies and 
says they are), despite being hotpluggable, because the media doesn't 
come out of the "drive", the drive itself detaches.

* Similarly, the common "portable USB drives" aren't removable, since the 
drive itself detaches, the media staying in it.


Meanwhile, these days pretty much everything (well, we're talking block 
devices here, but the same idea applies to most devices in general, these 
days, even sound and graphics cards are USB-attachable these days) is 
hotplug-capable in one form or another.  Obviously anything USB-attached 
is, but so are ESATA devices.  Actually, most internal SATA devices are 
electronically hotpluggable as well, even if they're screwed into the 
case.  I think it's actually part of the SATA standard so a SATA device 
that's not hotpluggable isn't standard-compliant, but I could be wrong.  
Certainly SCSI devices are hotpluggable and I'm almost certain it's part 
of that standard.  IEEE-1394 (aka firewire) is of course hotpluggable as 
well.

The kernel actually deals with SATA bus malfunctions (and I think even 
legacy PATA, these days, at least if the libata interface is used, the 
legacy ide interface may not, however) by resetting the device, such that 
it's redetected and reappears in the system.  If the device was mounted 
when it was removed/reset and it reappears soon enough, it's actually 
often possible for the kernel to resume an I/O transaction, even a write 
given a journaled filesystem like ext3/4/reiserfs/xfs/jfs or a "dancing 
tree" filesystem like reiser4/btrfs, without damage and without the 
userspace application even necessarily knowing (tho udev/udisks of course 
knows).

Given that a modern kernel must be and generally is prepared for devices 
to appear/disappear at any time, there really isn't that much (if any) 
distinction between hotplugged and not-hotplugged, any more.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman

___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.




More information about the kde mailing list