rmdev command

Latest response

AIX has a great command: rmdev.

 

Very useful to remove lun or disks before detach them. Reading the "Online storage guide" i made a script to do somethink like:

 

#!/bin/bash

# multipath -ll $1 not always works!!
WWID=`multipath -ll | grep -e "^$1 " | awk '{ print $2 }' | tr -d \( | tr -d \)`
multipath -ll $WWID > /tmp/"$1".txt

echo multipath -f $1
echo
cat /tmp/"$1".txt | grep active | grep ready | awk '{ print $3 }' | while read I;do echo blockdev --flushbufs /dev/$I;done
echo
cat /tmp/"$1".txt | grep active | grep ready | awk '{ print $3 }' | while read I;do echo echo 1 \> /sys/block/$I/device/delete ;done
echo
echo vi /etc/multipath.conf
echo
echo /etc/init.d/multipathd restart

 

It's very stupid, only shows command to execute but it simplify my life when I work with many luns with many path.

 

AIX "rmdev -dl" command is much better.

 

The same problem is present when we have to resize a lun.

I think some utilities to do basic operations on SAN lun's should be provided with an ENTERPRISE system like RHEL.

Responses

I think we deseve some proper sysadmin tools like lsdev, rmdev, cfgmgr, lscfg ... not something like rescan-blah-blah.sh or echo "blah x x x x" > /proc/scsi/scsi ...

Definitely in need of some proper SAN LUN management tools, all there is out there now are some half baked scripts that dont really work...having to reboot everytime to resize and add/drop LUN's is a terrible inconvenience.

https://access.redhat.com/discussion/common-storage-api-rhel-storage