A tool to chroot on an LVM system in ONE command.
curl -fsSLO https://github.com/deltreey/chroot-lvm/releases/latest/download/chroot-lvm
curl -fsSLO https://github.com/deltreey/chroot-lvm/releases/latest/download/chroot-lvm.sha256
sha256sum -c chroot-lvm.sha256
sudo mv chroot-lvm /usr/local/sbin/chroot-lvm
sudo chmod +x /usr/local/sbin/chroot-lvmGenerally, I don't really want to install something like this, but use it in an emergency. Here's how you can pull and run it in one line.
curl -fsSLO https://github.com/deltreey/chroot-lvm/releases/latest/download/chroot-lvm \
&& sudo bash chroot-lvm <filesystem, e.g. /dev/ubuntu-vg/ubuntu-lv>curl -fsSLO https://github.com/deltreey/chroot-lvm/releases/latest/download/chroot-lvm && sudo bash chroot-lvm /dev/ubuntu-vg/ubuntu-lv
ls /home # just to verify the username
passwd admin # then type a new password since I forgot it
exitIt's a multistep process to chroot on an LVM system. See this gist.
When I needed to rescue computer recently, I realized that the steps were somewhat arbitrary, and it would be nice to abstract it to a simpler command (akin to the way things were done before LVM). So I did that, here.
Packaging notes: this is a single-file script with no external runtime dependencies beyond
bash,mount, andlvm2.