If you are unable to remove any device using rmdev, then how do I find out which process is using this device.

Error Message
[root@testvio]:/home/padmin># rmdev -dl hdisk1
Method error (/usr/lib/methods/ucfgdevice):
0514-062 Cannot perform the requested function because the
specified device is busy.

[root@testvio]:/home/padmin>#

Solution

The below script would help you to find out the process being used

for i in `lsdev -C |grep -w hdisk1 | awk ‘{print $1}’`
do
fuser /dev/$i
done

Example

[root@testvio]:/home/padmin># for i in `lsdev -C |grep -w hdisk1 | awk ‘{print $1}’`
> do
> fuser /dev/$i
> done
/dev/hdisk1: 2532821
[root@testvio]:/home/padmin>#

[root@testvio]:/home/padmin># proctree 2532821
2532821 /usr/bin/topas_nmon -ftO^d -s120 -c720 -youtput_dir=/work/testvio -ystart_ti
[root@testvio]:/home/padmin>#

[root@testvio]:/home/padmin># kill -9 2532821

[root@testvio]:/home/padmin>#

[root@testvio]:/home/padmin># rmdev -dl hdisk1
hdisk1 deleted
[root@testvio]:/home/padmin>#