chroot
chroot
run commands, edit files, install or remove packages
… or a kernel, why not:
mount disk to rescue system, provide network
well, you need some kind of system to mount the other hard drive, most cloud / server provider do provide something
mount /dev/sda1 /mntwith btrfs, do this:
mount -o subvol=@ /dev/md0 /mntbind mount filesystems
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mount --bind /run /mnt/runchroot into your original system
get in there!
chroot /mntnow you can run your commands, edit files and do things like you’d do on your regular system. like removing a package:
apt-get purge linux-1234afterwards, log out, umount the mounted things from above in reverse order and reboot.