Skip to content

Instantly share code, notes, and snippets.

@nnfuzzy
Created April 9, 2017 07:37
Show Gist options
  • Save nnfuzzy/6315c250c84f43f7c78ca0fb58d7d837 to your computer and use it in GitHub Desktop.
Save nnfuzzy/6315c250c84f43f7c78ca0fb58d7d837 to your computer and use it in GitHub Desktop.
Get chroot access with a ubuntu livecd in an encrypted volume + internet (resolv.conf)!
#!/bin/bash
#Get chroot access with a ubuntu livecd in an encrypted volume + internet (resolv.conf)!
sudo modprobe dm-crypt
sudo fdisk -l
sudo cryptsetup luksOpen /dev/sda3 myvol
sudo vgscan
sudo vgchange -ay ubuntu-mate-vg
sudo lvs
sudo mount /dev/ubuntu-mate-vg/root /mnt/
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo mount --bind /etc/resolv.conf /mnt/etc/resolv.conf
sudo chroot /mnt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment