Skip to content

Instantly share code, notes, and snippets.

@oyagci
Forked from uglide/chroot.sh
Created August 7, 2018 07:15
Show Gist options
  • Save oyagci/b5d9fd882c537d2fcc9b566811a0b80c to your computer and use it in GitHub Desktop.
Save oyagci/b5d9fd882c537d2fcc9b566811a0b80c 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