Skip to content

Instantly share code, notes, and snippets.

@cho2
Forked from uglide/chroot.sh
Created February 15, 2019 07:11
Show Gist options
  • Save cho2/376480728f6087b03a054b320ed6106d to your computer and use it in GitHub Desktop.
Save cho2/376480728f6087b03a054b320ed6106d 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