Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 145748 Details for
Bug 212265
lvm'd multipath'd iscsi luns don't shutdown properly
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
script to deactivate iscsi-based lv's
iscsi-deactivate-lvs (text/plain), 3.18 KB, created by
Dave Wysochanski
on 2007-01-16 22:30:18 UTC
(
hide
)
Description:
script to deactivate iscsi-based lv's
Filename:
MIME Type:
Creator:
Dave Wysochanski
Created:
2007-01-16 22:30:18 UTC
Size:
3.18 KB
patch
obsolete
>#!/bin/sh ># ># Flush iscsi-based Logical Volumes ># ># FIXME: Does not handle iscsi root ># > ># ># Description: Determine whether passed in device is an iscsi or is part of ># a dm device that has an iscsi device at a leaf node in the ># dm tree ># ># Parameters: ># $1 - device in question, in the following format: "major:minor" ># ># Return Values: ># 1 - is an iSCSI device, or is part of dm map that has iscsi devices ># 0 - not an iSCSI device, and not part of a dm map with iscsi devices ># >is_iscsi_map() >{ > dev=$1 > # > # First, check to see if this is a dm-device. If it is, we need > # to go through the tree to a leaf node > # > major=`echo $1 | awk -F ":" '{ print $1 }'` > minor=`echo $1 | awk -F ":" '{ print $2 }'` > dmcmd=`dmsetup deps -j $major -m $minor >& /dev/null` > # > # FIXME: Catch potential infinite recursion > # > # one danger here would be infinite recursion if, for some reason, > # the above dmsetup cmd would always return success... > # For this reason, we might want to consider a max depth variable > # or some other infinite recursion technique > # > if [ $? -eq 0 ]; then > # dm device > # echo "DBG: Is a dm device: $1" > # dependencies line looks like this: > # # dmsetup deps iscsi--vg0-iscsi--stripe--lv0 > # 3 dependencies : (253, 2) (253, 3) (253, 4) > deps=`dmsetup deps -j $major -m $minor | perl -ne 'if (/^\d+\s*dependencies\s*:\s*(.*)/) { $x = $1; $x =~ tr/[(,)]/[ , ]/; $x =~ s/,\s+/:/g; print $x; }else{print "not found"}'` > for dep in $deps; do > # echo "DBG: One dep is: $dep" > # need recursion here > is_iscsi_map $dep > if [ $? -eq 1 ]; then > return 1 > fi > done > # if we get here, then we know we are not an iscsi device or dm > # device with iscsi dependencies > return 0 > fi > > # echo "DBG: Not a dm device: $1" > # > # Ok, leaf node, so check to see if it's iscsi > # > dev_sds="`iscsi-ls -l | grep Device | awk '{print $2}'| sed -e 's%/dev/%%'`" > for dev_sd in $dev_sds; do > # check to see if major/minor matches > # for list, we can use: "cat /sys/block/$dev_sd/dev" > cur_dev=`cat /sys/block/$dev_sd/dev` > #echo "DBG: dev_sd: $dev_sd" > #echo "DBG: current dev: $cur_dev" > #echo "DBG: dev: $dev" > if [ $cur_dev == $dev ]; then > # echo "DBG: Found iscsi device map: $dev" > return 1 > fi > done > # no match found - maybe this is a dm device? > # use recursion here... > #echo "DBG: Not an iscsi device map: $dev" > return 0 >} > > ># ># Description: Find the iSCSI-based LVs and deactivate them. An iSCSI based ># LV is one which any iSCSI device is at the bottom of the dm ># device tree for that device. ># ># FIXME: Won't work with snapshots - need to filter these out and only deactivate ># origins ># ># FIXME: Won't work with more complex mappings (mirror on linear) ># >deactivate_iscsi_lvs() >{ > lvpaths=`lvs --noheadings -ovg_name,lv_name 2>/dev/null | awk '{ print $1 "/" $2 }'` > for onelv in $lvpaths; do > onedev=`lvs --noheadings -okernel_major,kernel_minor $onelv 2>/dev/null | awk '{ print $1 ":" $2 }'` > is_iscsi_map $onedev > if [ $? -eq 1 ]; then > echo "$onelv iSCSI based LV, deactivating" > echo lvchange -an $onelv > lvchange -an $onelv > else > echo "$onelv not iSCSI based LV, not deactivating" > fi > done >} > >deactivate_iscsi_lvs
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 212265
:
139412
|
139417
|
139418
|
139480
|
145748
|
145749
|
146233
|
146264
|
146457
|
411163
|
411399