Difference between revisions of "LVM"

From Blue-IT.org Wiki

(Mount existing volume groups)
(Umount existing volume groups and close encrypted container)
Line 34: Line 34:
 
== Umount existing volume groups and close encrypted container ==
 
== Umount existing volume groups and close encrypted container ==
  
 +
sudo umount ${my_root}/*
 
  sudo umount /dev/mapper/whatever
 
  sudo umount /dev/mapper/whatever
 
  sudo vgchange -a n
 
  sudo vgchange -a n
 
  sudo cryptsetup luksClose my-crypt
 
  sudo cryptsetup luksClose my-crypt

Revision as of 06:41, 18 September 2015

Install necessary apps

E.g. on a rescue disc ...

apt-get install cryptsetup

Open encryted lvm partition

cryptsetup luksOpen /dev/sda5 my-crypt

Mount existing volume groups

sudo apt-get install lvm2
sudo modprobe dm-mod
sudo vgchange -a y
> 2 logical volume(s) in volume group "vg-whatever" now active
ls /dev/mapper
> control vg--whatever--root  vg--whatever--swap
my_root=/mnt/whatever_root
mkdir ${my_root}
mount /dev/mapper/vg--whatever--root ${my_root}
mount /dev/sdax ${my_root}/boot
mount -o bind /dev ${my_root}/dev; \
mount -o bind /run ${my_root}/run; \
mount -t proc /proc ${my_root}/proc; \
mount -t sysfs /sys ${my_root}/sys
chroot ${my_root}

Umount existing volume groups and close encrypted container

sudo umount ${my_root}/*
sudo umount /dev/mapper/whatever
sudo vgchange -a n
sudo cryptsetup luksClose my-crypt