Operating System - HP-UX
1826214 Members
2705 Online
109691 Solutions
New Discussion

Extra device files in /dev/dsk

 
SOLVED
Go to solution
Greg Stark_1
Frequent Advisor

Extra device files in /dev/dsk

While writing a script, I noticed there are some device files in /dev/dsk that don't seem to be associated with any disk/luns?

For instance:
# ls /dev/dsk
c1t2d0 c3t2d0 c5t0d1 c5t1d1 c6t0d1 c6t1d1
c2t2d0 c5t0d0 c5t1d0 c6t0d0 c6t1d0

# ioscan -funC disk
Class I H/W Path Driver S/W State H/W Type Description
=====================================================================
disk 0 0/0/1/1.2.0 sdisk CLAIMED DEVICE SEAGATE ST39103LC
/dev/dsk/c1t2d0 /dev/rdsk/c1t2d0
disk 1 0/0/2/0.2.0 sdisk CLAIMED DEVICE SEAGATE ST39102LC
/dev/dsk/c2t2d0 /dev/rdsk/c2t2d0
disk 2 0/0/2/1.2.0 sdisk CLAIMED DEVICE HP DVD-ROM 6x/32x
/dev/dsk/c3t2d0 /dev/rdsk/c3t2d0
disk 4 0/4/0/0.1.0 sdisk CLAIMED DEVICE HP C5447A
/dev/dsk/c5t1d0 /dev/rdsk/c5t1d0
disk 8 0/4/0/0.1.1 sdisk CLAIMED DEVICE HP C5447A
/dev/dsk/c5t1d1 /dev/rdsk/c5t1d1
disk 5 0/7/0/0.0.0 sdisk CLAIMED DEVICE HP C5447A
/dev/dsk/c6t0d0 /dev/rdsk/c6t0d0
disk 9 0/7/0/0.0.1 sdisk CLAIMED DEVICE HP C5447A
/dev/dsk/c6t0d1 /dev/rdsk/c6t0d1

As you can see, c5t0d0, c5t0d1, c6t1d0, and c6t1d1 don't seem to have a disk/lun associated with them.

If these are no longer needed, what is the correct way to remove them, or should they be removed?

Thanks again,
Greg
5 REPLIES 5
S.K. Chan
Honored Contributor
Solution

Re: Extra device files in /dev/dsk

Removing device files ..

# rmsf /dev/dsk/c5t0d0
# rmsf /dev/rdsk/c5t0d0

You can also double check with ..

# /etc/diskinfo /dev/rdsk/c5t0d0

before you proceed with the removal
Jeff Machols
Esteemed Contributor

Re: Extra device files in /dev/dsk

unless there is a huge need to remove them, I would leave them. If you are having problems with a script that needs all the disks, I would either use

strings /etc/lvmtab | grep dsk (give you all the disks in volume groups)

or ioscan -funC disk | grep dsk | awk '{print $1}' (or $2 depending on if you want charcter or raw devide)
Sridhar Bhaskarla
Honored Contributor

Re: Extra device files in /dev/dsk

Hi,

This is the small script I run to clean up the unwanted device files.

cd /dev/dsk
for i in `ls`
do
P=`lssf $i |awk '{print $13}'`
if [ "$P" = "???" ]
then
echo $i $P
rmsf /dev/dsk/$i
rmsf /dev/rdsk/$i
fi

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Helen French
Honored Contributor

Re: Extra device files in /dev/dsk

Hi,

If it is not necessary, you may leave the /dev/dsk files as it is. You have to be careful while removing any files from /dev directory. Double check the output of 'ioscan -fn', diskinfo etc.

You can use rmsf (remove special file) to remove these files. check man rmsf and good luck !

HTH,
Shiju
Life is a promise, fulfill it!
Deshpande Prashant
Honored Contributor

Re: Extra device files in /dev/dsk

HI
The unwanted device files can be safely removed.
The files in /dev/dsk/* that return with "???" as their path instead of a valid path can be removed.

Thanks.
Prashant.
Take it as it comes.