For When You Can't Have The Real Thing
[ start | index | login ]
start > AIX > 5.3 > Disk Space Quicksheet

Disk Space Quicksheet

Created by dave. Last edited by dave, 8 years and 200 days ago. Viewed 4,847 times. #2
[diff] [history] [edit] [rdf]
labels
attachments

SMIT is obtuse but can start you in the right direction.

There are four layers of abstraction between you and your disk:

  • the filesystem
  • LV, or Logical Volume: the container that holds your filesystem (swap, raw Oracle, whatever).
  • VG, or Volume Group: the collection of LVs which use this collection of PVs.
  • PV or Physical Volume: the actual hard disk. You add storage by adding a PV to a VG, then growing the LVs, and growing the filesystems on top of them. How you add PVs to VGs dictates how RAIDing happens (if at all). Most of the time we've just been serially adding disks and space to existing VGs, and growing the LVs into that. This means that the failure of any one singal disk will kill the entire VG, and probably the machine as well.
LVs do not need contiguous space to grow, so it is quite possible that you'll end up with LVs with space on multiple disks.

A not entirely contrived example

List PVs in the system:

# lspv
hdisk0          0000307af340eb83                    rootvg          active
hdisk1          none                                None
hdisk3          0007624ab6349b34                    None

Show details of a PV:

# lspv hdisk0
PHYSICAL VOLUME:    hdisk0                   VOLUME GROUP:     rootvg
PV IDENTIFIER:      0000307af340eb83 VG IDENTIFIER     0000307a0000d2000000010af340fc8e
PV STATE:           active
STALE PARTITIONS:   0                        ALLOCATABLE:      yes
PP SIZE:            128 megabyte(s)          LOGICAL VOLUMES:  10
TOTAL PPs:          546 (69888 megabytes)    VG DESCRIPTORS:   2
FREE PPs:           327 (41856 megabytes)    HOT SPARE:        no
USED PPs:           219 (28032 megabytes)    MAX REQUEST:      256 kilobytes
FREE DISTRIBUTION:  109..00..00..109..109
USED DISTRIBUTION:  01..109..109..00..00

The interesting values here are:

  • TOTAL PPs: the size of the disk
  • FREE PPs: the amount of space not assigned to a VG
  • USED PPs: the total amount of space assigned to any VG
List the VGs in the system:

# lsvg
rootvg

List details of the VG:

# lsvg rootvg
VOLUME GROUP:       rootvg                   VG IDENTIFIER:  0000307a0000d2000000010af340fc8e
VG STATE:           active                   PP SIZE:        128 megabyte(s)
VG PERMISSION:      read/write               TOTAL PPs:      546 (69888 megabytes)
MAX LVs:            256                      FREE PPs:       327 (41856 megabytes)
LVs:                10                       USED PPs:       219 (28032 megabytes)
OPEN LVs:           9                        QUORUM:         2
TOTAL PVs:          1                        VG DESCRIPTORS: 2
STALE PVs:          0                        STALE PPs:      0
ACTIVE PVs:         1                        AUTO ON:        yes
MAX PPs per VG:     32512
MAX PPs per PV:     1016                     MAX PVs:        32
LTG size (Dynamic): 256 kilobyte(s)          AUTO SYNC:      no
HOT SPARE:          no                       BB POLICY:      relocatable

List LVs in the VG:

# lsvg -l rootvg
rootvg:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
hd5                 boot       1     1     1    closed/syncd  N/A
hd6                 paging     4     4     1    open/syncd    N/A
hd8                 jfs2log    1     1     1    open/syncd    N/A
hd4                 jfs2       1     1     1    open/syncd    /
hd2                 jfs2       17    17    1    open/syncd    /usr
hd9var              jfs2       5     5     1    open/syncd    /var
hd3                 jfs2       17    17    1    open/syncd    /tmp
hd1                 jfs2       1     1     1    open/syncd    /home
hd10opt             jfs2       78    78    1    open/syncd    /opt
fslv00              jfs2       94    94    1    open/syncd    /opt2

See the details of a LV:

# lslv -l hd1
hd1:/home
PV                COPIES        IN BAND       DISTRIBUTION
hdisk0            001:000:000   100%          000:000:001:000:000

Add a PV to a VG:

# extendvg 'rootvg' 'hdisk3'

Growing a LV:

# lslv hd10opt
LOGICAL VOLUME:     hd10opt                VOLUME GROUP:   rootvg
LV IDENTIFIER:      0000307a0000d2000000010af340fc8e.9 PERMISSION:     read/write
VG STATE:           active/complete        LV STATE:       opened/syncd
TYPE:               jfs2                   WRITE VERIFY:   off
MAX LPs:            512                    PP SIZE:        128 megabyte(s)
COPIES:             1                      SCHED POLICY:   parallel
LPs:                78                     PPs:            78
STALE PPs:          0                      BB POLICY:      relocatable
INTER-POLICY:       minimum                RELOCATABLE:    yes
INTRA-POLICY:       center                 UPPER BOUND:    32
MOUNT POINT:        /opt                   LABEL:          /opt
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?:     NO

# extendlv hd10opt 110 hdisk0

# lslv hd10opt LOGICAL VOLUME: hd10opt VOLUME GROUP: rootvg LV IDENTIFIER: 0000307a0000d2000000010af340fc8e.9 PERMISSION: read/write VG STATE: active/complete LV STATE: opened/syncd TYPE: jfs2 WRITE VERIFY: off MAX LPs: 512 PP SIZE: 128 megabyte(s) COPIES: 1 SCHED POLICY: parallel LPs: 188 PPs: 188 STALE PPs: 0 BB POLICY: relocatable INTER-POLICY: minimum RELOCATABLE: yes INTRA-POLICY: center UPPER BOUND: 32 MOUNT POINT: /opt LABEL: /opt MIRROR WRITE CONSISTENCY: on/ACTIVE EACH LP COPY ON A SEPARATE PV ?: yes Serialize IO ?: NO

# lspv hdisk0 PHYSICAL VOLUME: hdisk0 VOLUME GROUP: rootvg PV IDENTIFIER: 0000307af340eb83 VG IDENTIFIER 0000307a0000d2000000010af340fc8e PV STATE: active STALE PARTITIONS: 0 ALLOCATABLE: yes PP SIZE: 128 megabyte(s) LOGICAL VOLUMES: 10 TOTAL PPs: 546 (69888 megabytes) VG DESCRIPTORS: 2 FREE PPs: 217 (27776 megabytes) HOT SPARE: no USED PPs: 329 (42112 megabytes) MAX REQUEST: 256 kilobytes FREE DISTRIBUTION: 108..00..00..00..109 USED DISTRIBUTION: 02..109..109..109..00

Note that for the LV, the number of LPs is increased by the requested number; also for the PV, the number of FREE PPs has dropped.

Add the space:

# chfs -a size=+10G /opt
Filesystem size changed to 41418752

# df -k /opt Filesystem 1024-blocks Free %Used Iused %Iused Mounted on /dev/hd10opt 20709376 11282980 46% 96455 4% /opt

Done!

no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt