Lofland bLOG

Adding & Removing Disks on HPUX

Filed under Unix Notes on Tuesday, February 28th, 2006 @ 2:40pm by Christen

Exercise. Disk is removed and /dev files wiped out, return the disk to HPUX:

diskinfo /dev/rdsk/c0t8d0

ioscan -funCdisk

disk 4 8/4.8.0 sdisk CLAIMED DEVICE SEAGATE ST34572WC
/dev/dsk/c0t8d0 /dev/rdsk/c0t8d0
(The U option tells ioscan to pull info from the kernel’s memory. It avoids actually scanning the hardware. This is faster, but it also means any changes won’t be found. If you take out the U, then it will scan the hardware, and if there was a change, it will find it. You may not want the system to find hardware changes sometimes, like if an array has gone offline temporarily.)

yank disk 8/4.8.0

ioscan -funCdisk
-still shows the disk as CLAIMED because of the U switch

ioscan -fnCdisk
-finds hardware changes, and returns “NO_HW” instead of “CLAIMED”
-Same thing would happen if anything had tried to read/write the disk


now use rmsf to revove the /dev files for the drive.
-If you ever need to remove a /dev file, don’t use rm, use rmsf (man is your friend)

(The example here is removing a Hitachi SAN disk)

ioscan will show you both the hardware address (That number with the /’s) and the /dev files for the hardware:

disk    101  0/0/10/0/0.1.0.5.0.10.0  sdisk    NO_HW       DEVICE       HITACHI DF600F
/dev/dsk/c34t10d0   /dev/rdsk/c34t10d0
To wipe out a piece of hardare run:
rmsf -a /dev/dsk/c0t8d0

(The -a option should cause this to also remove the /dev/rdsk file and it shoudln’t show up in ioscan -funCdisk anymore either)

Now ioscan will show no signs of the hardware.

If you don’t use the “-a” option then you have to remove both the /dev/dsk and the /dev/rdsk files individually. Then ioscan will STILL see the drive:

disk    101  0/0/10/0/0.1.0.5.0.10.0  sdisk    NO_HW       DEVICE       HITACHI DF600F
So then you must use the hardware address to remove the drive:

rmsf -H  0/0/10/0/0.1.0.5.0.10.0

put disk back in (or put in a new disk)

(The “replace” example here is a local disk, the “new” example is an EMC SAN disk.)

ioscan -fnCdisk
- finds hardware changes and recognizes disk again

Devices physically attached to the system should automatically show up when you run ioscan without the “u” option, as above. However, there are no /dev files for things like disks, so you can’t use them yet.

insf is used to replace the /dev files
(opposite of rmsf)
insf -e is just like box rebooted, it tries to install EVERYTHING, if you don’t remember the hardware path, and youc an do that.
or
insf -e -Cdisk will JUST do the disks, instead of the entire box
or
insf -e -H 8/4.8.0 if you know the hardware address, this is right out of ioscan

Again:
disk     49  0/0/8/0/0.3.0.3.0.4.7    sdisk    CLAIMED     DEVICE       EMC     SYMMETRIX
insf -e -H 0/0/8/0/0.3.0.3.0.4.7

disk     49  0/0/8/0/0.3.0.3.0.4.7    sdisk    CLAIMED     DEVICE       EMC     SYMMETRIX
/dev/dsk/c29t4d7   /dev/rdsk/c29t4d7
Another good command to check that all disks are there:

for i in `ls /dev/dsk/*`;do pvdisplay $i;done

To check for disks that are not being used use diskinfo instead of pvdisplay:

for i in `ls /dev/rdsk/*`;do diskinfo $i;done

3 Comments »

  1. Thank you!!!!

    Comment by James Drane — October 10, 2007 @ 10:03 am

  2. Thanks. Very good.
    I not speak english. Me sirvio bastante. Muchas gracias.

    Comment by Patricio — November 20, 2007 @ 3:55 pm

  3. Thanks . This really helped

    Comment by Chimbu — June 11, 2008 @ 2:14 pm

RSS feed for comments on this post. TrackBack URI

Leave a comment

Powered by WordPress