Problems with Hot-Swap and Disk Replacement
One of the biggest problems with hot-swapping or replacing devices under Linux (and many other Unix systems) stems from device naming. On an ATA system, Linux assigns the first drive on the first controller to /dev/hda. Subsequently detected devices are named in the order in which they are detected, using the same naming scheme. Thus, the slave device on the primary channel is assigned /dev/hdb, and the master and slave devices on the secondary channel are assigned /dev/hdc and /dev/hdd, respectively.
ATA is unique because of its legacy master and slave arrangement. If a device that was initially detected during installation suddenly disappears from a system, the naming order isn’t affected. If /dev/hdb suddenly dies, and the system reboots, /dev/hda, /dev/hdc, and /dev/hdd will still be assigned the same device names.
One exception to this rule is systems that have add-on ATA channels via PCI cards. If an entire card is removed, or fails, the detection order will change. Let’s say that a system has two ATA/100 PCI controllers, each with two channels. The first card, containing two disks that are assigned /dev/hde and /dev/hdf, fails. Naturally, users and applications will no longer be able to access data on those disks. The problem is further complicated when the system reboots and assigns device names. Because the first PCI controller isn’t detected this time, the disks on the second controller now have their device names shifted down ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access