- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- pvchange -t script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2003 04:05 AM
тАО10-28-2003 04:05 AM
for i in 'cat /tmp/outputfile'
do
pvchange -t 90 /dev/dsk/######
done
But can't get the syntax down correctly. Appreciate any help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2003 04:09 AM
тАО10-28-2003 04:09 AM
Re: pvchange -t script
do
pvchange -t 90 /dev/dsk/$i
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2003 04:10 AM
тАО10-28-2003 04:10 AM
Re: pvchange -t script
Copuple of things:
1) You'll need to strip the vg names & any non device entries in that output file.
2) Use the var in that loop
pvchange -t 90 $i
HTH,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2003 04:12 AM
тАО10-28-2003 04:12 AM
Re: pvchange -t script
strings /etc/lvmtab |grep "/dev/dsk" > /tmp/outputfile
for i in `cat /tmp/outputfile`
do
pvchange -t 90 $i
done
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2003 04:13 AM
тАО10-28-2003 04:13 AM
Re: pvchange -t script
strings /etc/lvmtab |grep "/dev/dsk" |awk '{ print $1 } > /tmp/outputfile'
Then, do
for i in 'cat /tmp/outputfile'
do
pvchange -t 90 /dev/dsk/$i
done
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2003 04:19 AM
тАО10-28-2003 04:19 AM
Re: pvchange -t script
for i in 'cat /tmp/pvchange'
do
pvchange -t 90 /dev/dsk/$i
done
Output was:
root# /usr/local/scripts/pvchange
Usage: pvchange
[-A Autobackup]
[-s] |
{[-S Autoswitch] [-x Extensibility] [-t IOTimeout] [-z SparePV]}
PhysicalVolumePath
"/tmp/pvchange": Too many arguments
/tmp/pvchange has 2 lines=
c#t#d#
c#t#d#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2003 04:30 AM
тАО10-28-2003 04:30 AM
Re: pvchange -t script
for i in 'cat /tmp/pvchange'
do
pvchange -t 90 /dev/dsk/"$i"
done
Sorry, not on a system to test it on.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2003 04:33 AM
тАО10-28-2003 04:33 AM
Re: pvchange -t script
Tried that change, it generated this error mesg:
"PhysicalVolumePath": must be a block special file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2003 04:42 AM
тАО10-28-2003 04:42 AM
Re: pvchange -t script
/dev/rdsk/"$i"
for raw device
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2003 04:46 AM
тАО10-28-2003 04:46 AM
Re: pvchange -t script
Nope, changing to rdsk didn't work either, same resulting error mesg:
"PhysicalVolumePath": must be a block special file.
Thanks for the help, I'm considering just running the command line on each pv.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2003 04:46 AM
тАО10-28-2003 04:46 AM
Re: pvchange -t script
#! /bin/ksh -x
that will print everything out line by line while excuting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2003 04:52 AM
тАО10-28-2003 04:52 AM
SolutionYour file will *already* contain
/dev/dsk/cXtYdZ
so all you'll need is $i
for i in $(cat /tmp/outputfile)
do
pvchange -t 90 $i
done
That should work for you IF you get the vg names & any arbitrary strings produced by the strings /etc/lvmtab command.
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-28-2003 04:56 AM
тАО10-28-2003 04:56 AM
Re: pvchange -t script
That did it. Thanks.