summaryrefslogtreecommitdiffhomepage
path: root/tech/cheatsheet.mdwn
blob: 28c3cecfbcd6f56a6d15df29eb66ab6175f09752 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Debian sysadmin

## Chrooting into an offline EFI-on-LVM-on-LUKS system

It's the LVM part that I don't seem to be able to memorise.

1. `cryptsetup luksOpen /dev/sda2`
2. `vgscan`
3. `vgchange`
4. `mkdir /target`
5. `mount /dev/vg-foo/lv-bar /target`
6. `mount /dev/sda1 /target/boot/efi`
7. `for i in /sys /proc /dev /run; do mount --rbind $i /target$i; done`
8. `chroot /target /bin/bash`

## Restoring contents of /boot/efi

`grub-install --target=x86_64-efi`

My ThinkPad x220 additionally needs `--force-extra-removable`.