This section will introduce the components of the Logical Volume Manager (LVM) and how they relate to the Application and Physical Layers. The set of operating system commands, library subroutines and other tools that allow the user to establish and control logical volume storage is called the Logical Volume Manager[18]. The Logical Volume Manager controls disk resources by mapping data between a simple and flexible logical view of storage space and the actual physical disks. The Logical Volume Manager does this by using a layer of device driver code that runs above the traditional physical device
drivers. This logical view of the disk storage is provided to applications and is independent of the underlying physical disk structure. Figure 2.1 illustrates the layout of those components.
Overview:
A hierarchy of structures is used to manage fixed disk storage, and there is a clearly defined relationship (mapping) between them. Figure 2.2, which shows the relationship between Volume Groups (datavg), Logical Volumes (lv04 and mirrlv), Logical Partitions (LP1,...), Physical Volumes (hdisk9), and Physical Partitions (PP8,...)). Each individual disk drive is called a physical volume (PV) and has a name, usually /dev/hdiskx (where x is a unique integer on the system). Every physical volume in use belongs to a volume group (VG) unless it is being used as a raw storage device or a readily available spare (often called a ’Hot Spare’). Each physical volume consists of a number of disks (or platters) stacked one above the other. Each is divided into physical partitions (PPs) of a fixed size for that physical volume. For space allocation purposes, each physical volume is divided into five regions (outer_edge, outer_middle, center, inner_middle, and inner_edge), and these can be viewed as cylindrical segments cut perpendicularly through the disk platters (See Figure 2.3).
Fig. 2.3 Physical Volume Regions
The number of physical partitions in each region varies depending on the total capacity of the disk drive. The set of operating system commands, library subroutines, and other tools that allow the user to establish and control logical volume storage is called the Logical Volume Manager. The Logical Volume Manager controls disk resources by mapping data between a simple and flexible logical view of storage space and the actual physical disks. The Logical Volume Manager does this by using a layer of device driver code that runs above the traditional physical device drivers. This logical view of the disk storage is provided to applications and is independent of the underlying physical disk structure. After installation, the system has one volume group (the root volume group called rootvg) consisting of a base set of logical volumes required to start the system plus any other logical volumes that were specified to the installation script. Any other physical volumes that are connected to the system can be added to this volume group (using the extendvg command) or used to create a new volume group (using the mkvg command).
The following relationship exists between volume groups and physical volumes:
On a single system, one to many physical volumes can make up a volume group.
• Physical volumes cannot be shared between volume groups.
• The entire physical volume becomes part of the volume group.
• The LVM is physical volume independent, thus, different types of physical volumes can make up a volume group within the limitation imposed by the partition size and partition limit.
Within each volume group, one or more logical volumes (LVs) are defined. Logical volumes are the way to group information located on one or more physical volumes. Logical volumes are an area of disk used to store data, which appears to be contiguous to the application, but can be non-contiguous on the actual physical volume. It is this definition of a logical volume that allows them to be extended, relocated, span multiple physical volumes, and have their contents replicated for greater flexibility and availability.
Each logical volume consists of one or more logical partitions (LPs). Each logical partition corresponds to at least one physical partition. If the logical volume is mirrored, then additional physical partitions are allocated to store the additional copies of each logical partition. These copies usually reside on different physical volumes (for availability) but, for performance reasons, may reside on the same physical volume.
Till now we have seen the following terms with respect to the logical volume manager: Figure 2.4 explains the interrelationship between these terms.
Physical Volume (PV):
A physical volume is any regular hard disk[12]. It can also be a logical drive provided by a hardware RAID controller, which from the operating systems point of view is just a harddisk. Both IDE and SCSI devices are possible. You can even use software RAID to simulate a hard drive, but we recommend a hardware solution is RAID is to be used. A PV can be divided into up to a maximum of 65535 PEs.
Volume Group (VG):
A volume group contains a number of physical volumes (PVs). It groups them into one logical drive – the volume group. The volume group is the equivalent of a hard drive.
Logical Volume (LV):
A logical volume is a part of a volume group [10]. It is the equivalent of a partition. Logical volumes is what really contains the data. Logical volumes are created in volume groups, can be resized within the boundaries of their volume group and even moved to other groups. They are much more flexible than partitions since they do not rely on physical boundaries as partitions on disks do.
Physical Extent (PE):
Logical volumes are made up of physical extents, the smallest physical storage unit in an LVM system. Data is stored in PEs that are part of LVs that are in VGs that consist of PVs. It means any PV consists of lots of PEs, numbered 1-m, where m is the size of the PV divided by the size of one PE. See the command pvdata.
Logical Extent (LE):
Each logical volume is split into chunks of data, known as logical extents. The extent size is the same for all logical volumes in the volume group.
Physical Volume:
The lowest level in the LinuxLVM storage hierarchy is the Physical Volume (PV). A PV is a single device or partition and is created with the command: pvcreate /dev/sdc1. This step initializes a partition for later use. On each PV, a Volume Group Descriptor Area (VGDA) is allocated to contain the specific configuration information. This VGDA is also kept in the /etc/lvmtab.d directory for backup.
pvscan Scan all available SCSI, (E)IDE disks and multiple devices (softwareRAID) for physical volumes. pvcreate Create a physical volume. Target can be a partition (partition id must be 8e), a whole disk pvchange Change attributes on physical volumes. pvdisplay Allows viewing of the attributes of physical volumes. pvdata Shows debugging information about a physical volume. Uses the (volume
group descriptor array (VGDA) of a physical volume. pvmove Allows moving the logical/physical extents allocated on one
logical/physical volume to one or more other physical volumes.
Table 2.1 List of Physical Volume Commands
Physical volumes, also known as direct access storage devices (DASDs), are fixed or removable storage devices. Typically, these devices are hard disks. A fixed storage device is any storage device defined during system configuration to be an integral part of the system DASD. The operating system detects an error if a fixed storage device is not available at some time during normal operation. A removable storage device is any storage device defined during system configuration to be an optional part of the system DASD. The removable storage device can be removed from the system at any time during normal operation. As long as the device is logically unmounted first, the operating system does not detect an error
0 comments:
Post a Comment
Thanks for your Valuable comment