There are scenarios where you would mount a LVM volumes set manually such as debugging or performing disk rescue. This section guides you on how to fully mount a LVM volume from encrypted physical medium to fully functional and accessible logical volume.
The first job is to decrypt the LUKS encrypted physical disk if needed. Otherwise, you may skip this step. For the sake of simplicity, this section assumes /dev/sda_crypt
as the decrypted mapped medium.
Once the encrypted disks are decrypted, you may begin to mount LVM volume from scratch.
Instead of scanning it manually, you may use vgscan
command. It is as simple as:
$ vgscan --mknodes
Found volume group "lvmVG01" using metadata type lvm2
Once you obtain the LVM volume name from the scan (in the example above, it is "lvmVG01
"), you want to activate it. To do that, you use the following command:
$ vgchange -ay <volume name>
Based on the example above, it is:
$ vgchange -ay lvmVG01
...
At this point, all logical volumes within the LVM volume(s) are now available, you may query the logical volume status just in case.
Now we can create the mounting directory at the desired locations. Example:
$ mkdir -vp /media/u0/{drive1,drive2}
With the target directories ready, you can mount the drive as usual. All logical volumes are available under /dev/<volume name>/<logical volume name>
path similar to the conventional /dev/sdX
physical disk pattern. The command syntax is as follows:
$ mount /dev/<volume name>/<logical volume name> /path/to/mounting/point
Example:
$ mount /dev/lvmVG01/localstore /media/u0/drive1
As such, your drive is ready for use at your target mounting point.
That's all for mounting LVM volume.