Local disk running with Logical Volume Manager (LVM) is used as the storage. LVM is a flexible and powerful disk manager. For additional info about LVM, please refer to the link https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html-single/Logical_Volume_Manager_Administration/index.html.
To create LVM volume, we need a whole disk. For a disk device, only the partition table must be erased, which will effectively destroy information about partitions on that disk. In the following command, we will focus on the first sector (be careful, this command will erase the partition table):
# dd if=/dev/zero of=PhysicalVolume bs=512 count=1
PhysicalVolume
must be replaced by target disk device.
Now we can initialize a physical volume and a volume group. Logical volume will be created in the storage volume group. For logical volume, which is also named as storage
, we take 90 percent of free space from the physical volume:
# pvcreate /dev/sdb # vgcreate storage /dev/sdb # lvcreate -l 90%FREE -n storage/storage
Formatting the logical volume to filesystem is not required and we can proceed to the package installation.