20140806 mounting an lvm disk - plembo/onemoretech GitHub Wiki

title: Mounting an lvm disk link: https://onemoretech.wordpress.com/2014/08/06/mounting-an-lvm-disk/ author: phil2nc description: post_id: 8137 created: 2014/08/06 09:22:19 created_gmt: 2014/08/06 13:22:19 comment_status: closed post_name: mounting-an-lvm-disk status: publish post_type: post

Mounting an lvm disk

LVM (Logical Volume Manager) is a wonderful thing. For those who find themselves doing a lot of partition resizing and shuffling of physical disks it can be very helpful. But mounting an LVM disk on another machine isn't exactly an intuitive operation. Read one. Rule number one to keep in mind is that you can't mount two LVM volumes with the same name on the same machine. Ever. So if a volume on machine A is labelled "fedora-home" and a volume on machine B is labelled "fedora-home" they both can't be mounted on either machine at the same time. A good rule of thumb is to name your volumes for the host they reside on, or some other unique value (like a serial number, for example the date plus random digits: "2014080601-home"). Keep in mind that the only place the volume label shows up is in /etc/fstab and the output from the LVM utilties. Note you can rename a volume, and if you're moving one from another machine you'll probably want to. This is something probably best done using a Live CD/DVD/USB stick. Before you can mount an LVM disk you'll want to gather some information. Find all LVM volume groups:

vgscan

Activate:

vgchange -a -y [name of volume group]

To rename a volume:

vgrename [original name] [new name]

Keep in mind that if you do the above on a boot drive you're going to have to go in and conform /etc/mtab and /etc/fstab to reflect the new volume names (I don't recommend using LVM on a boot drive, and do encourage the use of an entirely separate physical disk for booting -- modestly sized SSD drives are very fast, and now very cheap). Mount the volume:

mount /dev/[volume name] /mnt

Copyright 2004-2019 Phil Lembo