Linux Rescue System hints

Some hints on things only needed in rescue situations, i.e. easily forgotten between emergencies.

A lot of these got easier over the years, but under stress ...

Changing keyboard layout

Example for German (.de):

loadkeys de

Assembling Software RAID devices

mdadm --assemble --scan

Accessing LVM volumes

# evtl. decryot
cryptsetup luksOpen /dev/nvme0n1p3 hd_crypted


# find
vgscan

# activate
vgchange -ay

# list 
lvdisplay
 
# mount something
mount /dev/volumegroup/logicalvolume /mountpoint

Re-creating VGs & LVMs on new disks

fdisk /dev/sda
 
# do not forget to make one partition bootable
 
vgcreate vg1 /dev/sdaX
 
lvcreate -L 10G -n root vg1
 
mkfs /dev/vg1/root
 
# mount ... 
 
# restore data
 
# update fstab (UUIDs...)
 
#install-mbr /dev/sda
 
#install-grub /dev/sda /dev/sda1
# or:
#dpkg-reconfigure grub-pc
 
# ask the FSM to divert Murphy with pasta
# reboot