This article describes How to create LVM logical volume/partition/diskgroup in Red Hat Linux
Linux is the best-known and most-used open source operating system. As an operating system, Linux is software that sits underneath all of the other software on a computer, receiving requests from those programs and relaying these requests to the computer’s hardware.
For the purposes of this page, we use the term “Linux” to refer to the Linux kernel, but also the set of programs, tools, and services that are typically bundled together with the Linux kernel to provide all of the necessary components of a fully functional operating system. Some people, particularly members of the Free Software Foundation, refer to this collection as GNU/Linux, because many of the tools included are GNU components. However, not all Linux installations use GNU components as a part of their operating system. Android, for example, uses a Linux kernel but relies very little on GNU tools.
Linux has been around since the mid-1990s and has since reached a user-base that spans the globe. Linux is actually everywhere: It?s in your phones, your thermostats, in your cars, refrigerators, Roku devices, and televisions. It also runs most of the Internet, all of the world’s top 500 supercomputers, and the world’s stock exchanges.
Every version of the Linux operating system manages hardware resources, launches and handles applications, and provides some form of user interface. The enormous development community and wide range of distributions means that a Linux version is available for almost any task, and Linux has penetrated many areas of computing.
Red Hat Enterprise Linux (RHEL) is a Linux-based operating system from Red Hat designed for businesses. RHEL can work on desktops, on servers, in hypervisors or in the cloud. Red Hat and its community-supported counterpart, Fedora, are among the most widely used Linux distributions in the world.
Red Hat Enterprise Linux has multiple variants, with server versions for x86, x86-64, PowerPC, Itanium and IBM System z. It also includes desktop versions for x86 and x86-64. As of November, 2011, the latest variant of RHEL is RHEL 6.
Being a Linux distribution, Red Hat Enterprise Linux contains the Linux kernel as well as some applications for performing certain tasks. Like all Linux distributions, RHEL is open source. Thus, people can view its source code, download it and make their own customized versions.
Some of the notable Linux distros that are actually derived from RHEL include CentOS, Oracle Enterprise Linux, Scientific Linux and Pie Box Enterprise Linux.
Red Hat Enterprise Linux (RHEL) is a distribution of the Linux operating system developed for the business market. RHEL was formerly known as Red Hat Linux Advanced Server.
Volume management creates a layer of abstraction over physical storage, allowing you to create logical storage volumes. This provides much greater flexibility in a number of ways than using physical storage directly. With a logical volume, you are not restricted to physical disk sizes. In addition, the hardware storage configuration is hidden from the software so it can be resized and moved without stopping applications or unmounting file systems. This can reduce operational costs.
Logical volume manager (LVM) introduces an extra layer between the physical disks and the file system allowing file systems to be :
– resized and moved easily and online without requiring a system-wide outage.
– Using discontinuous space on disk
– meaningful names to volumes, rather than the usual cryptic device names.
– span multiple physical disks
Linux LVM is very similar to HP-UX LVM and provides many other advanced features like snapshots, cluster support (GFS2, OCFS and Lustre).
LVM comprises of few conceptual layers such as physical volume, logical volume and file systems.
As disk drive capacities soared, some people began to wonder if having all of that formatted space in one big chunk was such a great idea. This line of thinking was driven by several issues, some philosophical, some technical. On the philosophical side, above a certain size, it seemed that the additional space provided by a larger drive created more clutter. On the technical side, some file systems were never designed to support anything above a certain capacity. Or the file systems could support larger drives with a greater capacity, but the overhead imposed by the file system to track files became excessive.
The solution to this problem was to divide disks into partitions. Each partition can be accessed as if it was a separate disk. This is done through the addition of a partition table.
fdisk also known as format disk is a dialog-driven command in Linux used for creating and manipulating disk partition table. It is used for the view, create, delete, change, resize, copy and move partitions on a hard drive using the dialog-driven interface.
fdisk allows you to create a maximum of four primary partitions and the number of logical partition depends on the size of the hard disk you are using. It allows the user:
To Create space for new partitions.
Organizing space for new drives.
Re-organizing old drives.
Copying or Moving data to new disks(partitions).
pvcreate initializes PhysicalVolume for later use by the Logical Volume Manager (LVM). Each PhysicalVolume can be a disk partition, whole disk, meta device, or loopback file. For DOS disk partitions, the partition id should be set to 0x8e using fdisk(8), cfdisk(8), or a equivalent.
pvdisplay allows you to see the attributes of one or more physical volumes like size, physical extent size, space used for the volume group descriptor area and so on.
pvs produces formatted output about physical volumes.
lvcreate is the command do allocating logical extents from the free physical extent pool of that volume group.
vgcreate creates a new volume group called VolumeGroupName using the block special device PhysicalDevicePath.
vgs produces formatted output about volume groups.
The vgdisplay command, common in Linux systems, displays various attributes about volume groups. A volume group is merely a collection of logical volumes that are linked in some logical way. For example, a person with several internal and external hard disks might use separate volume groups for each set of drives, given that Linux expects its volumes to remain persistent (e.g., not disappearing when you unplug the drive).
lvs - Display information about logical volumes
The mkfs (i.e., make filesystem) command is used to create a filesystem (i.e., a system for organizing a hierarchy of directories, subdirectories and files) on a formatted storage device or media, usually a partition on a hard disk drive (HDD),
mke2fs is used to create an ext2, ext3, or ext4 filesystem, usually in a disk partition. device is the special file corresponding to the device (e.g /dev/hdXX). blocks-count is the number of blocks on the device. If omitted, mke2fs automagically figures the file system size. If called as mkfs.ext3 a journal is created as if the -j option was specified.
Linux has a strong built-in utility called ‘df‘. The ‘df‘ command stands for “disk filesystem“, it is used to get a full summary of available and used disk space usage of the file system on Linux system.
Using ‘-h‘ parameter with (df -h) will show the file system disk space statistics in “human readable” format, means it gives the details in bytes, megabytes, and gigabyte.
The mount command mounts a storage device or filesystem, making it accessible and attaching it to an existing directory structure.
The umount command "unmounts" a mounted filesystem, informing the system to complete any pending read or write operations, and safely detaching it.
mkdir command in Linux allows the user to create directories (also referred to as folders in some operating systems ). This command can create multiple directories at once as well as set the permissions for the directories.
The cd command is used to change the current directory (i.e., the directory in which the user is currently working) in Linux and other Unix-like operating systems.
Now you can find some examples in this video.
Please subscribe to support our channel.
To be aware of our new videos please subscribe our channel.
Visit our website https://sdk-it.com
Visit our youtube channel
Watch IT & Learn IT & Apply IT.
Enjoy!