AIX 基础笔记4 Working with the Logical Volume Manager 1

*Logical Volume Manager

# smitty lvm

                             Logical Volume Manager

 Move cursor to desired item and press Enter.

   Volume Groups

  Logical Volumes

  Physical Volumes

  Paging Space

 *SMIT volume group menu

# smitty vg

                                 Volume Groups

 Move cursor to desired item and press Enter.

   List All Volume Groups

  Add a Volume Group

  Set Characteristics of a Volume Group

  List Contents of a Volume Group

  Remove a Volume Group

  Activate a Volume Group

  Deactivate a Volume Group

  Import a Volume Group

  Export a Volume Group

  Mirror a Volume Group

  Unmirror a Volume Group

  Synchronize LVM Mirrors

  Back Up a Volume Group

  Remake a Volume Group

  Preview Information about a Backup

  Verify the Readability of a Backup (Tape only)

  View the Backup Log

  List Files in a Volume Group Backup

  Restore Files in a Volume Group Backup

 *Adding a volume group to the system

# smitty mkvg

                               Add a Volume Group

 Move cursor to desired item and press Enter.

  Add an Original Volume Group

  Add a Big Volume Group

  Add a Scalable Volume Group

   Add an Original Volume Group

 Type or select values in entry fields.

Press Enter AFTER making all desired changes. [Entry Fields]

  VOLUME GROUP name                                  [datavg]

  Physical partition SIZE in megabytes                                       +

* PHYSICAL VOLUME names                              [hdisk1 hdisk2]           +

  Force the creation of a volume group?               no                     +

  Activate volume group AUTOMATICALLY                 yes                    +

    at system restart?

  Volume Group MAJOR NUMBER                          []                      +#

  Create VG Concurrent Capable?                       no                     +

 

*Adding a scalable volume group to the system

# mkvg -S -y db2_vg hdisk3                 (or)

# smitty mkvg

                               Add a Volume Group

 

Move cursor to desired item and press Enter.

 

  Add an Original Volume Group

  Add a Big Volume Group

  Add a Scalable Volume Group

 

                          Add a Scalable Volume Group

 

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

 

                                                        [Entry Fields]

  VOLUME GROUP name                                  [db2_vg]

  Physical partition SIZE in megabytes                                       +

* PHYSICAL VOLUME names                              [hdisk3]                  +

  Force the creation of a volume group?               no                     +

  Activate volume group AUTOMATICALLY                 yes                    +

    at system restart?

  Volume Group MAJOR NUMBER                          []                      +#

  Create VG Concurrent Capable?                       no                     +

  Max PPs per VG in units of 1024                     32                     +

  Max Logical Volumes                                 256                    +

  Enable Strict Mirror Pools                          No                     +

 

*Listing volume groups and VG attributes

# lsvg

rootvg

datavg

db2_vg

# lsvg -o

datavg

rootvg

# lsvg rootvg

VOLUME GROUP:       rootvg                   VG IDENTIFIER:  00c8c36600004c000000013068f60d16

VG STATE:           active                   PP SIZE:        512 megabyte(s)

VG PERMISSION:      read/write               TOTAL PPs:      1116 (571392 megabytes)

MAX LVs:            256                      FREE PPs:       58 (29696 megabytes)

LVs:                16                       USED PPs:       1058 (541696 megabytes)

OPEN LVs:           15                       QUORUM:         1 (Disabled)

TOTAL PVs:          2                        VG DESCRIPTORS: 3

STALE PVs:          0                        STALE PPs:      0

ACTIVE PVs:         2                        AUTO ON:        yes

MAX PPs per VG:     32512

MAX PPs per PV:     1016                     MAX PVs:        32

LTG size (Dynamic): 1024 kilobyte(s)         AUTO SYNC:      no

HOT SPARE:          no                       BB POLICY:      relocatable

PV RESTRICTION:     none

 

*Listing PVs in a VG and VG contents

# lsvg -p rootvg

rootvg:

PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION

hdisk0            active            558         57          00..00..00..00..57

hdisk1            active            558         1           00..00..00..00..01

# lsvg -l rootvg

rootvg:

LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT

hd5                 boot       1       2       2    closed/syncd  N/A

hd6                 paging     44      88      2    open/syncd    N/A

hd8                 jfs2log    1       2       2    open/syncd    N/A

hd4                 jfs2       148     296     2    open/syncd    /

hd2                 jfs2       20      40      2    open/syncd    /usr

hd9var              jfs2       20      40      2    open/syncd    /var

hd3                 jfs2       20      40      2    open/syncd    /tmp

hd1                 jfs2       79      158     2    open/syncd    /home

hd10opt             jfs2       20      40      2    open/syncd    /opt

hd11admin           jfs2       1       2       2    open/syncd    /admin

fwdump              jfs2       2       4       2    open/syncd    /var/adm/ras/platform

lg_dumplv           sysdump    4       4       1    open/syncd    N/A

livedump            jfs2       1       2       2    open/syncd    /var/adm/ras/livedump

fslv00              jfs2       200     200     1    open/syncd    /ptc

fslv02              jfs2       120     120     1    open/syncd    /oracle

fslv03              jfs2       20      20      1    open/syncd    /ftp

 

*Change a volume group

# smitty chvg

                             Change a Volume Group

 

Type or select a value for the entry field.

Press Enter AFTER making all desired changes.

 

                                                        [Entry Fields]

* VOLUME GROUP name                                  [datavg]                +

 

                             Change a Volume Group

 

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

 

                                                        [Entry Fields]

* VOLUME GROUP name                                   datavg

* Activate volume group AUTOMATICALLY                 yes                    +

    at system restart?

* A QUORUM of disks required to keep the volume       no                     +

   group on-line ?

  Convert this VG to Concurrent Capable?              no                     +

  Change to big VG format?                            no                     +

  Change to scalable VG format?                       no                     +

  LTG Size in kbytes                                  1024                   +

  Set hotspare characteristics                        n                      +

  Set synchronization characteristics of stale        n                      +

   partitions

  Max PPs per VG in units of 1024                     32                     +

  Max Logical Volumes                                 256                    +

  Mirror Pool Strictness                                                     +

 

(or)

# chvg -a y -Q n datavg

 

*Extend and reduce a VG

(1) Add a Physical Volume to a Volume Group

extendvg [-f] Volumegroup hdiskn           

(2) Remove a Physical Volume from a Volume Group

reducevg [-d] [-f] Volumegroup hdiskn    

The -d option deallocates the existing logical volume partitions, and then deletes resultant empty logical volumes from the  specified physical volumes. User confirmation is required unless the -f flag is added.

# extendvg -f rootvg hdisk2

# lsvg -p rootvg | awk '{print $1, $2}'

rootvg:

PV_NAME        PVSTATE

hdisk0               active

hdisk1               active

hdisk2               active

# reducevg -f rootvg hdisk1

# lsvg -p rootvg | awk '{print $1, $2}'

rootvg:

PV_NAME        PVSTATE

hdisk0               active

hdisk2               active

 

*Remove a volume group

# reducevg -df db2_vg hdisk2 hdisk3    (or)

# smitty reducevg2

                             Remove a Volume Group

 

Type or select a value for the entry field.

Press Enter AFTER making all desired changes.

 

                                                        [Entry Fields]

* VOLUME GROUP name                                  [db2_vg]                 +

 

*Activate and deactivate a volume group

# varyonvg datavg

# varyoffvg datavg

(or)

# smitty varyonvg

                            Activate a Volume Group

 

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

 

                                                        [Entry Fields]

* VOLUME GROUP name                                  [datavg]                 +

  RESYNCHRONIZE stale physical partitions?            yes                    +

  Activate volume group in SYSTEM                     no                     +

    MANAGEMENT mode?

  FORCE activation of the volume group?               no                     +

   Warning--this may cause loss of data

   integrity.

  Varyon VG in Concurrent Mode?                       no                     +

  Synchronize Logical Volumes?                        no                     +

# smitty varyoffvg

                           Deactivate a Volume Group

 

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

 

                                                        [Entry Fields]

* VOLUME GROUP name                                  [datavg]                 +

  Put volume group in SYSTEM                          no                     +

    MANAGEMENT mode?

 

*Import and export a volume group

(1) Exporting a volume group

If you have a volume group on one or more external disks that you want to access on another system, you must first  export the volume group from the current system using the exportvg command. This removes all information about the  volume group from the system. To export a volume group, it must be inactive.

# exportvg datavg      (or)

# smitty exportvg

                             Export a Volume Group

 

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

 

                                                        [Entry Fields]

* VOLUME GROUP name                                  [datavg]                 +

(2) Importing a volume group

To access an exported volume group on a system , it must be imported to the system using the importvg command.

Never attempt to import rootvg.

# importvg -y datavg hdisk3     (or)

# smitty importvg

                             Import a Volume Group

 

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

 

                                                        [Entry Fields]

  VOLUME GROUP name                                  [datavg]

* PHYSICAL VOLUME name                               [hdisk3]                 +

  Volume Group MAJOR NUMBER                          []                      +#

 

*Reorganize a Volume Group

# reorgvg rootvg      (or)

# smitty reorgvg

                           Reorganize a Volume Group

 

Type or select a value for the entry field.

Press Enter AFTER making all desired changes.

 

                                                        [Entry Fields]

* VOLUME GROUP name                                  [rootvg]                 +

 

*LVM and RAID support

(1) LVM supports the following three software RAID configurations:

  - RAID 0, Striping

  - RAID 1, Mirroring (up to 3 copies)

  - RAID 10 or 1+0, Striping + Mirroring

(2) Striping aides performance, whereas mirroring aides availability.

(3) In today's environment , most data resides in SANs. Disks in a SAN are generally grouped together into a RAID array  and divided ito LUNs.

  - AIX sees LUNs as physical disks.

  - One should not further deploy AIX RAID configruations on top of H/W (SAN) RAID configurations.

  - SAN environments provide greater levels of RAID support. (performance and availability)

  - LUNs can be increased in size, if so AIX must know about it: # chvg -g datavg

 

*LVM options which affect performance

(1) Inter- and intra-policy

Logical volume placement on disk

(2) Scheduling policy

Dictates how data is read/written for mirrored LVs

(3) Mirror write consistency

Ensures mirrored PPs are consistent

(4) Write verify

Verifies all writes with a read operation

Default is no. Generally it is not recommended to set to yes as it will impact system (write) performance.

 

*Logical volume placement

(1) Intra-physical volume allocation policy

83785_1354088168eZzP.jpg

(2) Inter-physical volume allocation policy

  - Minimum (default)

     `1 LV copy. One (or minimum) PV should contain all PPs.

     `2 or 3 LV copies. Use as many PVs as copies, keeping PV usage down to a minimum.

  - Maximum

     `PPs should be spread over as many PVs as possible.

Note: These settings have little effect when used in SAN environments, whereby LUNs are in RAID configurations.

 

你可能感兴趣的:(enter,Cursor,volume,desired)