Pages

04 February 2016

iSCSI connection failure in RHEL / Linux

Condition

We're running a Dell PowerVault MD3600i iSCSI connection to a RHEL server. From time to time (rarely but more frequently than I like it) it seems to lose the mount and needs intervention.

Herewith the script that I've written to repair the lost mount connection - hope it's useful for someone. 

Script solution

Run a cronjob to check the mount exists and if not, perform a mount repair...
(note the *** portions of the below script are going to be different for your personal setup)

if grep -qs /data /proc/mounts; then
date >> /usr/local/sbin/logs/checkdatamount.log
echo "/data is mounted" >> /usr/local/sbin/logs/checkdatamount.log
echo "---" >> /usr/local/sbin/logs/checkdatamount.log
else
date >> /usr/local/sbin/logs/checkdatamount.log
echo "!!! /data is NOT mounted !!!" >> /usr/local/sbin/logs/checkdatamount.log
echo "^^^" >> /usr/local/sbin/logs/checkdatamount.log
echo "attempting repair" >> /usr/local/sbin/logs/checkdatamount.log
echo "..." >> /belfry/logs/checkdatamount.log
iscsiadm --m node -T iqn.1984-05.com.dell:powervault.md3600i.6f0******2d788ac --portal 10.***.***.1**:3260 -u
iscsiadm -m discovery -t st -p 10.***.***.1**
iscsiadm -m node --targetname "iqn.1984-05.com.dell:powervault.md3600i.6f0******2d788ac" --portal "10.***.***.1**:3260" --login
iscsiadm -m session
vgchange -an MD3600i***01
vgchange -ay MD3600i***01
mount /dev/mapper/MD3600i***01-MD3600i***Vol01 /data
echo "... repaired (possibly)" >> /belfry/logs/checkdatamount.log
fi

2 comments:

  1. You did really good work. I really appreciate your new and different post. Please guys keep it up and share with us some unique post in the future

    www dell support

    ReplyDelete
  2. Lucky Club Casino Site - luckyclub.live
    Lucky Club Casino Review ✓ Live Casino and a Welcome Bonus. Lucky Club Casino is luckyclub.live the perfect place to play video poker. Rating: 4 · ‎Review by luckyclub.live

    ReplyDelete

Sorry about the lack of embedded comment pages, but it won't work on BLOGGER for some reason... :(