Skip to content

Instantly share code, notes, and snippets.

@uglide
Last active November 18, 2024 19:44
Show Gist options
  • Save uglide/5f6f23903dac6b5f2567 to your computer and use it in GitHub Desktop.
Save uglide/5f6f23903dac6b5f2567 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
@ceramicheights
Copy link

Thank you so much!! This is a lifesaver.

@cybernet
Copy link

cheers

@omkarbolake94
Copy link

omkarbolake94 commented Jun 4, 2023

Hi
I have separate boot disk. How to resolve that

@balter-io
Copy link

This saves me nuking my install. Legendary, thank you!

@m33x
Copy link

m33x commented May 24, 2024

For ubuntu you need mount --rbind. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment