Linux mount an LVM volume / partition command

https‮www//:‬.lautturi.com
Linux mount an LVM volume / partition command

To mount an LVM (Logical Volume Manager) volume or partition in Linux, you will need to follow these steps:

  1. Use the pvs command to display the physical volumes (PVs) in your LVM setup:
$ pvs

This will display a list of the physical volumes (disks or partitions) that are available for use in your LVM setup.

  1. Use the vgs command to display the volume groups (VGs) in your LVM setup:
$ vgs

This will display a list of the volume groups (collections of physical volumes) that are available in your LVM setup.

  1. Use the lvs command to display the logical volumes (LVs) in your LVM setup:
$ lvs

This will display a list of the logical volumes (virtual disks or partitions) that are available in your LVM setup.

  1. Identify the logical volume that you want to mount, and note the name and path of the logical volume. For example, the logical volume may be named lv_root and have a path of /dev/vg_root/lv_root.

  2. Create a mount point for the logical volume. A mount point is a directory where the logical volume will be mounted. For example, you can create a mount point at /mnt/lv_root:

$ mkdir -p /mnt/lv_root
  1. Use the mount command to mount the logical volume at the mount point:
$ mount /dev/vg_root/lv_root /mnt/lv_root

Replace /dev/vg_root/lv_root with the path of the logical volume that you want to mount, and /mnt/lv_root with the mount point that you created.

This will mount the logical volume at the specified mount point.

To verify that the logical volume has been mounted successfully, you can use the df command to display the mounted filesystems:

$ df -h

This will display a list of the mounted filesystems, including the logical volume that you just mounted.

Note that you will need the appropriate permissions to mount a LVM volume. If you do not have the necessary permissions, you may receive an error message.

You can also use the /etc/fstab file to automatically mount a volume.

$ vi /etc/fstab
Created Time:2017-10-30 10:17:41  Author:lautturi