Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # Enter chroot
- cryptsetup luksOpen /dev/nvme0n1p5 system
- mkdir -p /mnt/root
- mount /dev/mapper/system-root /mnt/root
- mount /dev/mapper/system-boot /mnt/root/boot
- mount /dev/mapper/system-home /mnt/root/home
- mount /dev/nvme0n1p2 /mnt/root/boot/efi
- mount --bind /dev /mnt/root/dev
- mount --bind /run /mnt/root/run
- chroot /mnt/root
- # Setup once in chroot
- mount --types=proc proc /proc
- mount --types=sysfs sys /sys
- # Do what you need
- refreshgrub
- # Exit and cleanup
- exit
- umount -R /mnt/root
- vgchange -an system
- cryptsetup luksClose system
Add Comment
Please, Sign In to add comment