Red_Hat_Enterprise_Linux-6-Logical_Volume_Manager_Administration-en-US.pdf

(1466 KB) Pobierz
Red Hat Enterprise Linux 6
Logical Volume Manager
Administration
LVM Administrator Guide
Edition 1
Red Hat Enterprise Linux 6 Logical Volume Manager Administration
LVM Administrator Guide
Edition 1
Legal Notice
Copyright © 2013 Red Hat, Inc. and others.
T his document is licensed by Red Hat under the
Creative Commons Attribution-ShareAlike 3.0 Unported
License.
If you distribute this document, or a modified version of it, you must provide attribution to Red
Hat, Inc. and provide a link to the original. If the document is modified, all Red Hat trademarks must be
removed.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section
4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, MetaMatrix, Fedora, the Infinity Logo,
and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux ® is the registered trademark of Linus T orvalds in the United States and other countries.
Java ® is a registered trademark of Oracle and/or its affiliates.
XFS ® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States
and/or other countries.
MySQL ® is a registered trademark of MySQL AB in the United States, the European Union and other
countries.
Node.js ® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or
endorsed by the official Joyent Node.js open source or commercial project.
T he OpenStack ® Word Mark and OpenStack Logo are either registered trademarks/service marks or
trademarks/service marks of the OpenStack Foundation, in the United States and other countries and
are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or
sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Abstract
T his book describes the LVM logical volume manager, including information on running LVM in a
clustered environment.
Table of Contents
Table of Contents
Introduction
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6
. . . . . . . . . .
1. About T his Guide
6
2. Audience
6
3. Software Versions
6
4. Related Documentation
6
5. We Need Feedback!
7
6. Document Conventions
7
6.1. T ypographic Conventions
7
6.2. Pull-quote Conventions
8
6.3. Notes and Warnings
9
Chapter 1.
. . .
LVM
. . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . .
T he
. . . . . .
Logical
.
Volume
.
Manager
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10
1.1. New and Changed Features
10
1.1.1. New and Changed Features for Red Hat Enterprise Linux 6.0
10
1.1.2. New and Changed Features for Red Hat Enterprise Linux 6.1
10
1.1.3. New and Changed Features for Red Hat Enterprise Linux 6.2
11
1.1.4. New and Changed Features for Red Hat Enterprise Linux 6.3
11
1.1.5. New and Changed Features for Red Hat Enterprise Linux 6.4
11
1.1.6. New and Changed Features for Red Hat Enterprise Linux 6.5
12
1.2. Logical Volumes
12
1.3. LVM Architecture Overview
13
1.4. T he Clustered Logical Volume Manager (CLVM)
14
1.5. Document Overview
16
Chapter 2.
. . . . . . . . . . . . . . . .
. . . . . . . . . . . .
LVM
.
Components
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17
2.1. Physical Volumes
17
2.1.1. LVM Physical Volume Layout
17
2.1.2. Multiple Partitions on a Disk
18
2.2. Volume Groups
18
2.3. LVM Logical Volumes
18
2.3.1. Linear Volumes
18
2.3.2. Striped Logical Volumes
20
2.3.3. Mirrored Logical Volumes
21
2.3.4. RAID Logical Volumes
22
2.3.5. T hinly-Provisioned Logical Volumes (T hin Volumes)
22
2.3.6. Snapshot Volumes
23
2.3.7. T hinly-Provisioned Snapshot Volumes
24
Chapter 3.
. . . .
Administration
. . . . . . . . .
. . . . . . . . . . . .
LVM
. . . . . . . . . . . . . . . .
Overview
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
25
3.1. Creating LVM Volumes in a Cluster
25
3.2. Logical Volume Creation Overview
25
3.3. Growing a File System on a Logical Volume
26
3.4. Logical Volume Backup
26
3.5. Logging
26
3.6. T he Metadata Daemon (lvmetad)
27
Chapter 4
. . . . . . . . . . . . . . . . . .
with
. . . . . . . . . . . . . .
. . . . . . . . . . .
.
.
LVM
.
Administration
. . . . . .
CLI
.
Commands
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
28
4.1. Using CLI Commands
28
4.2. Physical Volume Administration
29
4.2.1. Creating Physical Volumes
29
4.2.1.1. Setting the Partition T ype
29
4.2.1.2. Initializing Physical Volumes
29
4.2.1.3. Scanning for Block Devices
30
1
Red Hat Enterprise Linux 6 Logical Volume Manager Administration
4.2.2. Displaying Physical Volumes
4.2.3. Preventing Allocation on a Physical Volume
4.2.4. Resizing a Physical Volume
4.2.5. Removing Physical Volumes
4.3. Volume Group Administration
4.3.1. Creating Volume Groups
4.3.2. LVM Allocation
4.3.3. Creating Volume Groups in a Cluster
4.3.4. Adding Physical Volumes to a Volume Group
4.3.5. Displaying Volume Groups
4.3.6. Scanning Disks for Volume Groups to Build the Cache File
4.3.7. Removing Physical Volumes from a Volume Group
4.3.8. Changing the Parameters of a Volume Group
4.3.9. Activating and Deactivating Volume Groups
4.3.10. Removing Volume Groups
4.3.11. Splitting a Volume Group
4.3.12. Combining Volume Groups
4.3.13. Backing Up Volume Group Metadata
4.3.14. Renaming a Volume Group
4.3.15. Moving a Volume Group to Another System
4.3.16. Recreating a Volume Group Directory
4.4. Logical Volume Administration
4.4.1. Creating Linear Logical Volumes
4.4.2. Creating Striped Volumes
4.4.3. Creating Mirrored Volumes
4.4.3.1. Mirrored Logical Volume Failure Policy
4.4.3.2. Splitting Off a Redundant Image of a Mirrored Logical Volume
4.4.3.3. Repairing a Mirrored Logical Device
4.4.3.4. Changing Mirrored Volume Configuration
4.4.4. Creating T hinly-Provisioned Logical Volumes
4.4.5. Creating Snapshot Volumes
4.4.6. Creating T hinly-Provisioned Snapshot Volumes
4.4.7. Merging Snapshot Volumes
4.4.8. Persistent Device Numbers
4.4.9. Resizing Logical Volumes
4.4.10. Changing the Parameters of a Logical Volume Group
4.4.11. Renaming Logical Volumes
4.4.12. Removing Logical Volumes
4.4.13. Displaying Logical Volumes
4.4.14. Growing Logical Volumes
4.4.14.1. Extending a Striped Volume
4.4.14.2. Extending a Mirrored Volume
4.4.14.3. Extending a Logical Volume with the cling Allocation Policy
4.4.15. RAID Logical Volumes
4.4.15.1. Creating a RAID Logical Volume
4.4.15.2. Converting a Linear Device to a RAID Device
4.4.15.3. Converting an LVM RAID1 Logical Volume to an LVM Linear Logical Volume
4.4.15.4. Converting a Mirrored LVM Device to a RAID1 Device
4.4.15.5. Changing the Number of Images in an Existing RAID1 Device
4.4.15.6. Splitting off a RAID Image as a Separate Logical Volume
4.4.15.7. Splitting and Merging a RAID Image
4.4.15.8. Setting a RAID fault policy
4.4.15.8.1. T he allocate RAID Fault Policy
4.4.15.8.2. T he warn RAID Fault Policy
4.4.15.9. Replacing a RAID device
30
31
31
31
31
32
32
33
34
34
35
35
36
36
37
37
37
37
37
37
38
38
38
40
40
43
43
44
44
45
47
49
49
50
50
50
51
51
51
51
52
53
54
55
56
58
59
60
60
62
63
65
65
66
67
2
Zgłoś jeśli naruszono regulamin