AIX 6/7 Script to create a file with commands to remove missing and failed paths

To create a file with commands to remove the missing paths

1
2
3
4
5
6
7
8
9
#!/bin/sh
# rmpaths
>xrmpaths
echo "#!/bin/sh" >>xrmpaths
disks=$(lspv | awk '{print $1}')
for loop in $disks
do
lspath -l $loop -H -F "name:parent:connection:status" |grep Missing| awk -F: '{print "rmpath -dl",$1,"-p", $2, "-w", $3}'>>xrmpaths
done

 

To create a file with commands to remove the failed paths

1
2
3
4
5
6
7
8
9
#!/bin/sh
# rmpaths
>xrmpaths
echo "#!/bin/sh" >>xrmpaths
disks=$(lspv | awk '{print $1}')
for loop in $disks
do
lspath -l $loop -H -F "name:parent:connection:status" |grep Failed| awk -F: '{print "rmpath -dl",$1,"-p", $2, "-w", $3}'>>xrmpaths
done
5 (1)
Article Rating (1 Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
Using AIX VG mirroring in combination with hardware snapshots
Viewed 5331 times since Sat, May 25, 2019
Using Shell Redirection: All About the Here-Doc
Viewed 10562 times since Wed, May 30, 2018
Altering LVM Configuration When a Disk is Not in ODM Anymore
Viewed 3359 times since Mon, Jun 3, 2019
Mirroring the rootvg Volume Group for AIX 4.1/4.2
Viewed 3279 times since Mon, May 21, 2018
0516-404 allocpThis system cannot fulfill the allocation
Viewed 10261 times since Thu, Sep 20, 2018
AIX lspath Missing path
Viewed 10341 times since Fri, Oct 5, 2018
AIX HA / HACMP, System Admin↑ Mountguard
Viewed 7284 times since Mon, Jun 3, 2019
AIX, Networking Etherchannel failover testing
Viewed 2949 times since Fri, Apr 19, 2019
AIX disk queue depth tuning for performance
Viewed 15876 times since Thu, Jan 16, 2020
AIX, Storage, System Admin Allocating shared storage to VIOS clients
Viewed 2499 times since Fri, Apr 19, 2019