Aix - Disks & Filesystems

Embed Size (px)

Citation preview

  • 7/27/2019 Aix - Disks & Filesystems

    1/3

    IBM AIX - Disks and Filesystems

    AIX provides powerful tools for management ofdisks and file systems. This is accomplished through the use

    ofJFS (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 ofLVM is to add a

    layer ofabstraction between file systems and disk drives. This layer ofabstraction allows for easier

    management ofspace, 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 ofsorts that is placed around a disk drive to allow it to be

    managed. A PV normally consists of1 distinct physical disk. But in the case ofa RAID

    controller, a PV consists ofan entire "logical" disk, as presented to the system by the RAID

    controller.

    Volume Groups (VGs)

    A pool ofstorage, consisting ofone or more physical volumes. A volume group may span

    multiple physical disks. A volume group can be thought ofas a logical disk. Storage is allocated

    to one or more logical volumes, which can grow or shrink in size.

    Logical Volumes (LVs)

    IfVGs can be thought ofas disks, Logical Volumes can be thought ofas 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. Ifa LV must be shrunken, you will need to back upthe 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 ofUFS and BSD file systems is the possibility offile system corruption in the event ofa

    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 ofa log volume for file systems. While

    cached data can still be lost ifthe 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 ofa system crash, this log file is

  • 7/27/2019 Aix - Disks & Filesystems

    2/3

    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 ofminutes to fsck. File systems in the hundreds ofgigabytes can take hours to fsck ifcorrupted.

    In contrast, JFS logs can be replayed in tens ofseconds, 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. Ifusing SMIT, the device,

    LVM, and file system screens are in different sections from each other. The other command line options are

    in families. Most ofthe "vg" commands have "vg"in the name, "lv"commands have "lv" in their name, etc.

    Device commands

    Physical Volume commandsVolume Group commands

    Logical Volume commands

    File System commands

    Paging Volume commands

    Device Commands

    lsdev

    The "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.

    rmdev

    Remove a device from the system configuration. This is done to remove the

    device configuration when a faulty disk is replaced, or ifa disk is moved to

    another system.

    cfgmgr

    Re-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 VolumeCommands

    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 allvolume 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.

  • 7/27/2019 Aix - Disks & Filesystems

    3/3

    chvg Change volume group characteristics.

    mkvg Create a volume group.

    extendvg Add PVs to a volume group.

    reducevg

    Remove unused PVs from a volume group. Iflogical volumes currently reside on

    the PV in question, the "migratepv" command canbe used to move the LV onto

    another disk in the VG provided there is enough space to do so.

    exportvg

    Remove knowledge ofa 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.

    importvg

    Re-initializes kernel knowledge ofa 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.

    mirrorvg Creates mirror volumes f or all volumes in a volume group.

    unmirrorvg Removes a mirror f rom each volume in a volume group.

    Logical Volume

    Commands

    lslv

    Lists 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.mklv Create a logical volume.

    rmlv Delete a logical volume.

    extendlv Increase the size ofa logical volume.

    chlv Change the characteristics of a logical volume.

    mklvcopy Mirror a logical volume. This allows for RAID-1 in software.

    rmlvcopy Removes a mirror copy of a logical volume.

    File System

    Commands

    crfs

    Create 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 ofa file

    system.

    rmfsRemove a filesystem, its associated logical volume, and its entry in

    /etc/filesystems.

    Paging Space

    Commands

    lsps Lists inf ormation about paging space volumes.