Reorganize Volume Group What Is It And How To Do It?

April 13th, 2009

What is reorganization of a Volume Group and why its needed, is a bit confusing for the system administrators. Here in this article I am explaining it to make it easier for the reader.

Why Does Logical Volume Become Fragmented
A file system needs to be created on a Logical Volume to make it usable. When we run out of space on a File System, we have to add additional space to the Logical Volume, with which the file system is related. Now, Logical Volume’s space is increased by adding new Logical Partitions to it, which in turn point to Physical Partitions on Physical Volumes. Its not necessary that the Logical Partitions, which we are providing to a Logical Volume are close to its previous Logical Partitions. The very next Physical Partitions available on Physical Volume are assigned to Logical Partitions and those Logical Partitions are assigned to Logical Volume. As a result fragmentation occurs in a Logical Volume with time. This leads to performance issues later on.

What is Volume Group Reorganization
To get best performance from a Volume Group, its required that all the Logical Partitions within respective Logical Volumes must be contiguous. Or to say it more clearly, the Physical Partitions should be contiguous. For this purpose we need to reorganize the Volume Group. In this process, the Physical Partitions within Physical Volumes are assigned to Logical Volumes as per their characteristics. The net result is that the Logical Partitions point to Contiguous Physical Partitions within the Logical Volume.

Command Used To Reorganize A Volume Group
The command provided by Aix is reorgvg. The reorgvg command is used to reorganize the VG. The general format is:

reorgvg [-i] VG [LV1 LV2 LV3…]

-i: This option specifies that the input Physical Volumes comes from standard input. Only LVs within those Physical Volumes will be reorganized.
e.g
reorgvg my_vg lv2 lv5 lv9

This command is to reorganize Logical Volumes lv2, lv5 and lv9 within Volume Group my_vg.

If you want to specify that Physical Partitions from particular Physical Volumes only should be reorganized then you give command:

echo “hdisk2 hdisk3″ | reorgvg my_vg lv2 lv5 lv9

Now, whichever Physical Partitions related to lv2, lv5 and lv9 reside on hdisk2 and hdisk3, will be reorganized.

Things To Take Care About reorgvg Command
There are several things which should be taken care of while using reorgvg command:

  1. At least one Physical Partition should be free on Physical Volume. Otherwise command will fail.
  2. User should be either root user or system group member.
  3. if no arguments are given to reorgvg command, the whole Volume Group is reorganized.
  4. The reorganization flag of Logical Volume Should be set to Yes. Use:

    chlv –r lv   to do this, it’s not enabled.

What is The Limitation of reorgvg Command
The command has limitation that it does not recognize the placement of allocated Physical Partitions for striped Logical Volumes. As a result you may not run command on striped metaluns.

Is This reorgvg Command Disallowed Somewhere
Yes, The command is not allowed on snapshot Volume Group. Also the Volume Group should not be concurrent.

Tags: , , , , , , , , , , , ,
Posted in LVM | No Comments »

Comments

Leave a Reply

 Comment Form 

 



More articles from the category: LVM


The mkvg FAQs

Here in this post I’m presenting few things in the form of FAQs. The can be used as a ready reference while creating Volume Groups. To know how to create Volume Group read the article: How To Create Volume Group.

How To Create Volume Group

Lots of things need to be considered while creating Volume Groups. In this post I’m presenting various scenarios of Volume Group creation. In the previous post I introduced you to listing of Volume Groups. For the ones interested in fundamentals of Logical Volume Manager read the previous article: Aix Logical Volume Manager A Brief Introduction…

How To List Volume Groups and Their Characteristics

I introduced Volume Groups in one of my previous posts. In this post I’m going to discuss, how to carry out common operations on Volume Groups. For more information you can see the previous article: Aix Logical Volume Manager A Brief Introduction.
Here are few things which I’m gonna discuss in this post:

Reorganize Volume Group What Is It And How To Do It?

What is reorganization of a Volume Group and why its needed, is a bit confusing for the system administrators. Here in this article I am explaining it to make it easier for the reader

How To Work With Physical Volumes

I’ve written in my previous posts about introduction to Physical Volumes. There I also discussed some operations to be carried out on Physical Volumes. Now, I’ll be discussing some other operations on Physical Volumes like listing Physical Volumes, Logical Volumes on Physical Volumes, Physical Partitions allocations etc. For more information you can see the previous article: Aix Logical Volume Manager A Brief Introduction.

File Systems In AIX-A Primer

Generally talking, the File Systems are collection of files, directories etc. within a single partition or Logical Volume in a Volume Group. Collecting files and directories from different Logical Volumes or Partitions does not qualify to be named as File System. Aix supports mainly three types of File Systems: JFS, NFS and CDRFS. All these are being discussed here in this article. For more information you can see the previous article: Aix Logical Volume Manager A Brief Introduction

Logical Volume In AIX A Primer

Users can not access directly, the disk space available on Physical Volumes with in Volume Group. In order to access the space available, the users and applications need to access File Systems which are created on Logical Volumes. Therefore to manage Physical Volume space you need to manage Logical Volumes. For more information you can see the previous article: Aix Logical Volume Manager A Brief Introduction….

Volume Group In AIX – A Primer

Volume Group is at the highest level in LVM hierarchy. Hard disks are used as Physical Volumes in LVM. Then Physical partitions are mapped to Logical Partitions. Logical Partitions are combined to Logical Volumes. These Logical Volumes comprise the Volume Group. For more information you can see the previous article: Aix Logical Volume Manager A Brief Introduction..

How Does AIX Deal With Bad Blocks

The biggest concern for any organization using a server is data integrity. The various solutions like Network Attached Storage, Storage Area Networks, high availability servers, online data backup and disaster recovery solutions are among the available solutions.

AIX Logical Volume Manager A Brief Introduction

The storage in Aix can be divided in two layers: Physical and Logical.

On physical level the two things come into picture:

1. Physical Volume(PV).
2. Physical Partition(PP).

On logical level the storage is divided in three parts:

1. Logical Partition(LP).
2. Logical Volume(LV).
3. Volume Group(VG).

Physical Volume In AIX – A Primer

Physical Volume in AIX is a hard drive with special characteristics which are useful for LVM(Logical Volume Control). So, if any hard drive is to be used for LVM purpose, it needs to be made as Physical Volume. Physical Volume has several properties which differentiate it from normal hard drive. These are listed as below…

Non Concurrent, Concurrent and Enhanced Concurrent Volume Groups

Often the confusion arises among these types. I am trying to clarify the differences.The terms often apply in clustering scenario.

Non Concurrent VG
In Non Concurrent VG, application runs typically on a single node only and data of VG is accessible to that node only. If however present…

Quorum-What it is and Why is it Needed

The importance of Quorum concept lies in fact that if quorum is enabled and VGDAs fall below 51% then the data on VG may be corrupted if VG remains varied on. Thats why quorum enabled VG is varied off if quorum falls below 51%. This way data is safe on VG because disk