Friday 27 May 2011

AIX Data Storage- Part 2



Objectives for the module





1. Under the Logical Volume Manager and related Concepts like
–Volume Groups
–Physical Volume
–Logical Volume
–Physical Partitions
–Logical Partitions


2. Understand File systems and Logical Volumes






Logical Volume Manager Components


•Volume group (VG)
•Physical volume (PV)
•Physical partition (PP)
•Logical volume (LV)
•Logical partition (LP)


PHYSICAL STORAGE

Volume Groups



Volume Groups (VG): Is a collection of related hard disks. By default when AIX is installed, you will have one volume group created on your system called rootvg.The VG where data is stored is called as datavg

A hard disk can belong to only one volume group at any given point of time. If required, later you can create volume groups if necessary or you can also add the new hard disk to the existing volume group i.e. rootvg. But suggested is to isolate the rootvg as far as possible. There can be up to 255 VGs per system.

Physical Volumes (PV): Are nothing but hard disks. Any hard disk at any given point of time can belong to only one volume group. Every hard disk would be given a unique name i.e. the logical device name and the entry for the same would be made in the /dev directory.


Physical Partitions (PP): A physical partition is the basic unit of disk space allocation in AIX. By default the PP size is 4MB and by default there can be maximum 1016 PPs in a physical volume.

Since now a days most of the hard disks are size wise larger than 4 GB, the calculation of 4 MB pp size and max 1016 PPs per PV may not serve the purpose. Here is where we can think about changing the default PP size from 4 MB to a higher size. PP sizes can range from 1 to 1024 MB. There is also another mechanism to solve this problem. Instead of sticking to the default number of PP per PV as 1016, even this value can be changed to 2032, 4064 and so forth.

PP size in a volume group should be of the same size and the PP size cannot be changed dynamically.

Physical Storage Volume(VOLUME GROUPS)




There are three types of volume groups that you can create in AIX 5.3 or 6.1.

A Normal Volume Group, a Big Volume Group and scalable Volume Group.

1. Normal Volume Group: By default whenever you use SMIT or mkvg command, you create a normal volume group.
2. Big Volume Group: This volume group was introduced in AIX ver4.3.2. A big volume group should be created using mkvg –B command.
3. Scalable VG: In 5.3 and above versions of AIX IBM has added one new VG known as Scalable volume group.

Whenever you create a volume group either using smitor high level command by default the max number of PPs on a PV is fixed at 1016. If you want to change this value ie increase it, lets say to 2032 then you may have to use the option called –t (called t factor) to change it. You can supply the t factor as 2 that means multiply the default value ie 1016 with 2 there by increasing the max number of PP per PV to 2032. But please remember that if you increase the max number of PP per PV then the maximum number of PV per VG decreases.

Example: # mkvg–t 2

Would means to multiply default value 1016 by 2 so that the new maximum number of PP per PV is 2032 and not 1016.

Volume Groups differences chart:



How volume group look like: in terms of rootvg and datavg-




Why create new volume groups?
–Separate user data from operating system files
–Disaster recovery
–Data portability
–Data integrity and security

Note: For Scalable VG you can have upto 1024 PVs and there is no limit for PPs per PV in this Volume group. There can be now 4096 LVs in Scalable VG. To create a Scalable VG use option –S with mkvg command i.e
#mkvg-S Hdisk#


Volume Group Descriptor Area VGDA




Volume Group Descriptor Area (VGDA): The VGDA is an area of the disk which maintains information about the entire VG. It contains information about number of logical volumes, list of physical volumes in the VG etc. There will be at least 1 VGDA on each physical volume and some physical volumes may also have more than 1 VGDA.

Quorum: Quorum is equal to 51% or more of the VGDAs available. A quorum of VGDA is needed to activate the volume group and make it available for use and to ensure data integrity.

Quorum is required whenever you need to varyonthe VG (activate) the VG. If the quorum is not available, the system administrator can force a volume group to activate without the quorum but is not recommended.

Uses of Logical Volumes



•A logical volume may contain one of the following, and only one at a time:
–Journaled (JFS) or enhanced journaled file system (JFS2)
–Journal log (/dev/hd8)
–Paging space (/dev/hd6)
–Boot logical volume (/dev/hd5)
–Dump device
–Nothing (raw logical volume)

•Examples of JFS/JFS2 logical volumes:
/dev/hd1/home
/dev/hd2/usr
/dev/hd3/tmp
/dev/hd4/
/dev/hd9var/var
/dev/hd10opt/opt
/dev/lv00/myfilesystem)

What is JFS/JFS2 above? Read further for what is JFS.


The logical volume can contain one of the following on them:

a.File system: Logical volumes can be used to maintain data on them. That means before storing data on them you need to apply a file system over it which helps you to arrange and manage your files and directories. You can choose either journaled file system (JFS) or Enhanced Journaled File System (JFS2) as your file system. The native files system in AIX is JFS. These file systems use database journaling techniques to maintain consistency of data.

b.Paging Space: The logical volume can also be used as secondary ram area or paging space which is used by the Virtual memory manager service on your system to store inactive memory pages of your processes. The default paging space logical volume in AIX is /dev/hd6.

c.Journal Log: The logical volume can also be used to store the journal logs of the other files systems. The default logical volume where the journal logs are maintained is in the logical volume /dev/hd8.

d.Raw: Raw device is nothing but an empty logical volume. Certain applications like database related packages may require these raw logical volumes.


File System Structure in AIX:


A bit of explanation needs to be done here.. it goes like this.. read on:


a. /hd4 : / (root)- It is the top level in the hierarchical structure of the file tree. It contains all files and directories that are critically required for system operations. It also contains files, directories and programs that are required for boot process.

b. hd2 : /usr– Operating system commands, libraries and application programs. The contents of this file system can be shared across the network.

c.hd9var: /var–Variable spool and log files. The files in this file system ievarvary considerably depending on the system activity.

d./hd1: /home–All users home directories which contain the user data and files are stored here.

e.hd3: /tmp–Global notepad for the system. It’s a file system or space accessible for all users for temporary files and work space. Should be cleared and cleaned on a regular basis.

f./proc: /proc–Special file system to support threads, or light weight processes. This file system doesn’t contain any user files.

/etc/filesystems:


To go to this screen use the command #cd /etc/filesystems


The file /etc/filesystemsmaintains details of the all the filesystemson your AIX machine. This file is made up of stanza, wherein each stanza maintains details about a single file system.

The various attributes in these stanzas could be:

a.check: Used by the fsckcommand to determine the default file systems to be checked. This option can have values TRUE or FALSE.

b.dev:identifies the logical device name of the logical volume on which the file system resides.

c.Mount: used by the mount command to determine whether a file system should be mounted by default or not. Valid values could be TRUE, FALSE or automatic ( file systems should be mounted during system startup).

d.type: used to group together related file systems for easy handling.

e.vfs:specifies the type of mount. i.e. virtual file system to mount.

f.vol: specifies a label for a file system.

g.log: device to which log data is to be written.


Mount:



Mount: connects file systems to the directory hierarchy.

File systems are associated with logical volumes.

When you mount a file system, the logical volume and the contents of it is connected to a directory in the tree structure

mount /dev/mylv /home/user9.


Explanation:
A file system has to be mounted, i.e. connected to a directory structure if you want to use it. The command called mount can be used to do it. You can also unmount the file system by using the umount command or even using SMIT.
If you want a particular file system to be mounted during system startup, you can do it by modifying the /etc/filesystems by using the options mount=automatic ormount=true.

Mounting Over an Empty Directory


Mounting Over Files


Listing File systems

You can use the command lsfs to get a list of all the file systems.

The output in the above visual shows details about the file system. The various attributes of the output are:
a.Name of the file system
b.Node Name, which is only valid if the file system is a Network file system.
c.Mount Point for the file system.
d.Virtual File System (jfs, jfs2 or cdrfs)
e.Size of the file system
f.Mount options if any, like ro(read only) or rw(read-write)
g.Auto, automatic mounting during system startup or not.

You can also use the fastpath #smit fs to get the same details.

Listing Logical Volumes


You can use the command lsvg–l <VG name> to get a list of all the logical volumes in a particular volume group.

The output would show you details of the logical volumes, volume group wise.

The output would show you:
a.Logical volume name.
b.Type of the logical volume i.e. regular file system (jfs,jfs2) or journal log or paging space , boot etc
c.Number of Logical partitions in the logical volume
d.Number of Physical Partitions in the logical volume.
e.How many physical volumes has the logical volume spread to.
f.State of the logical volume i.e. open/closed/synchronized.
g.Mount point.


Incoming Search Terms
Logical Volume Manager
LVM
Filesystem on aix
AIX Filesystem
AIX Logical Volume Manager
JFS and JFS2
AIX Volume groups
AIX Physical Volume
AIX Logical Volume
AIX Physical partition
AIX Logical partition
Volume group descriptor area
AIX filesystem structure















No comments:

Post a Comment