Last active
October 12, 2015 15:27
-
-
Save ezheidtmann/44d9a5f183b4edd29bc2 to your computer and use it in GitHub Desktop.
LVM2 cheat sheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# LVM is an advanced system. This document only describes my use case. | |
# I use it on a pair of external USB disks; these commands help me to mount & unmount logical volumes on my laptop. | |
##### | |
# Plug in the disks, mount them | |
vgscan # maybe optional | |
vgchange -ay # creates /dev/* entries | |
mount /dev/<vgname>/<lvname> /mountpoint | |
##### | |
# How to remove disks | |
umount <volumes on disks> | |
vgchange -a n <vgname> | |
##### | |
# You unplugged your disks (oops). List devicemapper entries and prune the broken ones: | |
dmsetup ls | |
dmsetup remove <name> | |
# this is safe if you don't have any active lvm volumes | |
dmsetup remove_all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment