====== Mount LVM Partitions ====== Sometimes you might need to access an LVM partition that resides on an disk but is not //automatically// mounted by the system. For example, hooking an external HDD or SSD that was formatted using LVM won't //automatically// mount (or even give you access) to the LVM partitions it contains. Of course you'll need the [[https://packages.debian.org/lvm2|LVM2 package]] installed (which should be the case on LMDE2). A full reference regarding this package can be accessed on [[https://wiki.debian.org/LVM|this page of the Debian wiki]]. ===== Check LVM is Installed ===== To check wether the lvm2 package is installed on your system, use: <Code:bash> > sudo apt-cache policy lvm2 lvm2: Installed: 2.02.111-2.2+deb8u1 Candidate: 2.02.111-2.2+deb8u1 Version table: *** 2.02.111-2.2+deb8u1 0 500 http://ftp.be.debian.org/debian/ jessie/main amd64 Packages 100 /var/lib/dpkg/status </Code> In case you get a line saying ''Installed: (none)'', you'll need to install the package, then start the service: <Code:bash> > sudo apt-get install lvm2 > /etc/init.d/lvm2 start </Code> ===== Activating a Volume Group ===== We consider having an internal device containing the vg01 volume group, while the one on the external device is vg00. Connect the external device to the system, then use the following commands: <Code:bash> > sudo vgscan Reading all physical volumes. This may take a while... Found volume group "vg00" using metadata type lvm2 Found volume group "vg01" using metadata type lvm2 > sudo vgchange -a y </Code> Now, all the LVM partitions should have devices created in the form /dev/volumegroup/logicalvolume: <Code:bash> > lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 931.5G 0 disk ├─sda1 8:1 0 2G 0 part [SWAP] ├─sda2 8:2 0 20G 0 part / └─sda3 8:3 0 909.5G 0 part ├─vg01-opt 254:2 0 20G 0 lvm /opt └─vg01-home 254:3 0 889.5G 0 lvm /home sdb 8:16 0 232.9G 0 disk ├─sdb1 8:17 0 18G 0 part ├─sdb2 8:18 0 2G 0 part └─sdb3 8:19 0 212.9G 0 part ├─vg00-opt 254:0 0 10G 0 lvm └─vg00-home 254:1 0 202.9G 0 lvm </Code> It is now possible to mount the LVM partitions as any other partition: <Code:bash> > sudo mount /dev/vg00/home /mnt/mountpoint </Code> ===== Renaming a Volume Group ====== In case the volume group standing on the external device has the same name as your internal one, you won't be able to access both at the same time. In this situation first eject the external device, then rename your internal volume group (here vg00): <Code:bash> > sudo vgscan > sudo vgchange -a n > vgrename vg00 vg01 </Code> Then reconnect the external device and issue: <Code:bash> > sudo vgscan > sudo vgchange -a y </Code>