Você está na página 1de 44

Unit 8

Working with the


Logical Volume Manager

Copyright IBM Corporation 2009


Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

5.2

Unit objectives
IBM Power Systems

After completing this unit, you should be able to:


Explain how to work with the Logical Volume Manager
Add, change, and delete:
Volume groups
Logical volumes
Physical volumes

Describe essential LVM concepts, such as:


Mirroring
Striping

Logical Volume Manager


IBM Power Systems

# smit lvm
Logical
Logical Volume
Volume Manager
Manager
Move
Move cursor
cursor to
to desired
desired item
item and
and press
press Enter.
Enter.
Volume
Volume Groups
Groups
Logical
Logical Volumes
Volumes
Physical
Physical Volumes
Volumes
Paging
Paging Space
Space

SMIT volume group menu


IBM Power Systems

Volume
Volume Groups
Groups
Move
Move cursor
cursor to
to desired
desired item
item and
and press
press Enter.
Enter.
List
List All
All Volume
Volume Groups
Groups
Add
a
Volume
Add a Volume Group
Group
Set
Set Characteristics
Characteristics of
of aa Volume
Volume Group
Group
List
Contents
of
a
Volume
List Contents of a Volume Group
Group
Remove
Remove aa Volume
Volume Group
Group
Activate
a
Activate a Volume
Volume Group
Group
Deactivate
Deactivate aa Volume
Volume Group
Group
Import
Import aa Volume
Volume Group
Group
Export
Export aa Volume
Volume Group
Group
Mirror
a
Volume
Mirror a Volume Group
Group
Unmirror
Unmirror aa Volume
Volume Group
Group
Synchronize
Synchronize LVM
LVM Mirrors
Mirrors
Back
Back Up
Up aa Volume
Volume Group
Group
Remake
a
Volume
Remake a Volume Group
Group
Preview
Preview Information
Information about
about aa Backup
Backup
Verify
the
Readability
Verify the Readability of
of aa Backup
Backup (Tape
(Tape only)
only)
View
the
Backup
Log
View the Backup Log
List
List Files
Files in
in aa Volume
Volume Group
Group Backup
Backup
Restore
Files
in
a
Volume
Restore Files in a Volume Group
Group Backup
Backup

Adding a volume group to the system


IBM Power Systems

# smit mkvg

mkvg y datavg hdisk1 hdisk2


Add
Add aa Volume
Volume Group
Group

Move
Move cursor
cursor to
to desired
desired item
item and
and press
press Enter.
Enter.
Add
Add an
an Original
Original Volume
Volume Group
Group
Add
a
Big
Volume
Add a Big Volume Group
Group
Add
Add aa Scalable
Scalable Volume
Volume Group
Group
Add
Add an
an Original
Original Volume
Volume Group
Group

VOLUME
VOLUME GROUP
GROUP name
name
Physical
Physical partition
partition SIZE
SIZE in
in megabytes
megabytes
** PHYSICAL
VOLUME
names
PHYSICAL VOLUME names
Force
Force the
the creation
creation of
of aa volume
volume group?
group?
Activate
volume
group
AUTOMATICALLY
Activate volume group AUTOMATICALLY
at
at system
system restart?
restart?
Volume
Volume Group
Group MAJOR
MAJOR NUMBER
NUMBER
Create
VG
Concurrent
Create VG Concurrent Capable?
Capable?

[Entry
[Entry Fields]
Fields]
[datavg]
[datavg]
++
[hdisk1
hdisk2]
[hdisk1 hdisk2] ++
no
++
no
yes
++
yes
[]
[]
no
no

+#
+#
++

Adding a scalable volume group to the system


IBM Power Systems

# smit mkvg

mkvg S y db2_vg hdisk3


Add
Add aa Scalable
Scalable Volume
Volume Group
Group

Type
Type or
or select
select values
values in
in entry
entry fields.
fields.
Press
Enter
AFTER
making
all
Press Enter AFTER making all desired
desired changes.
changes.
VOLUME
VOLUME GROUP
GROUP name
name
Physical
Physical partition
partition SIZE
SIZE in
in megabytes
megabytes
** PHYSICAL
VOLUME
names
PHYSICAL VOLUME names
Force
Force the
the creation
creation of
of aa volume
volume group?
group?
Activate
volume
group
AUTOMATICALLY
Activate volume group AUTOMATICALLY
at
at system
system restart?
restart?
Volume
Volume Group
Group MAJOR
MAJOR NUMBER
NUMBER
Create
VG
Concurrent
Create VG Concurrent Capable?
Capable?
Max
Max PPs
PPs per
per VG
VG in
in units
units of
of 1024
1024
Max
Logical
Volumes
Max Logical Volumes

[Entry
[Entry Fields]
Fields]
[db2_vg]
[db2_vg]
++
[hdisk3]
++
[hdisk3]
no
++
no
yes
++
yes
[]
[]
no
no
32
32
256
256

+#
+#
++
++
++

Listing volume groups and VG attributes


IBM Power Systems

## lsvg
lsvg
rootvg
rootvg
datavg
datavg
db2_vg
db2_vg
## lsvg
lsvg -o
-o
datavg
datavg
rootvg
rootvg
## lsvg
lsvg rootvg
rootvg
VOLUME
rootvg
VG
VOLUME GROUP:
GROUP:
rootvg
VG IDENTIFIER:
IDENTIFIER:
00cf2e7f00004c000000011cec07b52e
00cf2e7f00004c000000011cec07b52e
VG
active
PP
64
VG STATE:
STATE:
active
PP SIZE:
SIZE:
64 megabyte(s)
megabyte(s)
VG
PERMISSION:
read/write
TOTAL
PPs:
130
VG PERMISSION:
read/write
TOTAL PPs:
130 (8320
(8320 megabytes)
megabytes)
MAX
LVs:
256
FREE
PPs:
54
(3456
MAX LVs:
256
FREE PPs:
54 (3456 megabytes)
megabytes)
LVs:
11
USED
76
LVs:
11
USED PPs:
PPs:
76 (4864
(4864 megabytes)
megabytes)
OPEN
LVs:
9
QUORUM:
2
(Enabled)
OPEN LVs:
9
QUORUM:
2 (Enabled)
TOTAL
22
VG
TOTAL PVs:
PVs:
VG DESCRIPTORS:
DESCRIPTORS: 33
STALE
00
STALE
00
STALE PVs:
PVs:
STALE PPs:
PPs:
ACTIVE
PVs:
2
AUTO
ON:
yes
ACTIVE PVs:
2
AUTO ON:
yes
MAX
PPs
per
VG:
32512
MAX PPs per VG:
32512
MAX
1016
MAX
32
MAX PPs
PPs per
per PV:
PV:
1016
MAX PVs:
PVs:
32
LTG
AUTO
no
LTG size
size (Dynamic):
(Dynamic): 256
256 kilobyte(s)
kilobyte(s)
AUTO SYNC:
SYNC:
no
HOT
no
BB
relocatable
HOT SPARE:
SPARE:
no
BB POLICY:
POLICY:
relocatable

Listing PVs in a VG and VG contents


IBM Power Systems

## lsvg
lsvg -p
-p rootvg
rootvg
rootvg:
rootvg:
PV_NAME
PV
PV_NAME
PV STATE
STATE
hdisk0
active
hdisk0
active
hdisk5
active
hdisk5
active

## lsvg
lsvg -l
-l rootvg
rootvg
rootvg:
rootvg:
LV
TYPE
LV NAME
NAME
TYPE
hd5
boot
hd5
boot
hd6
paging
hd6
paging
hd8
jfslog
hd8
jfslog
hd4
jfs
hd4
jfs
hd2
jfs
hd2
jfs
hd9var
jfs
hd9var
jfs
hd3
jfs
hd3
jfs
hd1
jfs
hd1
jfs
hd10opt
jfs
hd10opt
jfs

TOTAL
TOTAL PPs
PPs
99
99
31
31

LPs
LPs
11
88
11
15
15
35
35
55
33
11
44

PPs
PPs
11
88
11
15
15
35
35
55
33
22
44

FREE
FREE PPs
PPs
23
23
31
31

PVs
PVs
11
11
11
11
11
11
11
11
11

FREE
FREE DISTRIBUTION
DISTRIBUTION
15..00..00..00..08
15..00..00..00..08
07..06..06..06..06
07..06..06..06..06

LV
LV STATE
STATE
closed/syncd
closed/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd

MOUNT
MOUNT POINT
POINT
N/A
N/A
N/A
N/A
N/A
N/A
//
/usr
/usr
/var
/var
/tmp
/tmp
/home
/home
/opt
/opt

Change a volume group


IBM Power Systems

# smit chvg

chvg a n Q n datavg
Change
Change aa Volume
Volume Group
Group

** VOLUME
VOLUME GROUP
GROUP name
name
** Activate
Activate volume
volume group
group AUTOMATICALLY
AUTOMATICALLY
at
system
restart?
at system restart?
** AA QUORUM
QUORUM of
of disks
disks required
required to
to keep
keep the
the volume
volume
group
on-line
?
group on-line ?
Convert
Convert this
this VG
VG to
to Concurrent
Concurrent Capable?
Capable?
Change
to
big
VG
format?
Change to big VG format?
Change
Change to
to scalable
scalable VG
VG format?
format?
LTG
Size
in
kbytes
LTG Size in kbytes
Set
Set hotspare
hotspare characteristics
characteristics
Set
synchronization
Set synchronization characteristics
characteristics of
of stale
stale
partitions
partitions
Max
Max PPs
PPs per
per VG
VG in
in units
units of
of 1024
1024
Max
Logical
Volumes
Max Logical Volumes

[Entry
[Entry Fields]
Fields]
datavg
datavg
no
++
no
no
no

++

no
no
no
no
no
no
256
256
nn
nn

++
++
++
++
++
++

32
32
256
256

++
++

Extend and reduce a VG


IBM Power Systems

## extendvg
extendvg -f
-f rootvg
rootvg hdisk2
hdisk2
## lsvg
-p
rootvg
lsvg -p rootvg || awk
awk {print
{print $1,
$1, $2}
$2}
rootvg:
rootvg:
PV_NAME
PV
PV_NAME
PV STATE
STATE
hdisk0
active
hdisk0
active
hdisk1
active
hdisk1
active
hdisk2
active
hdisk2
active

hdisk0

## reducevg
reducevg -f
-f rootvg
rootvg hdisk1
hdisk1
## lsvg
-p
rootvg
lsvg -p rootvg || awk
awk {print
{print $1,
$1, $2}
$2}
rootvg:
rootvg:
PV_NAME
PV
PV_NAME
PV STATE
STATE
hdisk0
active
hdisk0
active
hdisk2
active
hdisk2
active

hdisk2

hdisk1

hdisk1

Remove a volume group


IBM Power Systems

# smit reducevg2

reducevg -df db2_vg hdisk2 hdisk3

Remove
Remove aa Volume
Volume Group
Group
Type
Type or
or select
select aa value
value for
for the
the entry
entry field.
field.
Press
Enter
AFTER
making
all
desired
Press Enter AFTER making all desired changes.
changes.
** VOLUME
VOLUME GROUP
GROUP name
name

[Entry
[Entry Fields]
Fields]
[db2_vg]
++
[db2_vg]

Note: There is no option to input disks. In this example db2_vg was contained
on hdisk3.

Activate and deactivate a volume group


IBM Power Systems

# smit varyonvg

varyonvg datavg

Activate
Activate aa Volume
Volume Group
Group
** VOLUME
VOLUME GROUP
GROUP name
name
RESYNCHRONIZE
RESYNCHRONIZE stale
stale physical
physical partitions?
partitions?
Activate
volume
group
Activate volume group in
in SYSTEM
SYSTEM
MANAGEMENT
MANAGEMENT mode?
mode?
FORCE
FORCE activation
activation of
of the
the volume
volume group?
group?
Warning--this
may
cause
Warning--this may cause loss
loss of
of data
data integrity.
integrity.
Varyon
VG
in
Concurrent
Mode?
Varyon VG in Concurrent Mode?
Synchronize
Synchronize Logical
Logical Volumes?
Volumes?

# smit varyoffvg

[Entry
[Entry Fields]
Fields]
[datavg]
++
[datavg]
yes
+
yes
+
no
++
no
no
no

++

no
no
no
no

++
++

varyoffvg datavg

Deactivate
Deactivate aa Volume
Volume Group
Group
** VOLUME
VOLUME GROUP
GROUP name
name
Put
volume
Put volume group
group in
in SYSTEM
SYSTEM
MANAGEMENT
mode?
MANAGEMENT mode?

[Entry
[Entry Fields]
Fields]
[datavg]
++
[datavg]
no
++
no

Import and export a volume group


IBM Power Systems

# smit importvg

importvg y datavg hdisk3

Import
Import aa Volume
Volume Group
Group
[Entry
[Entry Fields]
Fields]
[datavg]
[datavg]
[hdisk3]
++
[hdisk3]
[]
+#
[]
+#

VOLUME
VOLUME GROUP
GROUP name
name
** PHYSICAL
PHYSICAL VOLUME
VOLUME name
name
Volume
Volume Group
Group MAJOR
MAJOR NUMBER
NUMBER

# smit exportvg

exportvg datavg

Export
Export aa Volume
Volume Group
Group
** VOLUME
VOLUME GROUP
GROUP name
name

[Entry
[Entry Fields]
Fields]
[datavg]
++
[datavg]

Note: Volume group must be inactive before it is exported.

Reorganize a Volume Group


IBM Power Systems

# smit reorgvg
Reorganize
Reorganize aa Volume
Volume Group
Group
** VOLUME
VOLUME GROUP
GROUP name
name

[Entry
[Entry Fields]
Fields]
[rootvg]
++
[rootvg]

## reorgvg
reorgvg rootvg
rootvg
0516-962
0516-962 reorgvg:
reorgvg: Logical
Logical volume
volume hd5
hd5 migrated.
migrated.
0516-962
reorgvg:
Logical
volume
hd6
0516-962 reorgvg: Logical volume hd6 migrated.
migrated.
0516-962
0516-962 reorgvg:
reorgvg: Logical
Logical volume
volume hd8
hd8 migrated.
migrated.
0516-962
0516-962 reorgvg:
reorgvg: Logical
Logical volume
volume hd4
hd4 migrated.
migrated.
0516-962
0516-962 reorgvg:
reorgvg: Logical
Logical volume
volume hd2
hd2 migrated.
migrated.
0516-962
0516-962 reorgvg:
reorgvg: Logical
Logical volume
volume hd9var
hd9var migrated.
migrated.
0516-962
0516-962 reorgvg:
reorgvg: Logical
Logical volume
volume hd3
hd3 migrated.
migrated.
0516-962
0516-962 reorgvg:
reorgvg: Logical
Logical volume
volume hd1
hd1 migrated.
migrated.
0516-962
reorgvg:
Logical
volume
hd10opt
0516-962 reorgvg: Logical volume hd10opt migrated.
migrated.
0516-962
0516-962 reorgvg:
reorgvg: Logical
Logical volume
volume loglv00
loglv00 migrated.
migrated.
0516-962
0516-962 reorgvg:
reorgvg: Logical
Logical volume
volume hd11admin
hd11admin migrated.
migrated.
0516-962
0516-962 reorgvg:
reorgvg: Logical
Logical volume
volume fslv00
fslv00 migrated.
migrated.

Logical storage
IBM Power Systems

Physical volumes
1
7
13
19
25
31
35
41
47

2
8
14
20
26
32
36
42
48

3
9
15
21
27
33
37
43
49

4
10
16
22
28
34
38
44
50

1
7
13
19
25
31
35
41
47

2
8
14
20
26
32
36
42
48

3
9
15
21
27
33
37
43
49

Logical Volume Manager


1 2 3 4 1 2 3 4
Logical
volume

Logical
volume

Logical
partitions

4
10
16
22
28
34
38
44
50

LVM and RAID support


IBM Power Systems

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

Striping aides performance, whereas mirroring aides availability.


In todays environment, most data resides in SANs. Disks in a SAN are
generally grouped together into a RAID array and divided into LUNs.
AIX sees LUNs as physical disks.
One should not further deploy AIX RAID configurations 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


IBM Power Systems

Inter- and intra-policy


Logical volume placement on disk

Scheduling policy
Dictates how data is read/written for mirrored LVs

Mirror write consistency


Ensures mirrored PPs are consistent

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.

Mirroring (RAID1)
IBM Power Systems

Mirroring is when a logical partition maps to more than one


physical partition of the same volume group.

First copy

hdisk0
PP1
PP2

fslv00
LP1
LP2

Second copy

hdisk1
PP1
PP2

Third copy

hdisk2
PP1
PP2

Mirroring, allocation
IBM Power Systems

When mirroring, it is essential that all PP copies are stored on


different disks.
This setting is controlled by the Allocation policy.
Also referred to as strictness

Allocation can be set to:


No: Not recommended.
Yes (default): Will ensure no LP copies can share the same PV
Superstrict: Will ensure no LP copies can shares the same PV in an
LVM RAID 0 + 1 (10) configuration

Striping (RAID 0)
IBM Power Systems

1 4

LP1

hdisk0

Stripe
Units
2

LP2

hdisk1
3 6

hdisk2

LP3

1
2
3
4
5
6
7
8
9

Stream of
data

Consecutive stripe units


are created on different
physical volumes.
Striping increases
read/write sequential
throughput by evenly
distributing stripe units
among disks.
Stripe unit size is
specified at the creation
time.
4KB to 128MB

Striping and mirroring (RAID 10 or 1+0)


IBM Power Systems

1 3

1 3

hdisk0

hdisk2
2

hdisk3

hdisk1

1
2
3
4
5
6
Stream of
data

Meets performance and high availability requirements


More expensive (requires more disks, minimum 4)
Mirroring allocation is automatically set to superstrict

Logical volume placement


IBM Power Systems

Intra-physical volume allocation policy


Middle

Inner-edge

Center

Inner-middle

Edge

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.

Mirroring scheduling policy


IBM Power Systems

Scheduling policies when mirroring:


Parallel (default)
Write operations on different physical partitions start at the same time.
When the longest write finishes, the write operation is complete.
Improves performance (especially RAID-Performance)
Parallel write/sequential read
> Primary copy is read first, I f unsuccessful, the next copy is used.

Parallel write/round robin read


> Round-robin reads alternate disks between copies.

Sequential
Second physical write operation is not started unless the first operation
has completed successfully.
In case of a total disk failure, there is always a good copy.
Increased availability, but decreases performance

Mirror write consistency


IBM Power Systems

Problem: If the system crashes before the write to all mirrors


is complete, the mirrors are in an inconsistent state, and the
system must distinguish between the old copy and the new
copy.
Solution: Mirror Write Consistency
Ensures PPs are consistent after reboot
Three modes: off, active, and passive
Active (default)
Uses a cache on disk
The physical write operation proceeds when the cache has been
updated.

Passive. (Big VGs only)


Logging of LV updates, but does not log writes
If the system crashes on reboot, a forced synchronization of the LVs
takes place.

SMIT logical volume menu


IBM Power Systems

# smit lv
Logical
Logical Volumes
Volumes
Move
Move cursor
cursor to
to desired
desired item
item and
and press
press Enter.
Enter.
List
List All
All Logical
Logical Volumes
Volumes by
by Volume
Volume Group
Group
Add
a
Logical
Volume
Add a Logical Volume
Set
Set Characteristic
Characteristic of
of aa Logical
Logical Volume
Volume
Show
Characteristics
of
a
Show Characteristics of a Logical
Logical Volume
Volume
Remove
Remove aa Logical
Logical Volume
Volume
Copy
Copy aa Logical
Logical Volume
Volume

Adding a logical volume


IBM Power Systems

# smit mklv

mklv y datalv t jfs2 c 2


datavg 10 hdisk2 hdisk3

Add
Add aa Logical
Logical Volume
Volume
Logical
Logical volume
volume NAME
NAME
** VOLUME
VOLUME GROUP
GROUP name
name
** Number
Number of
of LOGICAL
LOGICAL PARTITIONS
PARTITIONS
PHYSICAL
PHYSICAL VOLUME
VOLUME names
names
Logical
volume
TYPE
Logical volume TYPE
POSITION
POSITION on
on physical
physical volume
volume
RANGE
RANGE of
of physical
physical volumes
volumes
MAXIMUM
MAXIMUM NUMBER
NUMBER of
of PHYSICAL
PHYSICAL VOLUMES
VOLUMES
to
to use
use for
for allocation
allocation
Number
of
COPIES
of
each
logical
Number of COPIES of each logical
partition
partition
Mirror
Mirror Write
Write Consistency?
Consistency?
Allocate
Allocate each
each logical
logical partition
partition copy
copy
on
on aa SEPARATE
SEPARATE physical
physical volume?
volume?
RELOCATE
the
logical
volume
during
RELOCATE the logical volume during
reorganization?
reorganization?
Logical
Logical volume
volume LABEL
LABEL
MAXIMUM
NUMBER
MAXIMUM NUMBER of
of LOGICAL
LOGICAL PARTITIONS
PARTITIONS
Enable
Enable BAD
BAD BLOCK
BLOCK relocation?
relocation?
SCHEDULING
POLICY
for
writing/reading
SCHEDULING POLICY for writing/reading
logical
logical partition
partition copies
copies
Enable
Enable WRITE
WRITE VERIFY?
VERIFY?
File
File containing
containing ALLOCATION
ALLOCATION MAP
MAP
Stripe
Stripe Size?
Size?
Serialize
IO?
Serialize IO?

[Entry Fields]
[Entry Fields]
[datalv]
[datalv]
datavg
datavg
[100]
[100]
[hdisk2
[hdisk2 hdisk3]
hdisk3]
[jfs2]
[jfs2]
middle
middle
minimum
minimum
[]
[]

##
++
++
++
++
##

22

++

active
active
yes
yes

++
++

yes
yes

++

[]
[]
[512]
[512]
yes
yes
parallel
parallel
no
no
[]
[]
[Not
[Not Striped]
Striped]
no
no

##
++
++
++
++
++

Show LV characteristics (1 of 2)
IBM Power Systems

## lslv
lslv datalv
datalv
LOGICAL
datalv
VOLUME
LOGICAL VOLUME:
VOLUME:
datalv
VOLUME GROUP:
GROUP:
LV
IDENTIFIER:
00cf2e7f00004c000000011d68130bea.1
LV IDENTIFIER:
00cf2e7f00004c000000011d68130bea.1
PERMISSION:
read/write
PERMISSION:
read/write
VG
STATE:
active/complete
LV
VG STATE:
active/complete
LV STATE:
STATE:
TYPE:
jfs2
WRITE
TYPE:
jfs2
WRITE VERIFY:
VERIFY:
MAX
512
PP
MAX LPs:
LPs:
512
PP SIZE:
SIZE:
COPIES:
22
SCHED
COPIES:
SCHED POLICY:
POLICY:
LPs:
10
PPs:
LPs:
10
PPs:
STALE
00
BB
STALE PPs:
PPs:
BB POLICY:
POLICY:
INTER-POLICY:
minimum
RELOCATABLE:
INTER-POLICY:
minimum
RELOCATABLE:
INTRA-POLICY:
middle
UPPER
INTRA-POLICY:
middle
UPPER BOUND:
BOUND:
MOUNT
POINT:
N/A
LABEL:
MOUNT POINT:
N/A
LABEL:
MIRROR
MIRROR WRITE
WRITE CONSISTENCY:
CONSISTENCY: on/ACTIVE
on/ACTIVE
EACH
LP
COPY
ON
EACH LP COPY ON AA SEPARATE
SEPARATE PV
PV ?:
?: yes
yes (superstrict)
(superstrict)

## lslv
lslv -l
-l datalv
datalv
datalv:N/A
datalv:N/A
PV
COPIES
PV
COPIES
hdisk2
010:000:000
hdisk2
010:000:000
hdisk3
010:000:000
hdisk3
010:000:000

IN
IN BAND
BAND
100%
100%
100%
100%

datavg
datavg
closed/syncd
closed/syncd
off
off
44 megabyte(s)
megabyte(s)
parallel
parallel
20
20
relocatable
relocatable
yes
yes
11
None
None

DISTRIBUTION
DISTRIBUTION
000:010:000:000:000
000:010:000:000:000
000:010:000:000:000
000:010:000:000:000

Show LV characteristics (2 of 2)
IBM Power Systems

Show LP to PP relationship on disks


## lslv
lslv -m
-m datalv
datalv
datalv:N/A
datalv:N/A
LP
PP1
LP
PP1 PV1
PV1
0001
0104
0001 0104 hdisk2
hdisk2
0002
0002 0105
0105 hdisk2
hdisk2
0003
0003 0106
0106 hdisk2
hdisk2
0004
0004 0107
0107 hdisk2
hdisk2
0005
0005 0108
0108 hdisk2
hdisk2
0006
0006 0109
0109 hdisk2
hdisk2
0007
0007 0110
0110 hdisk2
hdisk2
0008
0008 0111
0111 hdisk2
hdisk2
0009
0009 0112
0112 hdisk2
hdisk2
0010
0010 0113
0113 hdisk2
hdisk2

PP2
PP2 PV2
PV2
0104
0104 hdisk3
hdisk3
0105
0105 hdisk3
hdisk3
0106
0106 hdisk3
hdisk3
0107
0107 hdisk3
hdisk3
0108
0108 hdisk3
hdisk3
0109
0109 hdisk3
hdisk3
0110
0110 hdisk3
hdisk3
0111
0111 hdisk3
hdisk3
0112
0112 hdisk3
hdisk3
0113
0113 hdisk3
hdisk3

PP3
PP3 PV3
PV3

Add copies to a logical volume


IBM Power Systems

# smit mklvcopy

mklvcopy -k datalv 3 hdisk4

Add
Add Copies
Copies to
to aa Logical
Logical Volume
Volume
Type
Type or
or select
select values
values in
in entry
entry fields.
fields.
Press
Press Enter
Enter AFTER
AFTER making
making all
all desired
desired changes.
changes.
** LOGICAL
LOGICAL VOLUME
VOLUME name
name
** NEW
TOTAL
NEW TOTAL number
number of
of logical
logical partition
partition
copies
copies
PHYSICAL
PHYSICAL VOLUME
VOLUME names
names
POSITION
POSITION on
on physical
physical volume
volume
RANGE
RANGE of
of physical
physical volumes
volumes
MAXIMUM
MAXIMUM NUMBER
NUMBER of
of PHYSICAL
PHYSICAL VOLUMES
VOLUMES
to
to use
use for
for allocation
allocation
Allocate
Allocate each
each logical
logical partition
partition copy
copy
on
a
SEPARATE
physical
on a SEPARATE physical volume?
volume?
File
File containing
containing ALLOCATION
ALLOCATION MAP
MAP
SYNCHRONIZE
the
data
SYNCHRONIZE the data in
in the
the new
new
logical
logical partition
partition copies?
copies?

[Entry
[Entry Fields]
Fields]
datalv
datalv
33
[hdisk4]
[hdisk4]
middle
middle
minimum
minimum
[1]
[1]

++
++
++
++
##

yes
yes

++

[]
[]
yes
yes

++

Increasing the size of a logical volume


IBM Power Systems

# smit extendlv

extendlv datalv 20

Increase
Increase the
the Size
Size of
of aa Logical
Logical Volume
Volume
Type
Type or
or select
select values
values in
in entry
entry fields.
fields.
Press
Press Enter
Enter AFTER
AFTER making
making all
all desired
desired changes.
changes.
** LOGICAL
LOGICAL VOLUME
VOLUME name
name
** Number
of
Number of ADDITIONAL
ADDITIONAL logical
logical partitions
partitions
PHYSICAL
VOLUME
names
PHYSICAL VOLUME names
POSITION
POSITION on
on physical
physical volume
volume
RANGE
RANGE of
of physical
physical volumes
volumes
MAXIMUM
MAXIMUM NUMBER
NUMBER of
of PHYSICAL
PHYSICAL VOLUMES
VOLUMES
to
use
for
allocation
to use for allocation
Allocate
Allocate each
each logical
logical partition
partition copy
copy
on
a
SEPARATE
physical
on a SEPARATE physical volume?
volume?
File
File containing
containing ALLOCATION
ALLOCATION MAP
MAP

[Entry
[Entry Fields]
Fields]
datalv
datalv
[20]
[20]
[]
[]
middle
middle
minimum
minimum
[1]
[1]
yes
yes
[]
[]

##
++
++
++
##
++

Remove a logical volume


IBM Power Systems

# smit rmlv

rmlv f datalv2
Remove
Remove aa Logical
Logical Volume
Volume

Type
Type or
or select
select values
values in
in entry
entry fields.
fields.
Press
Enter
AFTER
making
all
Press Enter AFTER making all desired
desired changes.
changes.
LOGICAL
LOGICAL VOLUME
VOLUME name
name

[Entry
[Entry Fields]
Fields]
[datalv2]
[datalv2]

++

List all logical volumes by volume group


IBM Power Systems

## lsvg
lsvg -o
-o || lsvg
lsvg -i
-i l
l
datavg:
datavg:
LV
LV NAME
NAME
datalv
datalv
rootvg:
rootvg:
LV
LV NAME
NAME
hd5
hd5
hd6
hd6
hd8
hd8
hd4
hd4
hd2
hd2
hd9var
hd9var
hd3
hd3
hd1
hd1
hd10opt
hd10opt
loglv00
loglv00
hd11admin
hd11admin
fslv00
fslv00

TYPE
TYPE
jfs2
jfs2

LPs
LPs
30
30

PPs
PPs
90
90

PVs
MOUNT
PVs LV
LV STATE
STATE
MOUNT POINT
POINT
33
closed/syncd
N/A
closed/syncd N/A

TYPE
TYPE
boot
boot
paging
paging
jfslog
jfslog
jfs
jfs
jfs
jfs
jfs
jfs
jfs
jfs
jfs
jfs
jfs
jfs
jfs2log
jfs2log
jfs
jfs
jfs2
jfs2

LPs
LPs
11
88
11
15
15
35
35
55
33
11
44
11
22
22

PPs
PPs
11
88
11
15
15
35
35
55
33
11
44
11
22
22

PVs
PVs
11
11
11
11
11
11
11
11
11
11
11
11

LV
LV STATE
STATE
closed/syncd
closed/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
open/syncd
closed/syncd
closed/syncd
open/syncd
open/syncd
closed/syncd
closed/syncd

MOUNT
MOUNT POINT
POINT
N/A
N/A
N/A
N/A
N/A
N/A
//
/usr
/usr
/var
/var
/tmp
/tmp
/home
/home
/opt
/opt
N/A
N/A
/admin
/admin
/db2
/db2

Mirroring volume groups


IBM Power Systems

Mirroring rootvg is very important.

# smit mirrorvg

mirrorvg rootvg hdisk1


Canbeused
tomirror
anyVG

Mirror
Mirror aa Volume
Volume Group
Group
Type
Type or
or select
select values
values in
in entry
entry fields.
fields.
Press
Enter
AFTER
making
all
Press Enter AFTER making all desired
desired changes.
changes.
** VOLUME
VOLUME GROUP
GROUP name
name
Mirror
sync
Mirror sync mode
mode
PHYSICAL
PHYSICAL VOLUME
VOLUME names
names
Number
of
Number of COPIES
COPIES of
of each
each logical
logical
partition
partition
Keep
Keep Quorum
Quorum Checking
Checking On?
On?
Create
Exact
Create Exact LV
LV Mapping?
Mapping?

[Entry
[Entry Fields]
Fields]
rootvg
rootvg
[Foreground]
++
[Foreground]
[hdisk1]
++
[hdisk1]
22
++
no
no
no
no

++
++

## bosboot
bosboot -a
-a -d
-d /dev/hdisk1
/dev/hdisk1
## bootlist
bootlist -m
-m normal
normal hdisk0
hdisk0 hdisk1
hdisk1
## shutdown
shutdown Fr
Fr (not
(not required
required with
with AIX6
AIX6 and
and later)
later)

Additional
steps
requiredfor
rootvg

Physical volumes
IBM Power Systems

1
7
13
19
25
31
35
41
47

2
8

3
9

14

15

20

21

26
32

27

36

37
43

42
48

33

49

PV2

Volume group

PV1

10

13

16

19

22

25

28

31

34

35

38
44

41
47

50

2
8

3
9

14

15

20

21

26
32

27

36
42

37
43

48

49

33

Physical partitions

Physical volume (PV)

Hard disk, a virtual disk or a LUN

Physical partition (PP)

Smallest assignable unit of allocation on a physical disk

4
10
16
22
28
34
38
44
50

SMIT physical volumes menu


IBM Power Systems

# smit pv
Physical
Physical Volumes
Volumes
Move
Move cursor
cursor to
to desired
desired item
item and
and press
press Enter.
Enter.
List
List All
All Physical
Physical Volumes
Volumes in
in System
System
Add
a
Disk
Add a Disk
Change
Change Characteristics
Characteristics of
of aa Physical
Physical Volume
Volume
List
Contents
of
a
Physical
Volume
List Contents of a Physical Volume
Move
Move Contents
Contents of
of aa Physical
Physical Volume
Volume

List physical volume information


IBM Power Systems

List all physical volumes in the system.


## lspv
lspv
hdisk0
hdisk0
hdisk1
hdisk1
hdisk2
hdisk2
hdisk3
hdisk3
hdisk4
hdisk4

00cf2e7ff02c5fc4
00cf2e7ff02c5fc4
00cf2e7f713ca357
00cf2e7f713ca357
00cf2e7fea693331
00cf2e7fea693331
00cf2e7fea6a26e0
00cf2e7fea6a26e0
00cf2e7fea6a318
00cf2e7fea6a318

rootvg
rootvg
None
None
datavg
datavg
datavg
datavg
datavg
datavg

active
active
active
active
active
active
active
active

List the attributes of a PV.


## lspv
lspv hdisk3
hdisk3
PHYSICAL
PHYSICAL VOLUME:
VOLUME:
PV
PV IDENTIFIER:
IDENTIFIER:
VG
VG IDENTIFIER
IDENTIFIER
PV
PV STATE:
STATE:
STALE
STALE PARTITIONS:
PARTITIONS:
PP
PP SIZE:
SIZE:
TOTAL
TOTAL PPs:
PPs:
FREE
FREE PPs:
PPs:
USED
USED PPs:
PPs:
FREE
FREE DISTRIBUTION:
DISTRIBUTION:
USED
USED DISTRIBUTION:
DISTRIBUTION:

hdisk3
VOLUME
hdisk3
VOLUME GROUP:
GROUP:
00cf2e7fea6a26e0
00cf2e7fea6a26e0
00cf2e7f00004c000000011d68130bea
00cf2e7f00004c000000011d68130bea
active
active
00
ALLOCATABLE:
ALLOCATABLE:
44 megabyte(s)
LOGICAL
megabyte(s)
LOGICAL VOLUMES:
VOLUMES:
511
(2044
megabytes)
VG
511 (2044 megabytes)
VG DESCRIPTORS:
DESCRIPTORS:
481
HOT
481 (1924
(1924 megabytes)
megabytes)
HOT SPARE:
SPARE:
30
(120
megabytes)
MAX
30 (120 megabytes)
MAX REQUEST:
REQUEST:
103..72..102..102..102
103..72..102..102..102
00..30..00..00..00
00..30..00..00..00

datavg
datavg

yes
yes
11
11
no
no
256K
256K

List logical volumes on a physical volume


IBM Power Systems

## lspv
lspv -l
-l hdisk0
hdisk0
hdisk0:
hdisk0:
LV
LV NAME
NAME
hd2
hd2
hd9var
hd9var
hd8
hd8
hd4
hd4
hd5
hd5
hd6
hd6
hd10opt
hd10opt
hd3
hd3
hd1
hd1
hd11admin
hd11admin
fslv00
fslv00
loglv00
loglv00

LPs
LPs
35
35
55
11
15
15
11
88
44
33
11
22
22
11

PPs
PPs
35
35
55
11
15
15
11
88
44
33
11
22
22
11

DISTRIBUTION
MOUNT
DISTRIBUTION
MOUNT POINT
POINT
00..00..03..20..12
/usr
00..00..03..20..12
/usr
00..05..00..00..00
/var
00..05..00..00..00
/var
00..00..01..00..00
N/A
00..00..01..00..00
N/A
00..00..15..00..00
//
00..00..15..00..00
01..00..00..00..00
N/A
01..00..00..00..00
N/A
00..08..00..00..00
N/A
00..08..00..00..00
N/A
04..00..00..00..00
/opt
04..00..00..00..00
/opt
00..03..00..00..00
/tmp
00..03..00..00..00
/tmp
00..01..00..00..00
/home
00..01..00..00..00
/home
00..02..00..00..00
/admin
00..02..00..00..00
/admin
02..00..00..00..00
/db2
02..00..00..00..00
/db2
00..01..00..00..00
N/A
00..01..00..00..00
N/A

List a physical volume partition map


IBM Power Systems

## lspv
lspv -p
-p hdisk0
hdisk0
hdisk0:
hdisk0:
PP
PP RANGE
RANGE STATE
STATE
1-1
used
1-1
used
2-14
free
2-14
free
15-16
used
15-16
used
17-20
used
17-20
used
21-28
used
21-28
used
29-29
used
29-29
used
30-31
used
30-31
used
32-32
used
32-32
used
33-35
used
33-35
used
36-40
used
36-40
used
41-41
used
41-41
used
42-56
used
42-56
used
57-59
used
57-59
used
60-79
used
60-79
used
80-91
used
80-91
used
92-99
free
92-99
free

REGION
REGION
outer
outer edge
edge
outer
outer edge
edge
outer
outer edge
edge
outer
outer edge
edge
outer
outer middle
middle
outer
outer middle
middle
outer
outer middle
middle
outer
outer middle
middle
outer
outer middle
middle
outer
outer middle
middle
center
center
center
center
center
center
inner
inner middle
middle
inner
inner edge
edge
inner
inner edge
edge

LV
LV NAME
NAME
hd5
hd5

TYPE
TYPE
boot
boot

MOUNT
MOUNT POINT
POINT
N/A
N/A

fslv00
fslv00
hd10opt
hd10opt
hd6
hd6
loglv00
loglv00
hd11admin
hd11admin
hd1
hd1
hd3
hd3
hd9var
hd9var
hd8
hd8
hd4
hd4
hd2
hd2
hd2
hd2
hd2
hd2

jfs2
jfs2
jfs2
jfs2
paging
paging
jfs2log
jfs2log
jfs2
jfs2
jfs2
jfs2
jfs2
jfs2
jfs2
jfs2
jfslog
jfslog
jfs2
jfs2
jfs2
jfs2
jfs2
jfs2
jfs2
jfs2

/db2
/db2
/opt
/opt
N/A
N/A
N/A
N/A
/admin
/admin
/home
/home
/tmp
/tmp
/var
/var
N/A
N/A
//
/usr
/usr
/usr
/usr
/usr
/usr

Add or move contents of physical volumes


IBM Power Systems

Today, virtually all disks are configured to AIX through


configuration manager (cfgmgr).
Move the contents of a physical volume:
migratepv [ -l lvname ] sourcePV targetPV ..

## migratepv
migratepv -l
-l lv02
lv02 hdisk0
hdisk0 hdisk6
hdisk6

Documenting the disk storage setup


IBM Power Systems

List the volume groups:


# lsvg

List the disks on the system (PVID and volume group):


# lspv

List which logical volumes are contained in each volume


group:
# lsvg -l vgname

List the logical volumes on each disk:


# lspv -l pvname

Checkpoint
IBM Power Systems

1. True or False: A logical volume can span more than one


physical volume.
2. True or False: A logical volume can span more than one
volume group.
3. True or False: The contents of a physical volume can be
divided between two volume groups.
4. True or False: If mirroring logical volumes, it is not
necessary to perform a backup.
5. True or False: SMIT can be used to easily increase or decrease
the size of an enhanced JFS filesystem.

6. True or False: Striping can be combined with mirroring to


provide increased performance and availability.

Checkpoint solutions
IBM Power Systems

1. True or False: A logical volume can span more than one


physical volume.
2. True or False: A logical volume can span more than one
volume group.
3. True or False: The contents of a physical volume can be
divided between two volume groups.
4. True or False: If mirroring logical volumes, it is not
necessary to perform a backup. False. You still need to
back up to external media.
5. True or False: SMIT can be used to easily increase or
decrease the size of an enhanced JFS filesystem.
6. True or False: Striping can be combined with mirroring to
provide increased performance and availability

Exercise 8
IBM Power Systems

Working with LVM

Unit summary
IBM Power Systems

Having completed this unit, you should be able to:


Explain how to work with the Logical Volume Manager
Add, change, and delete:
Volume groups
Logical volumes
Physical volumes

Describe essential LVM concepts, such as:


Mirroring
Striping

Você também pode gostar