The command vgs was used to display the before and after results. In the above example, we used the vgrename command to rename the existing Volume Group " vg01" to " test_vg01". Volume group "vg01" successfully renamed to ~]# vgs To rename an existing Volume Group, the vgrename command is ~]# vgs Now when the pvs command is issued, we can see that the storage is now associated with the new Volume Group " ~]# pvs dev/sdc lvm2 a- 2.00g ~]# vgcreate vg01 /dev/sdc Physical volume "/dev/sdc" successfully ~]# pvs The command pvs is used to show that it is not associated with any existing Volume ~]# pvcreate /dev/sdc Before the newly added disk can be used we use the pvcreate command. In the example below we are using a newly added disk /dev/sdc. You will also need to specify which Physical Volume (PV) is to be associated with the new Volume Group. To create a new Volume Group (VG) you must use the vgcreate command. Labels on physical volume "/dev/sdc" successfully wiped To remove a Physical Volume from a system, you use the pvremove ~]# pvremove /dev/sdc Physical volume "/dev/sdc" successfully created Writing physical volume data to disk "/dev/sdc" To add a new disk into a system that is to be managed by LVM, you must use the command ~]# pvcreate /dev/sdc This command is useful to help identify a disk that has just been added to a system. Sometimes it is useful to use the command in conjunction with "grep" to limit the output ~]# fdisk -l | grep /dev/sdįrom the above we can see that we have a spare disk on our Red Hat system " /dev/sdc". If you issue the command "fdisk -l" without specifying a disk, then all disk information is displayed.
Partition 1 does not end on cylinder boundary. I/O size (minimum/optimal): 512 bytes / 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes To display partition information on a Linux system, you can issue the fdisk -l ~]# fdisk -l /dev/sdaĢ55 heads, 63 sectors/track, 1044 cylinders List Partitions on a Linux system - fdisk To display partition types and disk information on a Linux system, you can use the lsblk ~]# lsblk
In the above example the parameter "/dev/vg_rhel01/lv_root" was passed to the lvdisplay command.Īlthough this command is not a LVM command, it us useful for displaying partition information. If you issue the "lvdisplay" command without specifying a specific Logical Volume, then all Logical Volumes on your system will be displayed. LV UUID 2LwbRo-KMuD-DQne-3NMI-Jndp-gClY-Zj3uL0 LV VG Attr LSize Pool Origin Data% Move Log Copy% Convertįor a more detailed display of Logical Volumes on a Linux system you can use the command ~]# lvdisplay /dev/vg_rhel01/lv_root To display Logical Volume (LV) information on a Linux system you can issue the lvs ~]# lvs VG UUID ttO0aF-RgCq-OZM7-dKcj-sDr0-vfg1-TDFzj0ĭisplay Logical Volume Information (lvs and lvdisplay) To display basic information regarding a Volume Group on a Linux system you can issue the vgs ~]# vgsįrom the above output we can see that there are 2 Physical Volumes (PV) assigned to the Volume Group (VG) vg_rhel01įor a more detailed view of Volume Groups on a Linux system, you can use the command ~]# vgdisplay vg_rhel01 PV UUID Q3lBfV-tDi9-LJOw-nZKj-fge1-pqSQ-l0Cuteĭisplay Volume Groups (vgs and vgdisplay) To display more details about a PV, you can issue the pvdisplay ~]# pvdisplay To display Physical Volumes (PV) on a system you can issue the pvs ~]# pvs LVM Command Examples Display Physical Volumes (pvs and pvdisplay)