1826507 Members
3007 Online
109694 Solutions
New Discussion

Remove disk device files

 
SOLVED
Go to solution
Dewa Negara_1
Advisor

Remove disk device files

I found on my 10.20 system some NO_HW disk device from ioscan. This output because someone had removed some disks without removing device files as well. Some of them can be deleted using command rmsf -H , but I noticed that an hardware with device files /dev/dsk/cXtYdZ,/dev/rdsk/cXtYdZ,/dev/floppy/cXtYdZ,/dev/rfloppy/cXtYdZ can be deleted using rmsf command. I'm not so sure what /dev/floppy device files and why can be deleted. Anyone can help me on this. Thanks alot in advance.

Rgds,
Dewa Negara

target 13 10/4/12.11 target NO_HW DEVICE
disk 64 10/4/12.11.0 disc3 NO_HW DEVICE EMC SYMMETRIX
/dev/dsk/c2t11d0 /dev/floppy/c2t11d0 /dev/rdsk/c2t11d0 /dev/rfloppy/c2t11d0
disk 65 10/4/12.11.1 disc3 NO_HW DEVICE EMC SYMMETRIX
/dev/dsk/c2t11d1 /dev/floppy/c2t11d1 /dev/rdsk/c2t11d1 /dev/rfloppy/c2t11d1
disk 66 10/4/12.11.2 disc3 NO_HW DEVICE EMC SYMMETRIX
/dev/dsk/c2t11d2 /dev/floppy/c2t11d2 /dev/rdsk/c2t11d2 /dev/rfloppy/c2t11d2
disk 67 10/4/12.11.3 disc3 NO_HW DEVICE EMC SYMMETRIX
/dev/dsk/c2t11d3 /dev/floppy/c2t11d3 /dev/rdsk/c2t11d3 /dev/rfloppy/c2t11d3
disk 68 10/4/12.11.4 disc3 NO_HW DEVICE EMC SYMMETRIX
/dev/dsk/c2t11d4 /dev/floppy/c2t11d4 /dev/rdsk/c2t11d4 /dev/rfloppy/c2t11d4
disk 69 10/4/12.11.5 disc3 NO_HW DEVICE EMC SYMMETRIX
/dev/dsk/c2t11d5 /dev/floppy/c2t11d5 /dev/rdsk/c2t11d5 /dev/rfloppy/c2t11d5
disk 70 10/4/12.11.6 disc3 NO_HW DEVICE EMC SYMMETRIX
/dev/dsk/c2t11d6 /dev/floppy/c2t11d6 /dev/rdsk/c2t11d6 /dev/rfloppy/c2t11d6
disk 71 10/4/12.11.7 disc3 NO_HW DEVICE EMC SYMMETRIX
/dev/dsk/c2t11d7 /dev/floppy/c2t11d7 /dev/rdsk/c2t11d7 /dev/rfloppy/c2t11d7
target 14 10/4/12.12 target NO_HW DEVICE
disk 72 10/4/12.12.0 disc3 NO_HW DEVICE EMC SYMMETRIX
/dev/dsk/c2t12d0 /dev/floppy/c2t12d0 /dev/rdsk/c2t12d0 /dev/rfloppy/c2t12d0
disk 73 10/4/12.12.1 disc3 NO_HW DEVICE EMC SYMMETRIX
/dev/dsk/c2t12d1 /dev/floppy/c2t12d1 /dev/rdsk/c2t12d1 /dev/rfloppy/c2t12d1
disk 74 10/4/12.12.2 disc3 NO_HW DEVICE EMC SYMMETRIX
/dev/dsk/c2t12d2 /dev/floppy/c2t12d2 /dev/rdsk/c2t12d2 /dev/rfloppy/c2t12d2
disk 75 10/4/12.12.3 disc3 NO_HW DEVICE EMC SYMMETRIX
/dev/dsk/c2t12d3 /dev/floppy/c2t12d3 /dev/rdsk/c2t12d3 /dev/rfloppy/c2t12d3
log all your daily activities on syslog.log every time...
14 REPLIES 14
Sridhar Bhaskarla
Honored Contributor

Re: Remove disk device files

Depending on the type of Hardware you have, the floppy drive may be using disc3 driver. So, it is natural for the floppy devices files to appear along with the disk device files.

You can get rid of the device files using "rmsf" command, but you cannot get rid of the corresponding pointers in the kernel tree. A reboot is needed to clear the entries.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Ceesjan van Hattum
Esteemed Contributor

Re: Remove disk device files

rm /dev/dsk/c*
rm /dev/rdsk/c*
insf -e
ioscan -fCdisk

i don't know about floppy, but it should work the same way..
Regards,
Ceesjan
Juan Manuel López
Valued Contributor
Solution

Re: Remove disk device files


Use:

> for i in `ioscan -funC disk | grep -v grep | grep NO_HW | awk '{ print $3 }'`

> do

> rmsf -k -H $i

> done

This little program will erase all the device files that are not connect ( NO_HW ) on your system.

Try it.

Juanma.
I would like to be lie on a beautiful beach spending my life doing nothing, so someboby has to make this job.
Frank Slootweg
Honored Contributor

Re: Remove disk device files

*Which* *exact* rmsf(1M) command did you give (i.e. which options and parameters) and *which* error message(s) did you get?

If you want to remove specific device files, then do a "rmsf -a /dev/...".

Do *not* use rm(1) to remove device files. rm(1) does not remove the system definition (from ioconfig).
Tom Danzig
Honored Contributor

Re: Remove disk device files

As root:

ioscan -fnC disk | grep NO_HW | awk '{print $3}' | xargs -i -t rmsf -H {}

Re: Remove disk device files

You may wanna try rebooting the system and check if those devices are still there when you do an ioscan -funC disk.
Dewa Negara_1
Advisor

Re: Remove disk device files

Hi Guys,
Thanks alot for all information. Actually I have tried to use rmsf -k -H command, but still can NOT remove the device files that using disc3 driver as below. For all device files that using driver sdisk, this command is working well. I'm considering to reboot the server and see whether the device files have been removed. Thanks again.

[root@sihp8020:/root]
# for i in `ioscan -fnC disk | grep NO_HW | awk '{print $3}'`
> do
> echo "Removing HW_PATH $i"
> rmsf -k -H $i
> done
Removing HW_PATH 10/4/12.2.7
Removing HW_PATH 10/4/12.3.0
Removing HW_PATH 10/4/12.3.1
Removing HW_PATH 10/4/12.3.2
Removing HW_PATH 10/4/12.3.3
Removing HW_PATH 10/4/12.3.4
Removing HW_PATH 10/4/12.3.5
Removing HW_PATH 10/4/12.3.6
Removing HW_PATH 10/4/12.3.7
Removing HW_PATH 10/4/12.4.0
Removing HW_PATH 10/4/12.4.1
Removing HW_PATH 10/4/12.4.2
Removing HW_PATH 10/4/12.4.3
Removing HW_PATH 10/4/12.10.7
Removing HW_PATH 10/4/12.11.0
Removing HW_PATH 10/4/12.11.1
Removing HW_PATH 10/4/12.11.2
Removing HW_PATH 10/4/12.11.3
Removing HW_PATH 10/4/12.11.4
Removing HW_PATH 10/4/12.11.5
Removing HW_PATH 10/4/12.11.6
Removing HW_PATH 10/4/12.11.7
Removing HW_PATH 10/4/12.12.0
Removing HW_PATH 10/4/12.12.1
Removing HW_PATH 10/4/12.12.2
Removing HW_PATH 10/4/12.12.3

[root@sihp8020:/root]
# ioscan -fnC disk | grep NO_HW
disk 27 10/4/12.2.7 disc3 NO_HW DEVICE EMC SYMMETRIX
disk 28 10/4/12.3.0 disc3 NO_HW DEVICE EMC SYMMETRIX
disk 29 10/4/12.3.1 disc3 NO_HW DEVICE EMC SYMMETRIX
disk 30 10/4/12.3.2 disc3 NO_HW DEVICE EMC SYMMETRIX
disk 31 10/4/12.3.3 disc3 NO_HW DEVICE EMC SYMMETRIX
disk 32 10/4/12.3.4 disc3 NO_HW DEVICE EMC SYMMETRIX
disk 33 10/4/12.3.5 disc3 NO_HW DEVICE EMC SYMMETRIX
disk 34 10/4/12.3.6 disc3 NO_HW DEVICE EMC SYMMETRIX
disk 35 10/4/12.3.7 disc3 NO_HW DEVICE EMC SYMMETRIX
disk 36 10/4/12.4.0 disc3 NO_HW DEVICE EMC SYMMETRIX
disk 37 10/4/12.4.1 disc3 NO_HW DEVICE EMC SYMMETRIX
disk 38 10/4/12.4.2 disc3 NO_HW DEVICE EMC SYMMETRIX
disk 39 10/4/12.4.3 disc3 NO_HW DEVICE EMC SYMMETRIX
disk 63 10/4/12.10.7 disc3 NO_HW DEVICE EMC SYMMETRIX
disk 64 10/4/12.11.0 disc3 NO_HW DEVICE EMC SYMMETRIX
disk 65 10/4/12.11.1 disc3 NO_HW DEVICE EMC SYMMETRIX
disk 66 10/4/12.11.2 disc3 NO_HW DEVICE EMC SYMMETRIX
disk 67 10/4/12.11.3 disc3 NO_HW DEVICE EMC SYMMETRIX
disk 68 10/4/12.11.4 disc3 NO_HW DEVICE EMC SYMMETRIX
disk 69 10/4/12.11.5 disc3 NO_HW DEVICE EMC SYMMETRIX
log all your daily activities on syslog.log every time...
Juan Manuel López
Valued Contributor

Re: Remove disk device files

Try to execute the command rmsf only on one device, and tell us what happend.

So, please, do NOT forget to give us points.

Thanks.

Juanma.
I would like to be lie on a beautiful beach spending my life doing nothing, so someboby has to make this job.
Dewa Negara_1
Advisor

Re: Remove disk device files

Juanma,

I tried to run rmsf -a on each device files, but it's still can NOT be removed. When run ioscan, it's still there without device files. Pls help.

Thanks.
Dewa

[root@sihp8020:/root]
# rmsf -a /dev/dsk/c2t12d0

[root@sihp8020:/root]
# rmsf -a /dev/rdsk/c2t12d0

[root@sihp8020:/root]
# rmsf -a /dev/rfloppy/c2t12d0

[root@sihp8020:/root]
# rmsf -a /dev/floppy/c2t12d0

[root@sihp8020:/root]
# ioscan -fnC disk | more
disk 72 10/4/12.12.0 disc3 NO_HW DEVICE EMC SYMMETRIX

log all your daily activities on syslog.log every time...
Juan Manuel López
Valued Contributor

Re: Remove disk device files

Then I suggest you to reboot the machine !.

I hope this help you.

Juanma.
I would like to be lie on a beautiful beach spending my life doing nothing, so someboby has to make this job.
Frank Slootweg
Honored Contributor

Re: Remove disk device files

If you have not yet rebooted the machine, then re-run the ioscan with the (added) option "-k" and "-u" (one option at a time).

I think that one of these will probably not list the removed path(s).
Sridhar Bhaskarla
Honored Contributor

Re: Remove disk device files

Hi Dewa,

As I mentioned before, you can only get rid of the device files with "rmsf" but not the pointers in the kernel IO tree. So, you will still see NO_HW associated with those paths until you reboot the server.

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

Re: Remove disk device files

You assigned points and that *is* appreciated, but please *also* report which solution(s) worked and why. Thanks.

[Please no (0) points for this response.]
Dewa Negara_1
Advisor

Re: Remove disk device files

Frank,

To remove the device files, I ran rmsf -H ,hw_path>, but NO_HW can not be deleted from ioscan. So as the suggestion, I will reboot the server soon. This server is a production server. So I need to schedule for rebooting the server. I will update you guys after rebooting.

Thanks alot for all suggestions.

Regards,
Dewa
log all your daily activities on syslog.log every time...