Skip to content

Instantly share code, notes, and snippets.

@winderickxeli
Forked from uglide/chroot.sh
Created May 20, 2024 05:10
Show Gist options
  • Save winderickxeli/2d58a09a745a82f9e41fdee0375504b6 to your computer and use it in GitHub Desktop.
Save winderickxeli/2d58a09a745a82f9e41fdee0375504b6 to your computer and use it in GitHub Desktop.
Chroot to Installed system on LVM
#!/bin/bash
fdisk -lu
pvscan
vgscan
vgchange -a y
lvscan
mount /dev/ubuntu-vg/root /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mount /dev/sda2 /mnt/boot
mkdir /mnt/boot/efi || true
mount /dev/sda1 /mnt/boot/efi
chroot /mnt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment