Hot answers tagged hot-plug
6
Naturally, you need to unmount any filesystems on the disk, and it'd be a good idea to deactivate any LVM groups (vgchange -an), and generally make sure nothing is using the disk for anything.
Once you've done that, it should be safe to unplug. If you want to be extra cautious, do echo 1 > /sys/block/(whatever)/device/delete first. That'll unregister ...
3
Those two sections are for different things.
The first is for unplugging. The second is for plugging.
For unplugging, the OS will sync the data during the unmount operation. Thus, if the disk is unmounted (assuming you in fact do have full hardware support) you can power off the disk then unplug it without risk of data loss or corruption.
For plugging, ...
3
I think you're looking for pmount.
If you want automatic mounting upon insertion, see Automounting USB sticks on Debian. The program that reacts when a new device appears is udev, so automatic mounted is triggered by a udev rule. The usbmount package provides udev rules to automatically mount USB storage devices and a few others.
You cannot automatically ...
1
The answer from Iain Dawson covers the userland part. In the kernel proper the handling of hotplug is integrated all over the place. Some infrastructure is present in the base kernel, but hotplugging has to be handled in each device driver, so there is no set of modules responsible for this.
Only top voted, non community-wiki answers of a minimum length are eligible