2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【AIX】Logical Volumeの作成・マウント・拡張

Last updated at Posted at 2025-06-24

はじめに

本記事では、Logical Volume(LV)を作成し、ディレクトリーにマウントした際のメモです。
rootvgというVolume Group(VG)にtestlvというLVを作成して、/testというディレクトリーにマウントしています。
マウントした後にtestlvのサイズを拡張しました。

image.png

実施内容

①LV作成

lsvgコマンドにより、VGのステータスを確認しました。
rootvgはPhysical Partition(PP) sizeが1024MB(=1GB)でした。
15個のPPが使用されていました。

# lsvg rootvg
VOLUME GROUP:       rootvg                   VG IDENTIFIER:  00cde68000004b00000001979b0724c5
VG STATE:           active                   PP SIZE:        1024 megabyte(s)
VG PERMISSION:      read/write               TOTAL PPs:      5961 (6104064 megabytes)
MAX LVs:            256                      FREE PPs:       5946 (6088704 megabytes)
LVs:                12                       USED PPs:       15 (15360 megabytes)
OPEN LVs:           11                       QUORUM:         2 (Enabled)
TOTAL PVs:          1                        VG DESCRIPTORS: 2
STALE PVs:          0                        STALE PPs:      0
ACTIVE PVs:         1                        AUTO ON:        yes
MAX PPs per VG:     30480
MAX PPs per PV:     6096                     MAX PVs:        5
LTG size (Dynamic): 256 kilobyte(s)          AUTO SYNC:      no
HOT SPARE:          no                       BB POLICY:      non-relocatable
PV RESTRICTION:     none                     INFINITE RETRY: no
DISK BLOCK SIZE:    4096                     CRITICAL VG:    no
FS SYNC OPTION:     no                       CRITICAL PVs:   no
ENCRYPTION:         yes

rootvgの中に、1GBのtestlvというLVを作成しました。
smit lv
→Add a Logical Volume
→VGとしてrootvgを指定

                                                        [Entry Fields]
* VOLUME GROUP name                                  [rootvg]                +

作成するLVの設定
Number of LOGICAL PARTITIONSとして1を指定しました。

                                                        [Entry Fields]
  Logical volume NAME                                [testlv]
* VOLUME GROUP name                                   rootvg
* Number of LOGICAL PARTITIONS                       [1]                                                                     #
  PHYSICAL VOLUME names                              [hdisk0]                                                               +
  Logical volume TYPE                                [jfs2]                                                                 +
  POSITION on physical volume                         outer_middle                                                          +
  RANGE of physical volumes                           minimum                                                               +
  MAXIMUM NUMBER of PHYSICAL VOLUMES                 []                                                                      #
    to use for allocation
  Number of COPIES of each logical                    1                                                                     +
    partition
  Mirror Write Consistency?                           active                                                                +
  Allocate each logical partition copy                yes                                                                   +
    on a SEPARATE physical volume?
  RELOCATE the logical volume during reorganization?  yes                                                                   +
  Logical volume LABEL                               []
  MAXIMUM NUMBER of LOGICAL PARTITIONS               [512]                                                                   #
  Enable BAD BLOCK relocation?                        yes                                                                   +
  SCHEDULING POLICY for writing/reading               parallel                                                              +
    logical partition copies
  Enable WRITE VERIFY?                                no                                                                    +
  File containing ALLOCATION MAP                     []
  Stripe Size?                                       [Not Striped]                                                          +
  Serialize IO?                                       no                                                                    +
  Mirror Pool for First Copy                                                                                                +
  Mirror Pool for Second Copy                                                                                               +
  Mirror Pool for Third Copy                                                                                                +
  Infinite Retry Option?                              no                                                                    +
  Enable Logical Volume Encryption?                   no                                                                    +

testlvを作成することができました。
lslvコマンドにより、testlvのステータスを見ると、1GBであることが確認できました。

# lslv testlv
LOGICAL VOLUME:     testlv                 VOLUME GROUP:   rootvg
LV IDENTIFIER:      00cde68000004b00000001979b0724c5.13 PERMISSION:     read/write
VG STATE:           active/complete        LV STATE:       closed/syncd
TYPE:               jfs2                   WRITE VERIFY:   off
MAX LPs:            512                    PP SIZE:        1024 megabyte(s)
COPIES:             1                      SCHED POLICY:   parallel
LPs:                1                      PPs:            1
STALE PPs:          0                      BB POLICY:      non-relocatable
INTER-POLICY:       minimum                RELOCATABLE:    yes
INTRA-POLICY:       middle                 UPPER BOUND:    5
MOUNT POINT:        N/A                    LABEL:          None
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?:     NO
INFINITE RETRY:     no                     PREFERRED READ: 0
ENCRYPTION:         no

もう一度、rootvgのステータスを確認すると、使用中のPPが15から16になっており、rootvgの1PP分(1GB)をtestlvに割り当てていることが確認できました。

# lsvg rootvg
VOLUME GROUP:       rootvg                   VG IDENTIFIER:  00cde68000004b00000001979b0724c5
VG STATE:           active                   PP SIZE:        1024 megabyte(s)
VG PERMISSION:      read/write               TOTAL PPs:      5961 (6104064 megabytes)
MAX LVs:            256                      FREE PPs:       5945 (6087680 megabytes)
LVs:                13                       USED PPs:       16 (16384 megabytes)
OPEN LVs:           11                       QUORUM:         2 (Enabled)
TOTAL PVs:          1                        VG DESCRIPTORS: 2
STALE PVs:          0                        STALE PPs:      0
ACTIVE PVs:         1                        AUTO ON:        yes
MAX PPs per VG:     30480
MAX PPs per PV:     6096                     MAX PVs:        5
LTG size (Dynamic): 256 kilobyte(s)          AUTO SYNC:      no
HOT SPARE:          no                       BB POLICY:      non-relocatable
PV RESTRICTION:     none                     INFINITE RETRY: no
DISK BLOCK SIZE:    4096                     CRITICAL VG:    no
FS SYNC OPTION:     no                       CRITICAL PVs:   no
ENCRYPTION:         yes

testlvのマウントポイントとして、/testというディレクトリーを作成しました。
smit fs
→Add / Change / Show / Delete File Systems
→Enhanced Journaled File Systems
→Add an Enhanced Journaled File System on a Previously Defined Logical Volume

                                                        [Entry Fields]
* LOGICAL VOLUME name                                 testlv                                                                +
* MOUNT POINT                                        [/test]  
  Mount AUTOMATICALLY at system restart?              no                                                                    +
  PERMISSIONS                                         read/write                                                            +
  Mount OPTIONS                                      []                                                                     +
  Block Size (bytes)                                  4096                                                                  +
  Logical Volume for Log                                                                                                    +
  Inline Log size (MBytes)                           []                                                                      #
  Extended Attribute Format                                                                                                 +
  Enable Quota Management?                            no                                                                    +
  Enable EFS?                                         no                                                                    +
  Allow internal snapshots?                           no                                                                    +
  Mount GROUP                                        []
  Enable LFF?                                         no                                                                    +

作成したtestlvのマウント・ポイントとして指定された/testのディレクトリーが作成されました。

# lsfs
Name            Nodename   Mount Pt               VFS   Size    Options    Auto Accounting
/dev/hd4        --         /                      jfs2  4194304 --         yes  no
/dev/hd1        --         /home                  jfs2  2097152 --         yes  no
/dev/hd2        --         /usr                   jfs2  6291456 --         yes  no
/dev/hd9var     --         /var                   jfs2  2097152 --         yes  no
/dev/hd3        --         /tmp                   jfs2  2097152 --         yes  no
/dev/hd11admin  --         /admin                 jfs2  2097152 --         yes  no
/proc           --         /proc                  procfs --      --         yes  no
/dev/hd10opt    --         /opt                   jfs2  2097152 --         yes  no
/dev/livedump   --         /var/adm/ras/livedump  jfs2  2097152 --         yes  no
/dev/testlv     --         /test                  jfs2  2097152 rw         no   no

ただし、dfコマンドの結果を見るとまだtestlvは/testにマウントされていません。

# df -g
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4           2.00      0.00  100%     2839    94% /
/dev/hd2           3.00      0.86   72%    45382    19% /usr
/dev/hd9var        1.00      0.97    4%      618     1% /var
/dev/hd3           1.00      1.00    1%       20     1% /tmp
/dev/hd1           1.00      1.00    1%        7     1% /home
/dev/hd11admin      1.00      1.00    1%        5     1% /admin
/proc                 -         -    -        -      - /proc
/dev/hd10opt       1.00      0.98    2%      165     1% /opt
/dev/livedump      1.00      1.00    1%        4     1% /var/adm/ras/livedump
/ahafs                -         -    -       35     1% /aha

/dev/testlvを/testにマウントしました。

# mount /dev/testlv /test
# df -g
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4           2.00      1.95    3%     2838     1% /
/dev/hd2           3.00      0.86   72%    45382    19% /usr
/dev/hd9var        1.00      0.97    4%      618     1% /var
/dev/hd3           1.00      1.00    1%       20     1% /tmp
/dev/hd1           1.00      1.00    1%        7     1% /home
/dev/hd11admin      1.00      1.00    1%        5     1% /admin
/proc                 -         -    -        -      - /proc
/dev/hd10opt       1.00      0.98    2%      165     1% /opt
/dev/livedump      1.00      1.00    1%        4     1% /var/adm/ras/livedump
/ahafs                -         -    -       35     1% /aha
/dev/testlv        1.00      0.99    1%        4     1% /test  

②拡張

testlvのサイズを1GBから20GBに拡張しました。
smit fs
→Add / Change / Show / Delete File Systems
→Enhanced Journaled File Systems
→Change / Show Characteristics of an Enhanced Journaled File System
拡張するディレクトリー(/test)を選択し、Unit Sizeを20GBに拡張

                                                        [Entry Fields]
  File system name                                    /test  
  NEW mount point                                    [/test]  
  SIZE of file system
          Unit Size                                   Gigabytes                                                          +
          Number of units                            [20]                                                                 #
  Mount GROUP                                        []
  Mount AUTOMATICALLY at system restart?              no                                                                 +
  PERMISSIONS                                         read/write                                                         +
  Mount OPTIONS                                      []                                                                  +
  Start Disk Accounting?                              no                                                                 +
  Block Size (bytes)                                  4096
  Inline Log?                                         yes
  Inline Log size (MBytes)                           [8]                                                                  #
  Extended Attribute Format                          [v1]
  Enable Quota Management?                            no                                                                 +
  Allow Small Inode Extents?                          yes                                                                +
  Enable EFS?                                         no                                                                 +
  Reclaim free space from filesystem?                 no                                                                 +
  Enable LFF?                                                                                                            +
  Swap existing log device?                          []                                                                  +

testlvのサイズが、1GBから20GBに拡張されました。

# df -g
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4           2.00      1.95    3%     2838     1% /
/dev/hd2           3.00      0.86   72%    45382    19% /usr
/dev/hd9var        1.00      0.97    4%      618     1% /var
/dev/hd3           1.00      1.00    1%       20     1% /tmp
/dev/hd1           1.00      1.00    1%        7     1% /home
/dev/hd11admin      1.00      1.00    1%        5     1% /admin
/proc                 -         -    -        -      - /proc
/dev/hd10opt       1.00      0.98    2%      165     1% /opt
/dev/livedump      1.00      1.00    1%        4     1% /var/adm/ras/livedump
/ahafs                -         -    -       35     1% /aha
/dev/testlv       20.00     19.92    1%        4     1% /test  
# lslv testlv
LOGICAL VOLUME:     testlv                 VOLUME GROUP:   rootvg
LV IDENTIFIER:      00cde68000004b00000001979b0724c5.13 PERMISSION:     read/write
VG STATE:           active/complete        LV STATE:       opened/syncd
TYPE:               jfs2                   WRITE VERIFY:   off
MAX LPs:            512                    PP SIZE:        1024 megabyte(s)
COPIES:             1                      SCHED POLICY:   parallel
LPs:                20                     PPs:            20
STALE PPs:          0                      BB POLICY:      non-relocatable
INTER-POLICY:       minimum                RELOCATABLE:    yes
INTRA-POLICY:       middle                 UPPER BOUND:    5
MOUNT POINT:        /test                  LABEL:          /test  
MIRROR WRITE CONSISTENCY: on/ACTIVE
EACH LP COPY ON A SEPARATE PV ?: yes
Serialize IO ?:     NO
INFINITE RETRY:     no                     PREFERRED READ: 0
ENCRYPTION:         no

rootvgのステータスを確認すると、USED PPsが15から35へ変更されていました。
rootvgからtestlvに新たに20個のPPを(つまり20GB分)割り当てたことも確認できました。
PPs : 15→35

# lsvg rootvg
VOLUME GROUP:       rootvg                   VG IDENTIFIER:  00cde68000004b00000001979b0724c5
VG STATE:           active                   PP SIZE:        1024 megabyte(s)
VG PERMISSION:      read/write               TOTAL PPs:      5961 (6104064 megabytes)
MAX LVs:            256                      FREE PPs:       5926 (6068224 megabytes)
LVs:                13                       USED PPs:       35 (35840 megabytes)
OPEN LVs:           12                       QUORUM:         2 (Enabled)
TOTAL PVs:          1                        VG DESCRIPTORS: 2
STALE PVs:          0                        STALE PPs:      0
ACTIVE PVs:         1                        AUTO ON:        yes
MAX PPs per VG:     30480
MAX PPs per PV:     6096                     MAX PVs:        5
LTG size (Dynamic): 256 kilobyte(s)          AUTO SYNC:      no
HOT SPARE:          no                       BB POLICY:      non-relocatable
PV RESTRICTION:     none                     INFINITE RETRY: no
DISK BLOCK SIZE:    4096                     CRITICAL VG:    no
FS SYNC OPTION:     no                       CRITICAL PVs:   no
ENCRYPTION:         yes

以上

2
0
5

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?