Tag Archives: lvsync

LVM cheatsheet

List of all LVM command of HPUX tutorials we have seen before on KernelTalks. LVM commands related to physical volume, volume group, and logical volume.

What is LVM?

LVM is a Logical Volume Manager.

LVM is a volume manager in Unix-Linux systems. It used to manage your disks. LVM enables raw disks to be used as a data store, file system defined mount points. LVM helps to manage your disk volumes efficiently for performance and data integrity. VxVM i.e. Veritas Volume Manager is another volume manager that is as popular as LVM.

Previously we have seen a series of LVM command tutorials on KernelTalks. Here is a summary of it along in the form of LVM cheatsheet for your quick reference.

Physical Volume Commands

Command
Description
Example
pvcreate Create physical volume Tutorial link
pvdisplay Display physical volume details Tutorial link
pvchange Activate, de-activate physical volume Tutorial link
pvmove Move data from one PV to another Tutorial link

Volume Group Commands

Command
Description
Example
vgcreate Create volume group Tutorial Link
vgdisplay Display volume group details Tutorial Link
vgscan Rebuild /etc/lvmtab file Tutorial Link
vgextend Add new PV to VG Tutorial Link
vgreduce Remove PV from VG Tutorial Link
vgexport Export VG from system Tutorial Link
vgimport Import VG into system Tutorial Link
vgcfgbackup Backup VG configurations Tutorial Link
vgcfgrestore Restore VG configurations Tutorial Link
vgchange Change details of VG Tutorial Link
vgremove Remove VG from system Tutorial Link
vgsync Sync stale PE in VG Tutorial Link

Logical Volume Commands

Command
Description
Example
lvcreate Create logical volume Tutorial Link
lvdisplay Display logical volume details Tutorial Link
lvremove Remove logical volume Tutorial Link
lvextend Increase size of logical volume Tutorial Link
lvreduce Decrease size of logical volume Tutorial Link
lvchange Change details of logical volume Tutorial Link
lvsync Sync stale LE of logical volume Tutorial Link
lvlnboot Set LV as root, boot, swap or dump volume Tutorial Link

LVM commands tutorial: Part 3: Logical Volume (lvsync, lvlnboot)

Series of the tutorial to learn LVM commands. In this part, learn how to sync LV and set it as a boot, root, swap device (lvsync, lvlnboot)

This is the last part of LVM command tutorials and last post for logical volume command too. Last all parts of this tutorial can be found on below links :

Let’s start with our first command here.

Command: lvsync

It synchronizes stale PE in given LV. It’s used in mirroring environment. Whenever there is any disk failure or disk path issue, PE goes bad and LV, in turn, has stale PE. Once the issue is corrected we need to sync stale PE with this command if they don’t sync automatically.

The command doesn’t have many options. It should be supplied with the LV path only.

# /usr/sbin/lvsync /dev/vg00/lvol6
Resynchronized logical volume "/dev/vg00/lvol6".

Command: lvlnboot

This command used to define logical volume as a root, dump, swap or boot volume. You have to submit an LV path along with the specific option of your choice to command. Options are as below :

  • -b Boot volume
  • -d Dump volume
  • -r Root volume
  • -s Swap volume
  • -R Recover any missing links
  • -v Verbose mode
# lvlnboot -r /dev/vg00/lvol3
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
# lvlnboot -b /dev/vg00/lvol1
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
# lvlnboot -s /dev/vg00/lvol2
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
# lvlnboot -d /dev/vg00/lvol2
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

We have already seen this command in root disk mirroring.

This concludes our LVM command tutorials!! Feel free to drop in any queries you have.