Skip to content

Instantly share code, notes, and snippets.

@colinux
Created April 11, 2011 20:25
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 colinux/914250 to your computer and use it in GitHub Desktop.
Save colinux/914250 to your computer and use it in GitHub Desktop.
successive commands to recover from live system my debian installation with lvm crypted and grub on separate partition
# Assume here boot/grub is on a separate partition, /dev/sda4
# The full LVM partition is on /dev/sda3 and named VM-system (pvs gives hints)
# On a live cd with network ...
aptitude install lvm2 (+ cryptsetup if not installed)
modprobe dm-crypt
cryptsetup luksOpen /dev/sda3 VM-system
pvs
pvdisplay /dev/mapper/VM-system
mount /dev/mapper/VM_group-LV_system /mnt
mount --bind /dev/pts /mnt/dev/pts
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mount /dev/sda4 /mnt/boot # for grub / img manipulations
cp /etc/resolv.conf /mnt/etc/resolv.conf
chroot /mnt
# do all your recover operations here, including aptitude commands
umount /dev/pts
umount /sys
umount /proc
umount /boot
exit
cryptsetup luksClose VM-system
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment