Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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:

# zpool offline tank c1t3d0
# cfgadm | grep c1t3d0
sata1/3::dsk/c1t3d0            disk         connected    configured   ok
# cfgadm -c unconfigure sata1/3
Unconfigure the device at: /devices/pci@0,0/pci1022,7458@2/pci11ab,11ab@1:3
This operation will suspend activity on the SATA device
Continue (yes/no)? yes
# cfgadm | grep sata1/3
sata1/3                        disk         connected    unconfigured ok
<Physically replace the failed disk c1t3d0>
# cfgadm -c configure sata1/3
# cfgadm | grep sata1/3
sata1/3::dsk/c1t3d0            disk         connected    configured   ok
# zpool online tank c1t3d0
share|improve this answer
2  
In this example you will also need to run #zpool replace command to get your new disk in a good state else your new disk will be recognized but in a faulty state. –  user160959 Feb 20 '13 at 18:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.