<?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 Script for Exporting and Importing VG's in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985929#M123250</link>
    <description>Hello,&lt;BR /&gt;  I was wondering if anyone out there has a script for creating a VGImport and Export script.  I have some preliminary work done already but I cannot get some of it to work.  So, if you have any information for me it would greatly be appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;CoMteC17</description>
    <pubDate>Sun, 01 Jun 2003 19:21:22 GMT</pubDate>
    <dc:creator>Richard Pugh_2</dc:creator>
    <dc:date>2003-06-01T19:21:22Z</dc:date>
    <item>
      <title>Script for Exporting and Importing VG's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985929#M123250</link>
      <description>Hello,&lt;BR /&gt;  I was wondering if anyone out there has a script for creating a VGImport and Export script.  I have some preliminary work done already but I cannot get some of it to work.  So, if you have any information for me it would greatly be appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;CoMteC17</description>
      <pubDate>Sun, 01 Jun 2003 19:21:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985929#M123250</guid>
      <dc:creator>Richard Pugh_2</dc:creator>
      <dc:date>2003-06-01T19:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Exporting and Importing VG's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985930#M123251</link>
      <description>If you could show us the script you have now and tell us what isn't working we may be able to help you fix it.</description>
      <pubDate>Mon, 02 Jun 2003 00:29:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985930#M123251</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2003-06-02T00:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Exporting and Importing VG's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985931#M123252</link>
      <description>you find what you are looking for in this list.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xf0fc5dc05a7ad711abdc0090277a778c,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xf0fc5dc05a7ad711abdc0090277a778c,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.shellderado.com" target="_blank"&gt;http://www.shellderado.com&lt;/A&gt;</description>
      <pubDate>Mon, 02 Jun 2003 01:16:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985931#M123252</guid>
      <dc:creator>Donny Jekels</dc:creator>
      <dc:date>2003-06-02T01:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Exporting and Importing VG's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985932#M123253</link>
      <description>How about:&lt;BR /&gt;&lt;BR /&gt;for i in `ls -d /dev/vg*`&lt;BR /&gt;do&lt;BR /&gt;vgexport -s -p -v -m /tmp/$i.map $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Then to import, mkdir all the /dev/vg's&lt;BR /&gt;and &lt;BR /&gt;mknod /dev/vgXX/group c 64 0xXX000&lt;BR /&gt;&lt;BR /&gt;for i in `ls /tmp/*.map | awk -F. '{print $1}' | awk -F/ '{print $3}'`&lt;BR /&gt;do&lt;BR /&gt; vgimport -s -v -m /tmp/$i.map /dev/$i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Mon, 02 Jun 2003 12:12:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985932#M123253</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2003-06-02T12:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Exporting and Importing VG's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985933#M123254</link>
      <description>I wrote two scripts for this the other day... &lt;BR /&gt;&lt;BR /&gt;here is the export script:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/ksh&lt;BR /&gt;# this script written by John Meissner 4.14.2003&lt;BR /&gt;# This script will automatically do a vgexport for a server and generate map files&lt;BR /&gt;BOLD="`tput smso`"&lt;BR /&gt;NORMAL="`tput rmso`"&lt;BR /&gt;if [ `id|cut -c5-11` != "0(root)" ]&lt;BR /&gt; then&lt;BR /&gt;   echo "Quitting - You must run this script as Root"&lt;BR /&gt;     exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;SGP=$(cmviewcl | grep `hostname` | grep enabled | awk '{print $1}') #checks for SG package name&lt;BR /&gt;# the following section will check for the service gard package status and halt the package&lt;BR /&gt;mcsg=1&lt;BR /&gt;while [ "$mcsg" = "1" ]&lt;BR /&gt;do&lt;BR /&gt;SGPS=$(cmviewcl | grep `hostname | grep enabled | awk '{print $2}') #checks the SG package status&lt;BR /&gt;if [ "$SGPS" = up ]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Service Gard package $SGP is $SGPS - stopping package now"&lt;BR /&gt;    cmhaltpkg $SGP&lt;BR /&gt;elif [ "$SGPS" = "down" ] || [ $? != 0 ]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Service Gard package $SGP is $SGPS - continuing "&lt;BR /&gt;    mcsg=0&lt;BR /&gt;elif [ "$SGPS" = "starting" ] || [ "$SGPS" = "halting" ]&lt;BR /&gt;  then&lt;BR /&gt;    echo " Service Gard package $SGP is $SGPS - sleeping 10 "&lt;BR /&gt;    sleep 10&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;#this section will find the VG names for the server and export the VG's to map files&lt;BR /&gt;dev_vg=$(ll /dev/vg*/group | grep -v vg00 | awk '{print $10}' | sed 's/\/group//g' | sed 's/\/dev\///g')&lt;BR /&gt;for i in $dev_vg&lt;BR /&gt;do&lt;BR /&gt;vgexport -p -s -m $dev_vg.map /dev/$dev_vg&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;#find the failover server and ftp the map files&lt;BR /&gt;SGF=$(cmviewcl -v -p $SGP | grep Alternate | awk '{print $4}')&lt;BR /&gt;ftp -n -i &amp;lt;&lt;HERE&gt;&lt;/HERE&gt;open $SGF&lt;BR /&gt;user username password&lt;BR /&gt;cd /tmp&lt;BR /&gt;ascii&lt;BR /&gt;mput /tmp/*.map&lt;BR /&gt;quit&lt;BR /&gt;HERE&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Jun 2003 12:14:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985933#M123254</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-06-02T12:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Exporting and Importing VG's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985934#M123255</link>
      <description>and here is the vgimport script:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/ksh&lt;BR /&gt;# written by John Meissner on 4.14.03&lt;BR /&gt;# this script will automatically import vg map files created from other servers&lt;BR /&gt;&lt;BR /&gt;# this entire process will deal only with the VG's that have new map files for them&lt;BR /&gt;# the map files will have already been ftp'd from the primary SG server to the /tmp directory&lt;BR /&gt;&lt;BR /&gt;# get a list of the minor numbers and get them ready&lt;BR /&gt;vgmap_files=$(ls /tmp/*.map | sed 's/\/tmp\///g'| sed 's/\.map//g')&lt;BR /&gt;for i in $vgmap_files&lt;BR /&gt;do&lt;BR /&gt;ll /dev/vg*/group | grep $i | awk '{print $6,$10}' &amp;gt;&amp;gt; /tmp/minornum.list&lt;BR /&gt;newvg=$(ll /dev/vg*/group | grep $i)&lt;BR /&gt;if [ "$newvg" = "" ]&lt;BR /&gt;  then&lt;BR /&gt;    function get_next_volume_group_minor_number {&lt;BR /&gt;    typeset -Z2 NEXTMINORNUM=0&lt;BR /&gt;    let MINORNUM=0&lt;BR /&gt;    ls -l /dev/*/group | awk '{print $6}' | cut -c 3-4 |     {&lt;BR /&gt;     while read MINORNUM&lt;BR /&gt;      do&lt;BR /&gt;       if ((NEXTMINORNUM &amp;lt; MINORNUM));&lt;BR /&gt;        then&lt;BR /&gt;         let NEXTMINORNUM=MINORNUM&lt;BR /&gt;       fi&lt;BR /&gt;      done&lt;BR /&gt;    }&lt;BR /&gt;  let NEXTMINORNUM=NEXTMINORNUM+1&lt;BR /&gt;  print "0x0"$NEXTMINORNUM"0000 $i" &amp;gt;&amp;gt; /tmp/minornum.list&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;# export the old VG's&lt;BR /&gt;oldvg-$(cat /tmp/minornum.list | awk '{print $2}' | awk -F/ '{print $3}')&lt;BR /&gt;for i in $oldvg&lt;BR /&gt;do&lt;BR /&gt;vgexport $i&lt;BR /&gt;done&lt;BR /&gt;fi&lt;BR /&gt;#now vgimport the new vg maps&lt;BR /&gt;vgdir=$(cat /tmp/minornum.list | awk '{print $2}' | awk -F/ '{print $3}')&lt;BR /&gt;for i in $vgdir&lt;BR /&gt;do&lt;BR /&gt;mkdir /dev/$i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;#mknod&lt;BR /&gt;cat /tmp/minornum.list | awk '{print "mknod " $2 " c 64 " $1}' &amp;gt; /tmp/makenod.sh&lt;BR /&gt;chmod +x /tmp/makenod.sh&lt;BR /&gt;/tmp/makenod.sh&lt;BR /&gt;&lt;BR /&gt;#vgimport&lt;BR /&gt;cat minornum.list | awk '{print "vgimport -s -m " $2 ".map /dev/" $2}' &amp;gt; /tmp/vgimpt.sh&lt;BR /&gt;chmod +x /tmp/vgimpt.sh&lt;BR /&gt;/tmp/vgimpt.sh&lt;BR /&gt;&lt;BR /&gt;echo " you may now try to start the SG package "&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Jun 2003 12:16:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985934#M123255</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-06-02T12:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Exporting and Importing VG's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985935#M123256</link>
      <description>Thanks John,&lt;BR /&gt;There was one command that did the trick for me.  I will post the script when I have completely tested it.&lt;BR /&gt;&lt;BR /&gt;I do have one question, how do force the export of the VG?  What I mean is, after I run the vgexport -v -m /mapfile -s /dev/vg , I strings the /etc/lvmtab and the vg is still there.  &lt;BR /&gt;&lt;BR /&gt;Is there anything special I must do?</description>
      <pubDate>Tue, 03 Jun 2003 03:33:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985935#M123256</guid>
      <dc:creator>Richard Pugh_2</dc:creator>
      <dc:date>2003-06-03T03:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Exporting and Importing VG's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985936#M123257</link>
      <description>Nevermind....I answered my own question.  I must umount the filesystems and do a vgchange -a n /dev/vg.&lt;BR /&gt;&lt;BR /&gt;Thanks again for all the responses.</description>
      <pubDate>Tue, 03 Jun 2003 10:17:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985936#M123257</guid>
      <dc:creator>Richard Pugh_2</dc:creator>
      <dc:date>2003-06-03T10:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Exporting and Importing VG's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985937#M123258</link>
      <description>Richard... i went back through my script and fount two lines you will need to comment out before it works.&lt;BR /&gt;&lt;BR /&gt;comment out the following two lines:&lt;BR /&gt;&lt;BR /&gt; function get_next_volume_group_minor_number {&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;(the last } bracket in the function for get_next_volume_group_minor_number will also need to be commented out.)&lt;BR /&gt;&lt;BR /&gt;after you do that it should work perfectly.  sorry for not catching this sooner&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Jun 2003 10:37:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985937#M123258</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-06-03T10:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Exporting and Importing VG's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985938#M123259</link>
      <description>to completely remove the vg you just do&lt;BR /&gt;vgexport &lt;VGNAME&gt;&lt;BR /&gt;without any options this should remove the vg from you system and the lvmtab - but it sounds like you got that already&lt;/VGNAME&gt;</description>
      <pubDate>Tue, 03 Jun 2003 11:20:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985938#M123259</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-06-03T11:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Exporting and Importing VG's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985939#M123260</link>
      <description />
      <pubDate>Tue, 03 Jun 2003 11:58:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-exporting-and-importing-vg-s/m-p/2985939#M123260</guid>
      <dc:creator>Richard Pugh_2</dc:creator>
      <dc:date>2003-06-03T11:58:51Z</dc:date>
    </item>
  </channel>
</rss>

