How to mount LVM volume from an external hard disk on CentOS?

On Fedora, after inserting/plugging in an exteranl hard disk with LVM partitions on it, the partitions will appear under /dev like /dev/lvm-group/lvm-partition.

However, on CentOS 6, the LVM volumes do not appear automatically. How to mount LVM partitions from an external hard disk on CentOS?

asked May 6, 2015 by Eric Z Ma (44,280 points)

1 Answer

 
Best answer

What you need on CentOS is to activate the LVM volumes by the vgchange command

# vgchange -aay

About the options:

-a, --activate [a|e|l]{y|n}

Controls the availability of the logical volumes in the volume group for input/output. In other words, makes the logical volumes known/unknown to the kernel. If autoactivation option is used (-aay), each logical volume in the volume group is activated only if it matches an item in the activation/auto_activation_volume_list set in lvm.conf. If this list is not set, then all volumes are considered for activation. The -aay option should be also used during system boot so it's possible to select which volumes to activate using the activation/auto_activation_volume_list settting.

Activation of a logical volume creates a symbolic link /dev/VolumeGroupName/LogicalVolumeName pointing to the device node. This link is removed on deactivation. All software and scripts should access the device through this symbolic link and present this as the name of the device. The location and name of the underlying device node may depend on the distribution and configuration (e.g. udev) and might change from release to release.

If clustered locking is enabled, add 'e' to activate/deactivate exclusively on one node or 'l' to activate/deactivate only on the local node. Logical volumes with single-host snapshots are always activated exclusively because they can only be used on one node at once.

Then you should be able to find the LVM volume at /dev/VolumeGroupName/LogicalVolumeName and you can mount them as usual.

answered May 6, 2015 by Eric Z Ma (44,280 points)
selected May 6, 2015 by Eric Z Ma
How to deactivate a LVM logical volume on Linux? asked May 12, 2015 by Eric Z Ma (44,280 points)

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...