User Tools

Site Tools


linux:crash_recovery

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
linux:crash_recovery [2015/12/02 16:58]
tkilla
linux:crash_recovery [2022/07/10 02:03]
tkilla
Line 51: Line 51:
  
 After restore, click "netboot" in webmanager again and reset it to "harddisc" After restore, click "netboot" in webmanager again and reset it to "harddisc"
 +
 +
 +
 +===== Full Disc Encrypted System Rescue =====
 +
 +If the system does not boot anymore, **you can open the encrypted device anyway with a live system** on USB stick or CD. 
 +
 +  # find the correct partitions:
 +  fdisk -l 
 +  
 +  # open the container 
 +  # "sdb5_crypt" is just an example. **Check what's written in /etc/crypttab - the names must match!**
 +  cryptsetup luksOpen /dev/sdXY sdXY_sdb5_crypt
 +  
 +  # activate the LVM volume group (if you use LVM2):
 +  vgchange -ay
 +  
 +  # find new volume groups in /dev/mapper/ and mount them (maybe it's just root or home, var, ...might be in, too):
 +  mount /dev/mapper/ubuntu--vg-root /mnt
 +  
 +  # mount the unencrypted boot parti:
 +  mount /dev/sdXZ /mnt/boot
 +  
 +  # bind mount some important dirs:
 +  mount -t proc proc /mnt/proc
 +  mount -o bind /dev /mnt/dev
 +  mount -t sysfs none /mnt/sys
 +
 +
 +Now you can take your data back already.
 +
 +To repair what is broken, you probably need to change root into that system:
 +
 +  chroot /mnt
 +
 +All following commands are executed inside the broken system. Some hints for repairs:
 +
 +  apt install lvm2 cryptsetup-initramfs    # debian uninstalled lvm during an upgrade :(
 +
 +If your root system is BTRFS, you need btrfs-progs and the kernel module during the early initramfs boot stage:
 +
 +  apt install btrfs-progs
 +
 +
 +Add a missing module to initramfs - inside the chroot:
 +
 +  mcedit /etc/initramfs-tools/modules
 +
 +
 +Write one module name like "btrfs" per line.
 +
 +Then regenerate the initramfs for all installed kernels:
 +
 +  update-initramfs -u -k all
 +
 +
 +Also check the UUID entries in /etc/crypttab compared to ls -la /dev/disk/by-uuid/
 +
 +
 +TbC..  There may be various other reasons for bootproblems...
 +
 +
 +
 +== Links: ==
 +
 +  * really helpul! https://feeding.cloud.geek.nz/posts/recovering-from-unbootable-ubuntu-encrypted-lvm-root-partition/
 +  * various other hints https://askubuntu.com/questions/567730/gave-up-waiting-for-root-device-ubuntu-vg-root-doesnt-exist#567897
 +
 +
 +
  
linux/crash_recovery.txt ยท Last modified: 2022/07/10 02:07 by tkilla