The contents of this chapter take HP-UX as an example, and other operating systems may be different.
Target
To complete this chapter, you can do the following things:
Describes the reasons for disk partitioning
partition disks using the whole disk
Describe the features and benefits of LVM
Define terms: Volume groups, logical volumes, and physical volumes, and explain the relationships between them.
Create physical volumes, volume groups, and logical volumes on the command line
Disk Partitions
Each disk may have one or more partitions
Each partition can be used to:
-A file system
-Swap Space
-Raw data
-Boot Area
The system organizes disk space by partitioning, which is a portion of the disk space that is allocated to achieve a specific purpose. A partition can span one disk or multiple disks, or it can be part of a disk. Each partition can contain:
A file system (space allocated for files and directories)
A swap area (the space the kernel uses to replenish physical memory)
Raw devices (data directly accessed by the application, such as a database)
Boot area (contains tools used during the boot process)
HP-UX provides two ways to create and manage disk partitions:
Whole plate Mode
Logical Volume management (LVM)
Some disks in the system can be configured using the whole disk, while others can be configured using LVM. Two technologies can be used in the same system, but not on the same disk at the same time.
Both of these methods have their advantages and disadvantages. The whole disk is easy to configure, and LVM provides more flexibility.
Whole Disk Mode partition
With the whole disk, one disk can be configured in five different ways.
Disk is all a single file http://www.aliyun.com/zixun/aggregation/10478.html "> system use
Disk as a swap area
All disks as a bare partition
Part of the disk as a file system, and the rest as a swap area
The disk is configured as a boot disk that contains the root file system, a swap area, and a special boot area of 2M (which includes the tools used during system boot).
Although the whole disk method partition is easy to use, it has the following limitations:
A file system cannot span multiple disks
A disk partition can only be used by one file system
If more disk space is needed, it can be difficult to extend a filesystem.
For these reasons, many administrators choose to use the logical Volume Manager instead of the entire disk to manage the space.
LVM Disk Partitions
Logical Volume Management (LVM) enables you to combine several disks (called "Physical volumes" in LVM) to form a "volume group." You can continue to subdivide the space in this volume group into "logical volumes" (equivalent to one partition in LVM). Logical Volume management (LVM) overcomes the limitations of the whole disk approach, making it possible to:
Create logical volumes spanning multiple disks
Create multiple logical volumes on one disk
Expand and reduce the size of logical volumes when needed