Thursday, 9 June 2011

Working with AIX filesystem PART 1


Objectives for the module
Understand various components of AIX file system.

File system structure

Explanation:

File system resides on a logical volume. So the size of the file system would be in multiples of logical partitions. Every logical partition would be pointing to a physical partition.
An individual file within a file system would be allocated data blocks which is usually 4 KB in size. In traditional UNIX systems the data block size was 512 bytes.

The first very important component of a file system is called the superblock. The superblock contains information about the file system in terms of the name of the file system, its size, number of inodes in the file system, etc.

The superblock information is very critical and will be utilized by the system whenever the file system has to be mounted and accessed. If the superblock goes corrupt, then the file system will not be able to be mounted also. So a backup copy of the superblock is always written in block 31.

Right after the superblock are the inodes. Inodescontains information of files like file permissions, file type, size, owner, group, created/modified date and time and they also contain the pointers to data block.
Data block contain data. Indirect data block maintain addresses to the actual data block.

Contents of the inode


Explanation:
This is the structure of the inodes. Each file on your system is represented by a single inode. The inode for a file contains information about the file in terms of
>Inode number for the file
>Ownership
>Access Permissions
>Type of the file
>Creation, modification and access times
>Number of links to the file
>Size
>Addresses of data blocks on disk.

Use can use the command ls with the option –i to look at the contents of the inode for that file.

File System Fragmentation


Explanation:
In AIX the filesystemis broken into blocks called as data blocks. These data blocks by default are 4 kb in size i.e. 4096 bytes in size.

Lets imagine you have a file called file1 which is about 1900 bytes. To store this file in the filesystem, you will require a data block (4 kb). That means file1 occupies 1900 bytes of the data block and the rest of the space in the 4 kb data block is empty. But even though rest of the space is empty, this space cannot be utilized by the file system to allocate it any other file. So in these circumstances, potentially you could have more amount of unused or wasted space.

Here is where we can get an intro to the concept of “Fragmentation”.

Fragmentation is a concept wherein a single data block can be broken logically into smaller fragments of size ranging from 512 bytes to 4 kb. Lets say I choose a fragment size of 1kb, that means the data block of 4 kb size is broken into 4 fragments.This would ensure that if there was a small file lets say about 1900 bytes, to store this particular file, I would potentially use up only 2 fragments of the data block and the other two fragments can be allocated to files if necessary. Thus reducing the amount of unused and wasted space in your filesystems.

Number of bytes per inode


For how many number of bytes should a inode be generated ?
for example: nbpi=4096 would create an inode for every 4096 bytes.

Explanation:
In a Journaled File System, when ever a file is created, its respective inode also has to be created. The inode maintains details about the file. In earlier versions of JFs, the number of inodes created for a file system was fixed and it was generated for every 4 KB of disk space of that file system. That means 1024 inodes would be generated. If the data block size also remains at 4 KB, these many inodes was actually enough to cater to the needs of the file system.

But since fragmentation came into picture, wherein instead of sticking to 4 KB data block size, the data block was able to be fragmented in smaller sizes lets say 1024 ie1KB, the need for more number of inodes also increased since there would be potentially more smaller files in the file system. Here is where the nbpi value (number of bytes per inode) can be reduced/changed to suit the requirements. So now nbpi=1024 would mean, please create a inode for every 1024 bytes of the space allocated to this file system.

Allocation Group Size


Explanation:

Allocation group size concept increases the efficiency of the file system. Allocation group is nothing but a logical grouping of related datablocks and the inode into a single group to increase the speed at which the data can be accessed within a filesystem.

The following small table gives you the Allocation Group Size and its respective nbpi values that are supported:
Allocation Group Size                   NBPI
8 MB                              512,1024,2048,4096,8192,16384
16 MB                           1024,2048,4096,8192,16384,32768
32 MB                           2048,4096,8192,16384,32768,65536
64 MB                           4096,8192,16384,32768,65536,131072


Compressed file system



Explanation:
Compressed file system save disk space by allowing a logical block to be stored on the disk in units or fragments smaller than the full block size of 4096 bytes.

Data compression allows all logical blocks of any sized file to be stored as one or more contiguous fragments. On an average, data compression saves disk space by about a factor of 2. There is no support for compression with JFS2 file system.

Recommendations: The root file system must not be compressed. Compression of the /usr file system is not recommended.

Large File Enabled File Systems

                                            File = 132 MB


(1024 * 4 KB blocks) + (1024 * 128 KB blocks) = 132 MB
4 MB                          + 128 MB                          = 132 MB



Explanation:

Before discussing the Large File Enabled File System, Lets take a normal scenario of a file of size 140 MB. The default block size for this file system is 4 KB. That means, to store a file of 140 MB size in 4 KB blocks we would require 140 MB /4 KB = 35840 number of data blocks. That means to read this file the system has to perform 35840 I/O operations.

With Large File Enabled File System, the first 4 MB of the file will be allocated in 4 KB blocks and the rest of it will be allocated in 128 KB blocks. That means for the same file which is 140 MB in size, first 4 MB will be allocated using 4 KB blocks (4MB / 4 KB = 1024 blocks) and rest of the file is 136 MB will be allocated in 128 KB block ( 136 MB / 128 KB=1088 blocks). Totally in a Large File Enabled File System to allocate this file of 140 MB only 1024+1088 ie 2112 data blocks will be required and this calculation itself is an indication how a Large File Enabled File System can bring in performance. ( Only 2112 I/O operations are required to read the file instead of 35840 blocks.

Journal Log


Explanation:

Jfslogs are kept in /dev/hd8. The journal logs are circular logs. The size of the journal log is 1 PP size. The jfslog is used to ensure file system integrity by writing all metadata information to the jfslog immediately.
In journal log, only inode and indirect data block information is stored and not the actual data block.
There is also a new feature called inline log that is introduced with JFS2. This inline log allows you to log directly to the file system.

Difference between JFS and JFS2


Explanation:

JFS2 (Enhanced JournaledFile System)
Is a new file system introduced in AIX5.1. The base for JFS2 is JFS file system. At present JFS2 is the only standard file system supported on Itanium based platform.

Extent Based Allocation:
JFS2 uses extent based allocation. An extent is an address length pair, which identifies the starting block address and the length of the extent in blocks. This allows multiple adjacent blocks to be addressed. The advantage of extend based allocation are high performance and large file size.

In JFS2 the inodes are created dynamically i.e. on fly whereas in JFS there was a fixed number of inodes that was getting created during the creation of the file system. An inode in JFS2 file system is of size 512 bytes when compared to the JFS inode size of 128 bytes.

Migration issues: JFS and JFS2 can co-exist on the same system. But to migrate a JFS into JFS2, take the backup of data on the JFS file system, create a new JFS2 file system, restore the JFS file system backup on the new JFS2 file system.






Incoming search terms:
AIX file system structure
File system in AIX
AIX filesystem
Description of AIX filesystem
JFS and JFS2
Difference between JFS and JFS2
Journal log
Journal log in AIX
Inode in AIX
Allocation group size in AIX
Compressed file system in AIX
step by step create a filesystem on aix






Monday, 6 June 2011

AIX Data Storage - Part 5

WORKING WITH LOGICAL VOLUME MANAGER (LVM) - SUB-PART 3:


Objectives for the module
>Working with Physical Volumes


Physical Volumes

Explanation:

Physical Volumes are nothing but the hard disks. These physical volumes belong to a volume group.

Physical Partitions (PP) is the smallest allocatableunit on your physical volume. These physical partitions should be the same size across the entire Volume Group. However, since there can be multiple Volume Groups on a single system, each volume group can have different PP size. The PP size can be in the range 1-1024 MB.

Default number of PPs per Physical Volume is 1016 but can be increased to suit your requirements.

Physical Volumes Menu



You can use the fastpath # smit pv to get into this screen. Each of these options will be discussed shortly one by one as follows:

List physical Volume Information

Explanation:

The command lspv which stands for list all physical volumes in the system, internally uses the undocumented command getlvodm –C to list the physical volumes in the system.

The lspv command without any parameter can be used to list the physical volume name, the PV identifier, and the Volume Group name that it belongs to.

The command lspv <pvname> gives the status information, number of PPs, PP size, to which volume group it belongs to, free PPs and its distribution in terms of intra policy etc.

Listing physical Volume Information..(continued..)


Explanation:
The command lspv –l hdisk0 lists all the logical volumes present on a physical volume. The output of the command would give information about the LV name, number of LPs, number of PPs, Its distribution and its mount point.

Listing physical Partition map for a Physical Volume


Explanation:

The command lspv –p pvname lists all the logical volumes on a disk and they physical partitions to which its logical partitions are mapped.

The output of the command would display, the PP number, its STATE  ie whether its free or used up, intra region where the PP is situated, LV name, type of the LV and mount point.

Add/Move contents of a physical volume


•Add a disk -> Can be done using SMIT or by cfgmgr when the system boots up.
•To move the contents of a physical volume
# migratepv –l lv00 hdisk0 hdisk1


Explanation in detail:

To add a physical volume to the system, you can use the Add a Disk option from the fixed disks menu under Devices  main menu in SMIT.

Once the disk is added to the system, it has to be made part of a volume group so that you can start using the disk.

Another method of adding a disk to the system is, power off the system, add the new disk physically to the system. Power On the system during which the program called cfgmgr will be invoked to configure the newly added disk.
Once the new disk is added, if you want to migrate a existing logical volume from old disk to the new one, you can use the command called migratepv.

The syntax for migratepv command is
# migratepv –l lv00 hdisk0 hdisk1
I.e. –l option to specify the logical volume name that you are planning to migrate followed by the source hard disk name and the destination hard disk name.

Documenting the Disk Storage


•List of the disks on the system (PVID and volume group):
# lspv
•List the volume groups:
# lsvg
•List what logical volumes are contained in each volume group:
# lsvg -l vgname
•List the logical volumes on each disk:
# lspv -l pvname





Incoming Search Terms:
LVM
LVM in detail
Details of LVM
Details of LVM in AIX
AIX LVM
Physical volumes in AIX
AIX physical volumes
physical volume explained
Everything about physical volume
Everything about AIX physical volume

Thursday, 2 June 2011

AIX Data Storage - Part 4

WORKING WITH LOGICAL VOLUME MANAGER (LVM) - SUB-PART 2:


Objectives for the module
>Working with Logical Volumes
>Mirroring & Stripping

Logical Storage



Explanation:
Logical Volumes is a collection of logical partitions which may span across multiple physical volumes in the same volume group.

A file system structure is usually sits on top of a logical volume.
If required, the logical volume can be dynamically increased.

There is a limit of 512 LVs per Volume Group.
Logical Partitions are mapped to the physical partition. Usually this mapping is one-to-one unless there is mirroring done on the LV.


Mirroring





Explanation:
Mirroring is when a logical partition maps to more than one physical partition of the same volume group.

Ideally each copy must reside on a separate disk but this restriction can be removed.

There are various mirroring scheduling policies:
a.Parallel policy: Read: On each read, the system checks whether the primary is busy. If its not busy, the read is initiated on the primary, otherwise from secondary.
                            Write: Initiated concurrently.
b. Parallel/Sequential: Read: Always reads on primary copy.
                                     Write: Initiated concurrently.
c. Parallel/Round robin: Read: Alternates between copies, resulting in equal utilization.
                                        Write: Initiated concurrently.
d. Sequential: Read: Always reads on primary copy.
                       Write: initiated serially, first to the primary and then to secondary disk

MWC ( Mirror Write Consistency)

Explanation:

MWC (Mirror Write Consistency) ensures data consistency on logical volumes in case of system crashes during the mirrored writes.

There are two methods of MWC :
a.Active Method: Consistency is achieved by logging when a write occurs. LVM makes an update to the MWC log that identifies what areas of the disk are being updated before performing the write of the data. This actually results in a performance degradation during random writes.

b.Passive Method: Introduced with AIX version 5.1. Passive method reduces the problem of having to update the MWC log on the disk. This method logs that the logical volume has been opened but does not log writes. If the system crashes, then the LVM starts a forced synchronization of the entire logical volume when the system restarts.

You can set MWCfor a logical volume by using the option –wwith either the mklvcommand or with the chlv command. The various options to set for the MWC option(-w) are:

a.y or a (Yes or Active) –Each write is logged to MWC log. Default value setting.
b.P ( Passive)–Use the passive method.
c.n (No)–There is no MWC, if there is a crash, then the mirrored LVs are in inconsistent state.

Striping

•Normal flow of data blocks when a logical volume is spread across physical volumes:

•The layout of stripe units when a logical volume is set up to stripe:

•Consecutive stripe units are created on different physical volumes
•Striping increases read/write sequential throughput by evenly distributing stripe units among disks
•Stripe unit size is specified at creation time

Striped Columns

Explanation:

Striping is a technique for spreading the data in a logical volume across several hard disks such that I/O capacity of all disk drives can be simultaneously used.

In a non striped logical volume, data is accessed using the addresses to the data blocks within the physical partitions.

In a striped logical volume, the data is accessed using the addresses of the stripe units (data of a striped logical volume is broken into units called stripe units). The size of the stripe unit is usually specified during the creation time and it could range form 4 kb to 128 kb.

To implement striping at your size, at least two physical volumes are required. Recommendation is that the number of physical partitions allocated to a striped logical volume must be able to be evenly distributed among the disks.

Intra-physical volume allocation policy:

Inter-physical volume allocation policy:

  • Maximum number of physical volumes to use
  • Range of physical volumes to use
Explanation:
Intra physical volume allocation policy specifies where on the physical volume the partitions will be allocated to the logical volume. The choices could be inner edge, inner middle, centre, outer middle and outer edge areas. Usually the centre area generally was the area with the best performance on older disks but may not be true with the newer disks. You may have to go through the documentation for the hard disks to come to a conclusion.

Inter physical volume allocation policy specifies how many physical volumes can be used to contain the physical partitions of the logical volume. It also specifies the range of volumes used i.e. minimum ( allocate partitions on one physical volume or as many as there are (maximum).

Logical Volume Menu


Explanation:
You can use the fastpath #smit lv to get into the main menu pertaining to the logical volumes.
You can use this menu to continue with the management tasks which may relate to listing all the logical volumes by volume group, Add a logical volume, set the characteristics of a logical volume, show the characteristics of a logical volume, remove a logical volume, copy a logical volume if required.

Viewing characteristics of Logical Volume

Explanation:
The command # lslv –l <lvname> gives information about the distribution of a particular logical volume’s logical partitions for each physical volume.

The output shows:
a.The name of the physical volume.
b. Number of logical partitions on the disk and its copies if any.
c.In Band –percentage of physical partitions which match the intra policy of the logical volume
d.Distribution of physical partitions on the physical volume ( outer edge, outer middle, centre, inner middle and inner edge)

Copies information for e.g. : 001:000:000, the first information is regarding the first copy i.e. 1 pp. The next two fields hold information regarding the second and third mirrored copies on the physical volume.

The command #lslv –m <lvname> would give information about the LPs and its mapping to the physical partitions and the physical volumes on which these physical partitions are present.
First set of values are for the first copy and the second and the third columns are for mirrored copies if any.

Adding a Logical Volume

Explanation:
You can use the fastpath $ smit mklv to get into this SMIT menu to add a new logical volume. The mandatory options here would be the name of the Volume Group where you want to create the Logical 

Volume and the size of the logical volume in terms of the number of Logical Partitions to allocate to the logical volume. If required you can also specify the name of the logical volume that you are creating. If not by default it creates a logical volume with the name starting aslvand then followed by a running sequential number like lv00, lv01 etc.

Removing a Logical Volume


Explanation:
If a logical volume is not required, you can use the fastpath # smit rmlv to remove a logical volume.
You can also use the high level command rmlvto remove a logical volume.

Recommendation: Do not use the rmlv command to remove journaledfile systems or paging space, This high level structures have information relating to them saved in the ODM database and in some files like /etc/filesystems. The command rmlvcommand doesn’t cleanup the lvrelated information from the database or the file.

Set Characteristics of a Logical Volume


Explanation:
You can use the fastpath #smit lvsc to set the characteristics of a logical volume.
You can change the logical volume details, you can rename a logical volume, you can increase the size of a logical volume, Add a copy to a logical volume, and remove a copy from a logical volume.

In AIX 5.1 and above the size of the logical volume may not be decreased dynamically. To make a logical volume smaller, you may have to backup the data, delete the logical volume, recreate a logical volume with the desired small size and restore the data.
You can use the high level command # chlv to change the various attributes of the logical volume.

Viewing characteristics of logical volumes


Explanation:
The command discussed here is the lsvgcommand to list the characteristics of a volume group. The various options used are:-
-il-> to list the logical volumes within the volume group. Option –i of lsvg reads the list of volume groups from the standard input.
-o-> active volume groups.

Show Logical Volume Characteristics


Explanation:
The command lslv is to list the characteristics of a logical volume.

The output of the command gives the details about the logical volume. It shows the state of the volume group,typeof the logical volume, inter and intra policy of the logical volume, mount point, state of the LV, number of LPs within the LV etc.

Write Verify :specifies whether to verify all writes to the logical volume with a follow-up read.

Bad Block:specifies whether the Logical Volume Manager should try to relocate a bad block if one is encountered.

Add/Remove a logical Volume Copy


Explanation:
You can use the fastpath # smit mklvcopy to get into this option to add/remove the number of logical partition copies.
You can also use the high level command called mklvcopy to add copies (mirroring) to a logical volume that has none or to increase the copies from two or three.
You can use rmlvcopy command to reduce the total number of copies for a logical volume.

NOTE: Once a logical volume has been created, striping cannot be imposed on it or removed from it.
The mirrored copies in order to be matching to each other, the logical volume has to be synchronized using the syncvg command.

Reorganizing a Volume Group


Explanation:

When you change the intra-physical volume policy ( centre, middle, edge) the physical partition will not relocate automatically.

You can use the fastpath #smit reorgvg or the high level command reorgvg to relocate or re-distribute the physical partitions according to the intra policy.

E.g.: # reorgvg datavg mylv lv01

If you issue reorgvg command with the volume group name but no logical volume name, the entire volume group gets reorganized



Incoming Search Terms:
Everything about Logical Volume
AIX logical volume
Logical volume in detail
Working with Logical volume
Stripping and mirroring
how to perform stripping and mirroring in AIX
Guide to logical volume in AIX
Guide to logical storage data in AIX
LVM in AIX

Wednesday, 1 June 2011

AIX Data Storage - Part 3

WORKING WITH LOGICAL VOLUME MANAGER (LVM) - SUB-PART 1:



Objective for the module
•Working with Volume Groups



Logical Volume Manager

You can use the fastpath# smitlvmto get into this menu. In this menu you can manage many aspects of logical volume manager,

a.Volume Groups:This menu can be used to manage the Volume Groups on your system. Adding, Removing, setting and changing the characteristics of a volume group etc.
b.Logical Volumes: This menu can be used to manage the Logical Volumes (partitions) on your system. You can add a new logical volume, remove an existing logical volume, change and view the characteristics of a logical volume, add mirror copies to an existing volume group, remove mirror copies etc.
c.Physical Volumes:This menu can be used to configure and use your physical volumes (hard disks) on your system.
d.Paging Space: This menu can be used to add, delete, activate and list the paging spaces that are available on your system.

You can also use the WSM (Web Based System Manager) to manage the various options of Logical Volume Manager.

Volume Groups


Physical Volumes are nothing but the hard disks on your system. These physical volumes belong to a Volume Group. A volume group can have up to 1024 PVs per volume group.

A Volume Group is a collection of related PVs. These PVs can be members of one single Volume Group and they all share a single physical partition size.

During the installation of AIX system, a default volume group called rootvg gets created.
There can be a maximum of 255 Volume Groups per system.

Volume Groups Menu



You can use the fastpath# smitvgto get into this menu to manage all issues relating to the Volume Group.
All these will be discussed one by one slowly.


Listing Volume group

# lsvg
rootvg
datavg

# lsvg –o
rootvg


You can use the lsvg command to list the volume groups available on your system.
You can use the –o option with the lsvg command to list only the active volume groups i.e. only those volume groups that are varied on.



Listing information of Volume Group




You can use the lsvg command to list the details about the volume Group.
The output of this command gives lot of information about the volume groups. The important ones are:
a.PP size of the volume group.
b.Number of PPs.
c.Number of PPs free.
d.Status of the Volume Group.
e.Number of PVs in the Volume Group etc.

Listing information of Volume Group (physical)

You can use the lsvg command with –p option to get the information about the physical volumes within the volume group.
The output of the above command gives details about:
a.Name of PV : Physical Volume names.
b.State of the PV: PV state in terms of active or inactive
c.Total number of PPs: How many number of PPs are there per PV.
d.Free number of PPs: How many PPs are free.
e.Free Distribution: The distribution statistics of the free PPs i.e. intra policy (inner edge, inner middle, centre etc)

Listing information of Logical Volumes


You can use the command lsvg with the option –l to get the information of the Logical Volumes within a Volume Group.
The output of the command would give lots of details about the Logical Volumes like,
a.Name of the Logical Volume
b.Type of the Logical Volume, like jfs, jfs2, boot, paging. The type determines the purpose of these logical volumes, ie whether they are used for regular file storage, or for booting purpose or these logical volumes are used as paging space etc.
c.Number of Logical Partitions (LP)
d.Number of Physical Partitions (PP)
e.Number of Physical Volumes occupied by these Logical Volumes.
f. Logical Volume state whether open and synchronized, or closed.
g.Mount point for the logical volume if the type of the Logical volume is either jfsor jfs2.

Adding a Volume Group

You can use the fastpath #smit mkvg to add a new volume group.

When you install the AIX operating system on your system, there would be a default Volume Group created on your system called rootvg.

In case you want to add another hard disk (Physical Volume) to your system, you can add this PV to the existing Volume Group i.e. rootvg or you can create a new Volume Group and make the new hard disk (Physical Volume) to belong to the new volume Group.

You can also use the high level command to create a new volume group
# mkvg –s 16 -y datavg hdisk1

The above command will create a new volume group with the name datavg
( -y ) with the hard disk hdisk1 into it and the PP size for the volume group is 16 MB (-s).

There is a option called the MAJOR NUMBER, this is used by the kernel to access this volume group.
The options in the smit menu pertaining to Concurrent Mode and Concurrent Capable is only Valid if you have HACMP (High Availability Cluster Multi-Processing) software installed on your system. Otherwise there is no meaning for these options.

Add a Scalable Volume Group

# smit mkvg

Removing a Volume Group

If there are no more physical volumes in a Volume Group, you can use the fastpath #smit reducevg2 to remove the volume group.

There is high level command to Remove a volume Group. The correct way to remove a volume group is to remove the physical volume ( using the reducevg command) and this will remove the volume group when you have removed the last physical volume in it.

The syntax for the reducevg command is:
# reducevg datavg hdisk1

Where datavg is the name of the volume group and hdisk1 is the physical volume that you are planning to remove from the volume group.

Set the characteristics of a Volume Group


You can use the fastpath #smit vgsc to set the characteristics of a volume group.

You can change a volume Group features, You can add a new physical volume to an existing volume group. 

You can also remove a physical volume from a volume group or you can also reorganize the volume group.
The high level command called extendvg can be used to add a new physical volume to the existing volume group.
# extendvg datavg hdisk2

The high level command called reducevg can be used to remove a physical volume from an existing volume group.
# reducevg datavg hdisk1 

Change the characteristics of a volume group


You can use the fastpath #smit chvg to change the characteristics of a volume group

Logical Track Group (LTG) Size


LTG is the maximum transfer size of a logical volume

Prior to AIX 5L V5.3:
–Default LTG size is 128 KB
–LTG size can be changed by the -Lflag on the chvgor mkvgcommand

In AIX 5L V5.3 and above:
–AIX 5L V5.3 dynamically sets the LTG size (calculated at each volume group activation)
–LTG size can be changed with the command: varyonvg -M <LTGsize>
–The mkvg -Lflag is no longer supported
–The chvg -Lflag has no effect on volume groups created in AIX 5L V5.3
–Enable variable LTG on old volume groups using chvg -L 0


To display the LTG size of a disk, use the command:
# /usr/sbin/lquerypv -M <hdisk#>


LTG (Logical Track Group) size is the maximum allowed transfer size for disk I/O operations. In the earlier versions of AIX, the LTG size that was supported was 128 kb. Many hard disks now a days support larger sizes of transfer rate. So to take the advantage of these larger transfer rate you can change the LTG size to the size iesupported by the disks.
# /usr/sbin/lquerypv –M hdisk0


256 .  -> the LTG size of the hdisk0 is 256. So the LTG size of the volume group can be changed to this
value.


You can set the LTG size while creating the volume group ie while using the mkvg command or after the 
creation of the volume group using chvg command .


In AIX version 5.1 and above, the following values for the logical track group size is supported:
a.128 kb
b.256 kb
c.512 kb
1024 kb


Concept of the Hot Spare





HOT SPARE: Is a disk or group of disks used to replace a failing disk. LVM marks a physical volume missing due to write failures and then it starts the migration of data to the hot spare disk.

For incorporating Hot Spare in the LVM, logical volumes must be mirrored, All logical partitions on hot spare disks must be unallocated and hot spare disks must have at least equal capacity to the smallest disk already in the volume group.

Hot Spare Policy:
y(lower case) -> automatically migrates partitions from one disk to one spare. The smallest spare which is enough to substitute for the failing disk will be used.
Y (upper case) -> automatically migrates partitions from a failing disk, but might use the complete pool of hot spares.
n-> No automatic migration occurs. This is the default value.
r -> Removes all disks from the pool of hot spare disks.


Hot spare synchronizing policy
y -> automatically attempts to synchronize the stale partitions.
n -> Will not automatically attempt to synchronize. This is the default

E.g.: chpv–hyhdisk1-> marks hdisk1 as a hot spare.
         chvg–hy–sytestvg-> sets automatic migration policy and automatic synchronizing policy.


Extending and Reducing Volume Groups

Note: Will not retain current disk contents

Activate/Deactivate a Volume Group


To activate a volume group:
# varyonvg oravg

To deactivate a volume group
# varyoffvg oravg

Explanation:


The command varyonvg can be used to activate a volume group that is not activated at system startup.
There is also an option with varyonvg i.e. –f option. This option can be used to force a volume group to get activated. This may be needed if you have lost the quorum, but still want to varyon the VG.
The command varyoffvg can be used to deactivate a volume group. No logical Volumes should be open when you run this command.

NOTE: Its not possible to varyoffvg the rootvg.

Importing a Volume Group



If you have a volume group on a removable disk that you want to access on another system, you must export the volume group from the current system using the exportvg command. This command removes the volume group related information from the system (i.e. from the ODM). To export a volume group it should be inactive.
To access the exported volume group on another system it has to imported into the other system by using the importvg command.