Import and Exporting process to removing a Volume Group and its configuration. This can be used to remove a Volume Group from a machine otherwise to export a volume group from one machine and use it on another machine.
# lspv : List the physical volumes.
# lsvg -o : List active volume groups in the machine.
Prior to exporting a volume group we need to make sure that the volume group is not active. So its has to be deactivated which in turn all the file system has to be unmounted.
# lsvgfs <volume_group_name> : Command to list the filesystem on the volume group.
Before Unmountig the filesystem, check the status of the filesystem.
# fuser -cu <filesystem> : Shows the process and user using that filesystem.
# kill -9 <PID> : Kill corresponding process.
# umount /filesystem : Unmount the filesystem.
# varyoffvg <volume_group_name> : Deactivate the volumegroup name.
# lsvg -o : Ensure the volume group is not active.
# exportvg <volume_group_name> : Command to export the volume group.
Eventhough the concept of volume group refers to removing the Volume Group but not its configuration. That everyvolume group has its own configuration stored in /etc/lvm/lvm.conf. And the volume group information is also updated in the VGDA on each physical volume that was a part of exported volume group.
That why when you try create a volume group from a physical disk that was a part of exported volume group shows error "Physical volume belongs to a volume group".
In that case we use the option "-f" to create a volume group. Otherwise we can remove the disk definition from the ODM and reconfigure it.
# rmdev -l hdisk# : Command puts the disk into defined state.
# rmdev -dl hdisk# : Command removes the ODM information about the disk.
# cfgmgrf -l hdisk* : Command to redefine the disk.
Now, will get back to exporting the volume group. The exported volume group can be imported on the same machine or not to different machine.
In case of moving to a different machine. Disk has to be removed physically and in case of LUN. Mapping has to be done o the WWN of another server. Once it is done. Login into the another server,
# lsdev -Cc disk : Look for the disk.
# lspv : List the newly allocated disk. The disk remains in "none" state.
# importvg -y <volume_group_name> <physical_volume_name> : Command to import a volume group.
Since the VGDA on the physical volume plays a vital role in importing the volume group.
"-y" option specifies, what should be the name of the imported volume group. In the option is not specified then the volume group imported with the default name "vg##".
"-n" : Flag can be used to syncronize the imported volume group.
"-V" : Flag specifies the given major number of the imported volume group.
# lvlstmajor : Command to view the list of free major numbers.
HP_Unix..continued...
# lspv : List the physical volumes.
# lsvg -o : List active volume groups in the machine.
Prior to exporting a volume group we need to make sure that the volume group is not active. So its has to be deactivated which in turn all the file system has to be unmounted.
# lsvgfs <volume_group_name> : Command to list the filesystem on the volume group.
Before Unmountig the filesystem, check the status of the filesystem.
# fuser -cu <filesystem> : Shows the process and user using that filesystem.
# kill -9 <PID> : Kill corresponding process.
# umount /filesystem : Unmount the filesystem.
# varyoffvg <volume_group_name> : Deactivate the volumegroup name.
# lsvg -o : Ensure the volume group is not active.
# exportvg <volume_group_name> : Command to export the volume group.
Eventhough the concept of volume group refers to removing the Volume Group but not its configuration. That everyvolume group has its own configuration stored in /etc/lvm/lvm.conf. And the volume group information is also updated in the VGDA on each physical volume that was a part of exported volume group.
That why when you try create a volume group from a physical disk that was a part of exported volume group shows error "Physical volume belongs to a volume group".
In that case we use the option "-f" to create a volume group. Otherwise we can remove the disk definition from the ODM and reconfigure it.
# rmdev -l hdisk# : Command puts the disk into defined state.
# rmdev -dl hdisk# : Command removes the ODM information about the disk.
# cfgmgrf -l hdisk* : Command to redefine the disk.
Now, will get back to exporting the volume group. The exported volume group can be imported on the same machine or not to different machine.
In case of moving to a different machine. Disk has to be removed physically and in case of LUN. Mapping has to be done o the WWN of another server. Once it is done. Login into the another server,
# lsdev -Cc disk : Look for the disk.
# lspv : List the newly allocated disk. The disk remains in "none" state.
# importvg -y <volume_group_name> <physical_volume_name> : Command to import a volume group.
Since the VGDA on the physical volume plays a vital role in importing the volume group.
"-y" option specifies, what should be the name of the imported volume group. In the option is not specified then the volume group imported with the default name "vg##".
"-n" : Flag can be used to syncronize the imported volume group.
"-V" : Flag specifies the given major number of the imported volume group.
# lvlstmajor : Command to view the list of free major numbers.
HP_Unix..continued...
thanks buddy!
ReplyDelete