In Solaris, if I unplug a couple disks while the machine is running, some functions that check every disk will take awhile because it has to wait for the timeout.
For example format
or zpool import
both read all the disks as one of the first things they do.
I counter-act this sometimes by the following: (I do of course replace zero with the correct numbers)
cd /dev/dsk
, mkdir offline
, mv c0t0d0* offline
,
cd ../rdsk
, mkdir offline
, mv c0t0d0* offline
.
At this point I can do whatever I want with format
and zpool import
and it will be much faster.
When the disks are re-inserted, I can then online them again with
cd /dev/dsk
, mv offline/* .
, rmdir offline
,
cd ../rdsk
, mv offline/* .
, rmdir offline
.
Is there a command for this? One that temporarily removes the symbolic links for a specified disk, as well as a way to put them back?
I am very happy with the solution I found. Especially because this machine is an offline machine, I can risk this level of manipulation. (for example, if I actually typed zero in the real thing, there would be trouble)
However, I would like to know about a better way if there is one.
Best Answer
The correct method is to use the
cfgadm
command to unconfigure the device before unplugging it. The ZFS Administration Guide has an example of this procedure (of course, you can ignore the ZFS steps if you're not using ZFS).Example from the guide pasted below: