Saturday, April 18, 2026

Using chroot to recover a broken Linux system from a USB liveboot

If you want to install or operate a Linux system that won't boot properly you can start the system from a USB and then change root access from the USB system over to the broken system.  It's a bit fiddly, but here's a convenient and quick method all in one line of bash:

sudo mount /dev/mapper/vgmint-root /mnt && for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done && sudo chroot /mnt

This mounts the root drive on the main system, then mounts the main system's various main system directories  (dev, dev/pts, proc, sys, run) and then changes root to the main system's mnt directory.

 

At that point, your command line is talking to the main computer.  Commands are executed on the main machine, not the USB.

 

Presuppositions: Linux Mint with an encrypted SSD drive mounted at /dev/nvme0n1 

 

Note:

nvme<number>n<namespace>  

NVMe (Non-Volatile Memory Express) is a high-performance storage access protocol for solid-state drives (SSDs) that uses the PCIe bus, rather than slower SATA interfaces, to achieve superior speeds, low latency, and high parallelism (up to

queues). It connects directly to the CPU to dramatically improve throughput.