AIX Save and restore lvm structure
id : 8fcu85re33
category : computer
blog : unix
created : 08/06/10 - 07:47:05

On source partition
#smit savevg

               Back Up a Volume Group to Tape/File or UDFS capable media

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

                                                        [Entry Fields]
    WARNING:  Execution of the savevg command will
              result in the loss of all material
              previously stored on the selected
              output medium.

* Backup DEVICE or FILE                              [/root/my_vg.bck]
* VOLUME GROUP to back up                            [my_vg]
  List files as they are backed up?                   no
  Generate new vg.data file?                          yes
  Create MAP files?                                   yes
  EXCLUDE files?                                      no
  EXPAND /tmp if needed?                              no
  Disable software packing of backup?                 no
  Backup extended attributes?                         yes
  Number of BLOCKS to write in a single output       []
     (Leave blank to use a system default)
  Verify readability if tape device?
  Back up Volume Group information files only?        yes

  • This will result of a file named /root/my_vg.bck, copy it to your destination partition

On destination partition
  • Check presence of your bck file transfered before
  • Restore volume group one by one with this command (-s shrink lvs) :
# restvg -s -r -f <backup_file> <pv_name> ....

  • Don't forget to set PP size with -P if you want an exact copy of your structure :
# restvg -P <pp_size_in_mb> -r -f <backup_file> <pv_name> ...