What is the difference between the two?
I know a Physical Volume relates to Volume Groups. Does a Physical Partition mean it should be a Primary partition or does it matter at all weather it is Primary/Extended or Logical in nature?
Thanks,
Physical partition is a concept from partition tables using msdos type, which supports only 4 physical partitions, but can have 3 physical and 1 extended, with several logical partitions. This is a way to devide a disk into multiple units.
A Physical Volume (PV) is used as a base for Logical Volume Management (LVM), and it's a kind of filesystem that you format your partition (physical or logical). Than you can agregate it with others PV's into a unique Volume Group (VG) to create your Logical Volume (LV). The usage of LVM gives you the ability of have a bigger disk, combining small ones, and even moving data from one disk to another with the system alive, if one of the disks are failing or too small.
I’m sorry, but there is some very misleading information here. I would humbly suggest that this should not previously have been marked as having a solution,
A physical partition doesn't have anything to do with "msdos" – it isn’t even a partition type in Red Hat. To state as much is terribly misleading.
Red Hat supports many types of physical partitions; normally, its default partition type is "Linux" (type 83 - fdisk or type 8300 - gdisk).
Quite simply, a block device (a hard drive or SSD) must have at least 1 physical partition on it to be used.
Here's a decent definition, "A [physical] partition is a section of a storage device, such as a hard disk drive or solid state drive. It is treated by the operating system as a separate ... volume, which makes it function similar to a separate physical device." (https://techterms.com/definition/partition)
That's why, in Windows, physical partitions are represented by drive letters: C:\, D:\, etc.
In Red Hat, they look like: /dev/sda1 (first discovered block device, first partition), /dev/sda2 (first discovered block device, second partition), /dev/sdb1 (second discovered block device, first partition), etc.
Physical partitions are in no way filesystems! Filesystems are what is done to a partition (or logical volume) once created – this is sometimes known as “formatting.”
The easiest way to think of a physical volume (PV) is that it is a physical partition that [1] has a partition type of “Linux LVM” (type 8e - fdisk or type 8e00 - gdisk) and [2] has been "marked" as a PV using pvcreate -- meaning that it can now be added to a volume group (VG). From the VG, logical volumes (LV) can be created.
PVs, VGs, and LVs are part Red Hat’s Logical Volume Manager (LVM) system. You can read more about it here: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/logical_volume_manager...
Generally, a single primary partition is created on a block device that is to be used (ultimately) in a logical volume.
I mentioned two utilities, fdisk, and gdisk. These are used to make partitions. Each support a different set of partition types (with some overlap). Here’s a quick break-down of their differences:
fdisk
gdisk
You got it right Ricardo- that's exactly what the difference is between physical volume and physical partition. A partition can be primary or extended- primary and extended are just types of a physical partition, doesn't matter if a particular partition is primary or extended. Both are physical. Physical volume is related to Logical Volume realm- the view on the logical configuration is abstracted from its underlying physical configuration. Out of physical volumes you create volume groups and then logical volumes. Partitioning scheme stops being as relevant as it was before you started using LVM.
Once you make a physical partition a physical volume and then later a part of a volume group, you don't need to worry or know actual disk topology anymore- you deal with volume groups, logical volumes and all the operations they can afford you as an admin. To know how to execute LV management becomes especially important when you are required to do operations that normally, if you relied only on physical partitions and their filesystem formatting, are prohibited or the cost is prohibitive and time consuming- shrinking a partition for example, vs. shrinking a logical volume. XFS, default filesystem of RHEL 7, doesn't allow shrinking but shrinking a logical volume via recovery from a snapshot is rather trivial.
A doubt
Why is it not possible to create volume group directly out of a partition
a volume group is an abstraction that comprises both physical volumes, logical volumes and their metadata. You can issue something like "vgcreate myvolumegroup /dev/sdXY", and that will create both a PV on /dev/sdXY, and a volume group that owns that PV. You cannot create an empty volume group without including at least one PV or device that will hold the PV.
Hello Tracy. I run a RH 8.6. I wonder, if physical partitions slated for LVM usage have to be of type 'Linux LMV' (8e), then how come in my installation, a physical partion /dev/nvme01p3 which is used as a LVM physical volume, is of type 'Linux filesystem' (8300)
For comparison, on CentOS 7 the LVM physcial partition /dev/vda2 is indeed of type 'Linux LVM':
What are trying to do? Are you creating an LVM installation and need to create PVs or are you asking about MBR partitions? If we know what you are trying to accomplish we can offer more help.
Physical partition is a concept from partition tables using msdos type, which supports only 4 physical partitions, but can have 3 physical and 1 extended, with several logical partitions. This is a way to devide a disk into multiple units.
A Physical Volume (PV) is used as a base for Logical Volume Management (LVM), and it's a kind of filesystem that you format your partition (physical or logical). Than you can agregate it with others PV's into a unique Volume Group (VG) to create your Logical Volume (LV). The usage of LVM gives you the ability of have a bigger disk, combining small ones, and even moving data from one disk to another with the system alive, if one of the disks are failing or too small.
I’m sorry, but there is some very misleading information here. I would humbly suggest that this should not previously have been marked as having a solution,
A physical partition doesn't have anything to do with "msdos" – it isn’t even a partition type in Red Hat. To state as much is terribly misleading.
Red Hat supports many types of physical partitions; normally, its default partition type is "Linux" (type 83 - fdisk or type 8300 - gdisk).
Quite simply, a block device (a hard drive or SSD) must have at least 1 physical partition on it to be used.
Here's a decent definition, "A [physical] partition is a section of a storage device, such as a hard disk drive or solid state drive. It is treated by the operating system as a separate ... volume, which makes it function similar to a separate physical device." (https://techterms.com/definition/partition)
That's why, in Windows, physical partitions are represented by drive letters: C:\, D:\, etc.
In Red Hat, they look like: /dev/sda1 (first discovered block device, first partition), /dev/sda2 (first discovered block device, second partition), /dev/sdb1 (second discovered block device, first partition), etc.
Physical partitions are in no way filesystems! Filesystems are what is done to a partition (or logical volume) once created – this is sometimes known as “formatting.”
The easiest way to think of a physical volume (PV) is that it is a physical partition that [1] has a partition type of “Linux LVM” (type 8e - fdisk or type 8e00 - gdisk) and [2] has been "marked" as a PV using pvcreate -- meaning that it can now be added to a volume group (VG). From the VG, logical volumes (LV) can be created.
PVs, VGs, and LVs are part Red Hat’s Logical Volume Manager (LVM) system. You can read more about it here: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/logical_volume_manager...
Generally, a single primary partition is created on a block device that is to be used (ultimately) in a logical volume.
I mentioned two utilities, fdisk, and gdisk. These are used to make partitions. Each support a different set of partition types (with some overlap). Here’s a quick break-down of their differences:
fdisk
gdisk
Hello Tracy. I run a RH 8.6. I wonder, if physical partitions slated for LVM usage have to be of type 'Linux LMV' (8e), then how come in my installation, a physical partion /dev/nvme01p3 which is used as a LVM physical volume, is of type 'Linux filesystem' (8300)
For comparison, on CentOS 7 the LVM physcial partition /dev/vda2 is indeed of type 'Linux LVM':
I mean disk label type: msdos, gpt, etc...
man 8 parted - search for mklabel
You got it right Ricardo- that's exactly what the difference is between physical volume and physical partition. A partition can be primary or extended- primary and extended are just types of a physical partition, doesn't matter if a particular partition is primary or extended. Both are physical. Physical volume is related to Logical Volume realm- the view on the logical configuration is abstracted from its underlying physical configuration. Out of physical volumes you create volume groups and then logical volumes. Partitioning scheme stops being as relevant as it was before you started using LVM.
Once you make a physical partition a physical volume and then later a part of a volume group, you don't need to worry or know actual disk topology anymore- you deal with volume groups, logical volumes and all the operations they can afford you as an admin. To know how to execute LV management becomes especially important when you are required to do operations that normally, if you relied only on physical partitions and their filesystem formatting, are prohibited or the cost is prohibitive and time consuming- shrinking a partition for example, vs. shrinking a logical volume. XFS, default filesystem of RHEL 7, doesn't allow shrinking but shrinking a logical volume via recovery from a snapshot is rather trivial.
A doubt
Why is it not possible to create volume group directly out of a partition
a volume group is an abstraction that comprises both physical volumes, logical volumes and their metadata. You can issue something like "vgcreate myvolumegroup /dev/sdXY", and that will create both a PV on /dev/sdXY, and a volume group that owns that PV. You cannot create an empty volume group without including at least one PV or device that will hold the PV.
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.