-   Linux - Hardware (
-   -   Adding drives to Linux without reboot (

SolMan 12-14-2004 05:57 AM

Adding drives to Linux without reboot
More used to Solaris, but was wondering if you could add a disk "on the fly".

Say you start up your Linux box (with a connection to a SAN through a HBA).
Now you add more LUNs to the machine (you zone / LUN Mask) .

The next step is to get Linux to see the new disk (without rebooting)

In Solaris, I would have done a "devfsadm" . What do I do in Linux ?

Is it at all possible ? or not with the current /dev structure being build when the machine boots ?


mhiggins 12-14-2004 10:05 PM

For one, /dev/ is not fixed, and most systems do not build dev at boot, as drivers are loaded they attach to devices nodes but this can happen at any time. Some newer distros use udev but this only extends the existing model. In Linux like solaris /dev/ exposes kernel services / resources as
FIFO's, block, or char devices. These special files may or may not have anything on the other side (Kernel Side). If the HBA is working correctly when you add the new device you can check if the lowlevel driver reported that addition of the device by running dmesg.
If all goes well you can access the device at the appropriate dev node /dev/sd? if there are not enough /dev/sd devices you can use mknod to make a new one.

SolMan 12-17-2004 04:24 AM


Now the big question.

A node (let's say /dev/sde) gets created when the machine starts up.

Now, something happens to the path that the disk (/dev/sde) points at (loss of switch). This path comes stale.

When you try and get anything on this device (fdisk, sfdisk, dd, ........), nothing works (does not want to read geometry, etc. ....).

You now know there is a fault on the path to the disk. You fix the switch, and now your path should come back (???). Guess what. It does not !!!!

You can use the HBA utilities to make sure the disk is there (yep, reads the WWNN), but as soon as you go to access the disk via the path (/dev/sde), you still have the same issues (as if the disk is not connected).

On Solaris, I would have doine "devfsadm" and the Solaris kernel will update the device tree to reflect the device as being available again.

What do I do in Linux ?

How can I get this disk back (without rebooting) ?

If I unload the SCSI driver, I might as well reboot the macihne. Should i remake the node ?


All times are GMT -5. The time now is 01:21 PM.