Archive for the tag 'Initializing'

SBDavid

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/sdd, /dev/sde, and /dev/sdf as LVM physical volumes for later use as part of LVM logical volumes.

pvcreate /dev/sdd /dev/sde /dev/sdf
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)