Archive for the tag 'Physical'

More about LVM Components Physical Volumes

Physical Volumes

The underlying physical storage unit of an LVM logical volume is a block device such as a partition or whole disk. To use the device for an LVM logical volume the device must be initialized as a physical volume (PV).

Initializing a block device as a physical volume places a label near the start of the device.

By default, the LVM label is placed in the second 512-byte sector. You can overwrite this default by placing the label on any of the first 4 sectors. This allows LVM volumes to co-exist with other users of these sectors, if necessary.

An LVM label provides correct identification and device ordering for a physical device, since devices can come up in any order when the system is booted. An LVM label remains persistent across reboots and throughout a cluster.

The LVM label identifies the device as an LVM physical volume. It contains a random unique identifier (the UUID) for the physical volume. It also stores the size of the block device in bytes, and it records where the LVM metadata will be stored on the device.

The LVM metadata contains the configuration details of the LVM volume groups on your system. By default, an identical copy of the metadata is maintained in every metadata area in every physical volume within the volume group. LVM metadata is small and stored as ASCII.

SBDavid

LVM - Initializing Physical Volumes

Initializing Physical Volumes

Use the pvcreate command to initialize a block device to be used as a physical volume.

Initialization is analogous to formatting a file system.

The following command initializes /dev/sdd1, /dev/sde1, and /dev/sdf1 for use as LVM physical volumes.

pvcreate /dev/sdd1 /dev/sde1 /dev/sdf1

To initialize partitions rather than whole disks: run the pvcreate command on the partition.

The following example initializes the partition /dev/hdb1 as an LVM physical volume for later use as part of an LVM logical volume.

pvcreate /dev/hdb1

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 0×8e using fdisk(8), cfdisk(8), or a equivalent. For whole disk devices only the partition table must be erased, which will effectively destroy all data on that disk. This can be done by zeroing the first sector with:

dd if=/dev/zero of=PhysicalVolume bs=512 count=1

Continue with vgcreate(8) to create a new volume group on PhysicalVolume, or vgextend(8) to add PhysicalVolume to an existing volume group.

Example

Initialize partition #4 on the third SCSI disk and the entire fifth SCSI disk for later use by LVM:

pvcreate /dev/sdc4 /dev/sde

See Also

lvm(8), vgcreate(8), vgextend(8), lvcreate(8), cfdisk(8), fdisk(8), losetup(8), mdadd(8), vgcfgrestore(8), vgconvert(8)

Referenced By

pvchange(8), pvck(8), pvdisplay(8), pvremove(8), pvscan(8), vgchange(8), vgdisplay(8)

« Prev