<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: need help to unmount file systems via script in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/need-help-to-unmount-file-systems-via-script/m-p/4380606#M35626</link>
    <description>Hi,&lt;BR /&gt;I don't have iscsi, but in fstab or /proc/mounts you have the mount point in position 2, so why not something like&lt;BR /&gt;for i in `cat /proc/mounts | grep "/dev/disk/by-path/ip-" | awk '{ print $2 }'&lt;BR /&gt;do&lt;BR /&gt;umount $i&lt;BR /&gt;if [ "$?" == "0" ] &lt;BR /&gt;then&lt;BR /&gt;echo "iSCSI LUNS umounted"&lt;BR /&gt;fi&lt;BR /&gt;done</description>
    <pubDate>Tue, 17 Mar 2009 06:00:42 GMT</pubDate>
    <dc:creator>smatador</dc:creator>
    <dc:date>2009-03-17T06:00:42Z</dc:date>
    <item>
      <title>need help to unmount file systems via script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/need-help-to-unmount-file-systems-via-script/m-p/4380605#M35625</link>
      <description>cat /proc/mounts  | grep "/dev/disk/by-path/ip-"&lt;BR /&gt;&lt;BR /&gt;/dev/disk/by-path/ip-192.168.0.206:3260-iscsi-iqn.2009-03.com.test:0ad96cc0-32f7-4804-a73c-11505b43db90-lun-0-part1 /ap_logs reiserfs rw 0 0&lt;BR /&gt;/dev/disk/by-path/ip-192.168.0.206:3260-iscsi-iqn.2009-03.com.test:f3b18583-2e34-470d-8993-96a36217d711-lun-0-part1 /db_logs reiserfs rw 0 0&lt;BR /&gt;/dev/disk/by-path/ip-192.168.0.206:3260-iscsi-iqn.2009-03.com.test:cb6ca23d-0ca2-40df-bfb3-feccbe8bfd6b-lun-0-part1 /ora reiserfs rw 0 0&lt;BR /&gt;&lt;BR /&gt;I want to write a script that unmounts all of the iSCSI LUNS&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/bin/bash&lt;BR /&gt;&lt;BR /&gt;cat /proc/mounts  | grep "/dev/disk/by-path/ip-"&lt;BR /&gt;if [ "$?" == "0" ] &lt;BR /&gt;   then echo "iSCSI LUNS are mounted...Unmounting all of the mounted iSCSI LUNS"&lt;BR /&gt;############################################&lt;BR /&gt;## here I need forum's help(script code), I &lt;BR /&gt;## mean how I can unmount all of the mounted &lt;BR /&gt;## iSCSI LUNS &lt;BR /&gt;############################################&lt;BR /&gt;   else echo "iSCSI LUNS not mounted"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Tue, 17 Mar 2009 03:52:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/need-help-to-unmount-file-systems-via-script/m-p/4380605#M35625</guid>
      <dc:creator>Maaz</dc:creator>
      <dc:date>2009-03-17T03:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: need help to unmount file systems via script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/need-help-to-unmount-file-systems-via-script/m-p/4380606#M35626</link>
      <description>Hi,&lt;BR /&gt;I don't have iscsi, but in fstab or /proc/mounts you have the mount point in position 2, so why not something like&lt;BR /&gt;for i in `cat /proc/mounts | grep "/dev/disk/by-path/ip-" | awk '{ print $2 }'&lt;BR /&gt;do&lt;BR /&gt;umount $i&lt;BR /&gt;if [ "$?" == "0" ] &lt;BR /&gt;then&lt;BR /&gt;echo "iSCSI LUNS umounted"&lt;BR /&gt;fi&lt;BR /&gt;done</description>
      <pubDate>Tue, 17 Mar 2009 06:00:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/need-help-to-unmount-file-systems-via-script/m-p/4380606#M35626</guid>
      <dc:creator>smatador</dc:creator>
      <dc:date>2009-03-17T06:00:42Z</dc:date>
    </item>
  </channel>
</rss>

