Restoring encrypted LVM system after all kernels have been deleted

Because I deleted all kernels from my running system the second time in my live I thought it’s time to list the steps needed to get the system run again (this is mainly for the next time I will do this stupid mistake) 😉

  • Boot a live CD and follow these steps (the live-system should include cryptsetup and lvm, otherwise you must install these tools inside the running system, e.g. ubuntu: apt-get install …):
  • Find the encrypted LVM: fdisk -l /dev/sdX (or hdX)
  • cryptsetup luksOpen /dev/sdX lukslvm (lukslvm should be the name you used formerly)
  • call pvs;vgs;lvs
  • mount all needed devices, see http://wiki.ubuntuusers.de/chroot/Live-CD (german) or http://ubuntuforums.org/archive/index.php/t-1156240.html (english) and chroot into the system
  • Check if the name (e.g. “lukslvm”) matches: This is the first column in /etc/crypttab, to compare the UUIDs use blkid /dev/sdX. If the name did not match the easyiest way is to reboot and to start over using the right name, otherwise unmount all previously mounted devices and call cryptsetup now with argument luksClose
  • call update-initramfs -u -k all
  • Reboot and pray 😉
Advertisements
This entry was posted in Linux. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s