Skip to content

Instantly share code, notes, and snippets.

@flbuddymooreiv
Last active January 10, 2021 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flbuddymooreiv/b5b59fd6af51657e0225521fc4d4e9b5 to your computer and use it in GitHub Desktop.
Save flbuddymooreiv/b5b59fd6af51657e0225521fc4d4e9b5 to your computer and use it in GitHub Desktop.
LVM on Cryptsetup
# List your block devices with filesystems
sudo lsblk --fs

# Map the encrypted disk
sudo cryptsetup luksOpen /dev/sdb5 oldgraybook

# List volume groups
sudo vgs

# List logical volumes
sudo lvs

# Scan VGs
sudo vgscan

# Activate VGs
sudo vgchange -ay

# Mount LV
sudo mount /dev/mapper/lv-name /mnt/mountpoint

# Umount LV
sudo umount /mnt/mountpoint

# Close Encrypted device
sudo cryptsetup luksClose oldgraybook

# If decvice is busy
sudo dmsetup remove /dev/mapper/graybook--old--vg-root
sudo dmsetup remove /dev/mapper/graybook--old--vg-swap_1
sudo dmsetup remove oldgraybook
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment