IBM AIX - Disks and Filesystems


AIX provides powerful tools for management of disks and file systems. This is accomplished through the use of JFS (Journaled File System) and LSM (Logical Storage Manager).

Logical Volume Manager

The AIX Logical Volume Manager is similar in execution to the HP-UX and Digital Unix Logical Volume Managers, and is similar in purpose to the Sun On-line Disksuite package. The purpose of LVM is to add a layer of abstraction between file systems and disk drives. This layer of abstraction allows for easier management of space, and allows for enhancements such as disk mirroring, disk concatenation, and disk striping.

There are three main objects in the Logical Volume Manager:

Physical Volumes (PVs)

Physical volumes are a wrapper of sorts that is placed around a disk drive to allow it to be managed. A PV normally consists of 1 distinct physical disk. But in the case of a RAID controller, a PV consists of an entire "logical" disk, as presented to the system by the RAID controller.

Volume Groups (VGs)
A pool of storage, consisting of one or more physical volumes. A volume group may span multiple physical disks. A volume group can be thought of as a logical disk. Storage is allocated to one or more logical volumes, which can grow or shrink in size.
Logical Volumes (LVs)
If VGs can be thought of as disks, Logical Volumes can be thought of as partitions or slices on those disks. An LV is the object that filesystems, raw partitions, and paging space is built upon. Logical volumes can be expanded or moved from one PV to another on the fly while the LV is in use.
Logical volumes cannot be reduced in size. If a LV must be shrunken, you will need to back up the data, remove the LV, create a new smaller LV, and then restore the data.

JFS

The Journaled File System has several advantages over the BSD and UFS filesystems used in other Unixes. One disadvantage of UFS and BSD file systems is the possibility of file system corruption in the event of a system crash or power failure. This corruption can occur when files or directories are created or removed, but the system crashes before the information can be written to disk. This can lead to unreferenced files, missing file blocks, or file blocks belonging to multiple files.

This problem is much reduced in JFS file systems through the use of a log volume for file systems. While cached data can still be lost if the system crashes before it is synced to disk, file system changes such as inode and block allocation and freeing are logged to disk right away. In the event of a system crash, this log file is replayed prior to bringing a file system back on-line. This allows the file system structure to be intact even after a crash. This log replay process is much much quicker than the traditional fsck process. In a UFS file system, all block allocation must be verified, which takes multiple passes. Multi-gigabyte file systems can take tens of minutes to fsck. File systems in the hundreds of gigabytes can take hours to fsck if corrupted.

In contrast, JFS logs can be replayed in tens of seconds, even for large file systems. This is because only small log has to be processed rather than entire disks.

JFS file systems still may occasionally need to be fsck'd, but the is a much rarer occurrence.

Summary of Filesystem and LVM Commands

LVM and file systems can either be manipulated via SMIT or the command line. If using SMIT, the device, LVM, and file system screens are in different sections from each other. The other command line options are in families. Most of the "vg" commands have "vg" in the name, "lv" commands have "lv" in their name, etc.

Device Commands
lsdevThe "lsdev -Cc disk" command can be used to display the what disks are recognized by the system. This will display disks whether they have been initialized as PVs or not.
rmdevRemove a device from the system configuration. This is done to remove the device configuration when a faulty disk is replaced, or if a disk is moved to another system.
cfgmgrRe-scan the system for devices that were not available at system start up. This can be done to recognize hot pluggable drives that were added after the system was up, or can be used to recognize devices such as external tape or disk drives that were not powered on when the system was booted up.
Physical Volume Commands
pvcreateInitialize a disk as a Physical Volume. This must be done prior to adding a disk to a volume group.
lspvDisplay the Physical Volumes on a system. When given a PV name as a parameter, it gives detailed information about that PV.
Volume Group Commands
lsvgList information about logical volumes. When given with parameters, it lists all volume groups on the system. When given parameters, it can give detailed information about a particular VG, including information about what logical volumes are in that volume group.
chvgChange volume group characteristics.
mkvgCreate a volume group.
extendvgAdd PVs to a volume group.
reducevgRemove unused PVs from a volume group. If logical volumes currently reside on the PV in question, the "migratepv" command can be used to move the LV onto another disk in the VG provided there is enough space to do so.
exportvgRemove knowledge of a volume group from the Kernel. This can be used on removable disks such as optical disks or Iomega Jaz drives prior to removing the drive from a system, or can be used when moving a disk or disks from one system to another. The data in the VG is left intact.
importvgRe-initializes kernel knowledge of a volume group that had been previously exported. The data on the VG is left intact, and becomes accessible once it has been imported. The existing logical volume names are used unless they conflict with logical volumes currently in use on the system.
mirrorvgCreates mirror volumes for all volumes in a volume group.
unmirrorvgRemoves a mirror from each volume in a volume group.
Logical Volume Commands
lslvLists information about logical volumes. A logical volume name must be specified. In order to list information about all logical volumes, you would need to use "lsvg" to list all volume groups, and then use "lsvg -l " on each volume group. You could then use "lslv " to list the detailed information about each logical volume found.
mklvCreate a logical volume.
rmlvDelete a logical volume.
extendlvIncrease the size of a logical volume.
chlvChange the characteristics of a logical volume.
mklvcopyMirror a logical volume. This allows for RAID-1 in software.
rmlvcopyRemoves a mirror copy of a logical volume.
File System Commands
crfsCreate a file system. This command can be used to create a file system on an existing logical volume, or it can be used as an all in one command to create both a logical volume and file system at once.
chfsChange file system characteristics. This can be used to increase the size of a file system.
rmfsRemove a filesystem, its associated logical volume, and its entry in /etc/filesystems.
Paging Space Commands
lspsLists information about paging space volumes.

0 comments

Post a Comment

 
|  AIX Advanced Interactive eXecutive. Blogger Template By Lawnydesignz Powered by Blogger