---------- Post updated at 08:50 PM ---------- Previous update was at 08:24 PM ----------
Hi Robin,
Thanks a lot for the information.
however few doubts,
/etc/exclude.datavg - will this file be detected by the save vg command automatically ?
be sure to remove the directory /tmp/vgdata before you start and create your mksysb afterwards. - what data does this directory contain and wnt it affect the online vgs that are in use on the LPAR.
After restoring your mksysb elsewhere - can we take the backup of just this VG structure through mksysb and restore it elsewhere ?
or it has to be taken along with complete mksysb image and new LPAR build has to be done using that image, which will import the vg structure.
Please help on this.
Also, if you have any scripts for FS creation..that would be really helpful
The -e flag asks savevg vgname to read /etc/exclude.vgname so that should be the case. Have a look at the man page just to check it is in your version.
The directory /tmp/vgdata contains working information about the volume group as savevg runs. I have found that it is not always overwritten by subsequent savevg commands. I have used it to tweak the definition before saving. We have a server that has local LVM mirrored disk, but there is SAN storage on the DR server, but not enough to create the mirrors too. I got in and change the definition of the LVs to be a single copy only.
The directory is not generally in use, so it's best to clean it up.
For the last part, I'm slightly confused on your question. I think you are wanting to take the file created by savevg and restore it wherever you like. This is fine with two clauses:-
Do you have enough disk (total space on free disk) to restore the VG?
Are all the LVs (including jfslogs) and filesystems unique when comparing to the target server?
If the answer to both is Yes, then you should be okay. The file should really only contain information like "Build be logical volume aaa with these properties and then make a filesystem from it to be mounted as /bbb."
If there are conflicts, then there may be a way to use the content of /tmp/vgdata to adjust the save so you can use it on the target. If not, there are ways to extract the commands from the file and tweak them before executing the lot, but it is slower if you have lots/large filesystems.
The directory /tmp/vgdata contains working information about the volume group as savevg runs. I have found that it is not always overwritten by subsequent savevg commands. I have used it to tweak the definition before saving. We have a server that has local LVM mirrored disk, but there is SAN storage on the DR server, but not enough to create the mirrors too. I got in and change the definition of the LVs to be a single copy only.
The directory is not generally in use, so it's best to clean it up.
What i meant was, the /tmp/vgdata contains the outputs from the savevg command only ? Or does it hold any data from the live volume groups that can effect the functionality of the VG's if we empty the directory /tmp/vgdata.
And the other question was...
I understood now, the file that will be created from the command:
i.e /disaster/datavg.structure
can we copy this file manually (using scp or rcp) to another server and use the restvg command ?
Also can we edit this file and make few changes according the the destination server requirements ?
supposed source has a File systems as below
now the 'XXX' part here changes in every new LPAR we create.
so i want to edit the file( /disaster/datavg.structure ) and change the XXX and then restore it using restvg on the destination. IS that possible ?
Let me know if i didnt make it clear enough
Note: The above scenario is w.r.t a New Lpar build, in case of Prod-DR copy i know this will work just perfect
Again thanks a lot..i really appreciate you helping me out.
Regards,
PriyanK
Last edited by Scott; 10-18-2013 at 09:37 AM..
Reason: Please ease up on the zany formatting
Q1
The directory /tmp/vgdata is only created by a savevg (or mksysb) and is not in use during normal running. Not a problem to open volume groups, mounted filesystems etc.
Q2
Yes, you can copy the file /disaster/datavg.structure (or whatever you choose to call it) to the target server. It is just a data file, so you could also rename it if you wish. You might need to be careful on how you copy it. Do a cksum on the file on the source and on the target to make sure it transferred without error. Consider it as a binary file.
Q3
You have three choices:-
Update before backup
Here you would run the savevg, then edit a file in /tmp/vgdata and re-run the savevg command
Update before restore
Here you would (on the target server) extract the details from the datavg.structure file into a script and edit them before executing - can be a bit slow
Update after restore
After running the restvg (assuming no LV or FS conflicts) then you rename the filesystems as you wish with a chfs command and remount
Which would you prefer? If you have no preference, then I would suggest we look at option 3.
Update before backup
Here you would run the savevg, then edit a file in /tmp/vgdata and re-run the savevg command
Update before restore
Here you would (on the target server) extract the details from the datavg.structure file into a script and edit them before executing - can be a bit slow
Update after restore
After running the restvg (assuming no LV or FS conflicts) then you rename the filesystems as you wish with a chfs command and remount
Which would you prefer? If you have no preference, then I would suggest we look at option 3.
1. I tried the 1st option, but it didnt workout and got some error. I had modified the <vgname.data> file in the /tmp/vgdata directory.
I had Modified the file as per the destination server File System Requirements and then while running savevg again i got some error saying the "File system doesnt exist"
2. I really dont have any idea about this procedure. Please provide more details if possible.
3.Update After Restore, you mean to say i create the same FS as per the source LPAR, and then edit the FS on the destination ?
One More Thing:
How about copying just modified <vgname.data> from the /tmp/vgdata to new LPAR and then creating the File systems using savevg ?
Option 1 was untested. Presumably, the savevg reads the file on finding it and expects to search the filesystems listed. Maybe creating dummy directories of the required name might get this through, maybe not.
Option 2 requires you to use a few commands:-
You can then read the files in /tmp/vgdata/datavg to build the structures you need based on the original. A bit of scripting to read in a loop will do it.
Option 3 is perhaps the easiest.
....or whatever disks are appropriate. This will restore the structure of your volume group along with a format and mount of the filesystems assuming that there are no conflicts.
You can then:-
For each filesystem you need to change you simply
Then to remount them (first time only)
The loop is done in this way to ensure that all the mount points exist and if there are filesystems mounted under other filesystems that they are all in the right place. There has been many occasions where people would create filesystems such as:-
... creating the mount points and then mount /a which works and then they get confused why /a/b does not exist when they just created it. Of course they will have created /a/b in the root filesystem and then mounted /a which is empty.
You may find some mount-points for re-named filesystems get left behind by this as chfs will not delete them.
If you want to rename the logical volumes too, you need to add a step:-
You may need to edit /etc/filesystems afterwards and verify that each logical volume update has been applied. I have had occasions where this didn't happen, but I think that has now been fixed, so it depends on the patches applied.
I'm working on Aix 6.1 and using ksh shell.
The below works fine on Linux bash or ksh shell .
while IFS= read -r dirpath ; do
echo "Hi"
done <<<"$var"
However, any such while loop that reads the input from file or variable using <<< fails on Aix system with the below error:
Below... (2 Replies)
Hey guys,
I'm attempting to migrate us to a new box. First problem I had was the change in architecture going from sun4u to sun4v, we have a Sun M5000 and are moving to a Fujitsu M10-4. I figured out how to make the flash archive work between architectures.
Now I appear to be running into an... (2 Replies)
Hi All,
I am trying to create a CSV file within a shell script test.ksh and the code snippet is something like below:
#!/usr/bin/ksh
# Set required variables.
. $HOME/.prof
# Output file path
Group1=/tmp/G1.csv
Group2=/tmp/G2.csv
Group3=/tmp/G3.csv
$ORACLE_HOME/bin/sqlplus -s... (2 Replies)
Hi all
I want to know if suppose my global zone has UFS root file system & now I want to create non global zone with ZFS root file system. Is it possible.....If this is possible then how will I able to create zone based on ZFS root file system in global zone having UFS based root file system (5 Replies)
Hi,
I'm trying to write a for loop to run through a list of servers and for each server copy a file to a backup file. But I can't seem to get it to run through my server list. It work for individual servers, please see below.
#!/bin/ksh
SSH_USERID=khcuser
webservers="server1 server2"
... (2 Replies)
I'd seek for help on how to create a bunch of printers in AIX 6.x or equal or above in one go – say like I have 35 printers to create in 4 different AIX Nodes every month – I currently create it manually like below:-
How can I automatic this creation on all the 4-5 Nodes – not actually automatic... (3 Replies)
I have av script that loops through some statistic files to create a report. We would like to only loop through non-empty files as these files create an empty report-line.
I have figured out how to find the non-empty files, but not how to loop through only those files.
Here is the code that finds... (4 Replies)
1.Daily there will be 14 files in the data directory
2.someday's the 14 files receive more than once r twice with different time stamps....we need to chk the count of the file and if the count of the file is two.we need to combine the both the files.
3. if any duplicate data is there just... (1 Reply)
I won't to remove a filesystem /dev/vg01/lvo1 and copy the same to different vg ex:- /dev/vg02.
Pls give the required step to be followed to complete the said process (3 Replies)