Creating an LVM Logical Volume on Multiple Disks


Creating an LVM Logical Volume on Multiple Disks

This example creates an LVM logical volume called new_logical_volume that consists of the disks at /dev/sda1, /dev/sdb1, and /dev/sdc1 /dev/sdd1

Creating the Physical Volumes To use disks in a volume group, you label them as LVM physical volumes. Warning This command destroys any data on /dev/sda1, /dev/sdb1, and /dev/sdc1, /dev/sdd1

# pvcreate /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1

Creating the Volume Group The following command creates the volume group new_vol_group.

# vgcreate new_vol_group /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1

Volume group "new_vol_group" successfully created You can use the vgs command to display the attributes of the new volume group.

# vgs

Creating the Logical Volume The following command creates the logical volume new_logical_volume from the volume group new_vol_group. This example creates a logical volume that uses 4TB of the volume group.

 # lvcreate -L4T -n new_logical_volume new_vol_group Logical volume "new_logical_volume" created Creating the File System The following command creates a GFS2 file system on the logical volume.

# mkfs.gfs2 -plock_nolock -j 1 /dev/new_vol_group/new_logical_volume

All Done The following commands mount the logical volume and report the file system disk space usage.

Create a directory and mount directory with volume group

#mkdir -p /u01

# mount /dev/new_vol_group/new_logical_volume /u01

 And add bilkd entries  into /etc/fstab file to make permanent disk

Comments

Popular posts from this blog

NetSH collection commands

Script for Host entry in remote servers