The chroot Technique - a Swiss army multitool for Linux systems April 8, 2025 Ever ran into a Linux box that just won’t boot, even after making sure that BIOS settings are OK and that no major hardware errors are at hand? Then you need to know about the chroot technique, which can be a real life saver. For example, I managed to repair a Nanopore GridION device this way the other week, after the official method of re-installing it via an .iso file failed, which reminded me to make the effort of documenting these steps. I came across the technique only after having used Linux as my daily driver for more than a decade (thanks Matt !), which means I think it is worthy of much more attention, given its usefulness. Thus I’m hoping to spread the word a bit through this post. TLDR In short, the idea is that if you can access the hard drive of a broken or non-bootable Linux machine (this could be done e.g. by booting from a Live USB-stick, or plugging in the hard-drive as an extra drive in another Linux machine), you will mount this hard drive in a way that you trick your current Linux session that this is the harddrive of the currently running system, which it is not of course. The trick to get this to work is to create a file tree based on two things: The hard drive partition of the broken system that was mounted as the / folder on the host operating system. A set of special system folders from the currently running, temporary, operating system (the live stick or replacement computer), which are not normal directories on the disk, but rather are containing system information needed by the running linux system. These include /sys, /proc and a few others, which we will go into details about below. Then what you do is that you run the chroot command on this newly assembled folder structure, meaning that your currently running linux session will replace its current file system with this new blend of folders, mostly from the old, broken, hard drive. It is a bit like hooking up ...
First seen: 2025-04-09 14:35
Last seen: 2025-04-10 13:44