Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot
61–70 of 80 posts
Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot
#62For anyone interested in adding this to their toolkit, I would suggest reading this StackOverflow answer: http://unix.stackexchange.com/a/227318/189858 In short, the answer details how to switch your running system to use an in-memory only root filesystem, without restarting. This allows installing a new OS, resizing the OS disks, etc. It's a risky operation, but the linked answer covers many pitfalls that you might…
I've been using this procedure to remotely replace operating systems for years. The most common scenario is a VPS provider that doesn't give you the choice of OS you want. Infact, I will be using it later today, to replace a Debian system with Gentoo, no less. The README in OPs link is spot-on here (the last few paragraphs).
Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot
#63Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot
#64For anyone interested in adding this to their toolkit, I would suggest reading this StackOverflow answer: http://unix.stackexchange.com/a/227318/189858 In short, the answer details how to switch your running system to use an in-memory only root filesystem, without restarting. This allows installing a new OS, resizing the OS disks, etc. It's a risky operation, but the linked answer covers many pitfalls that you might…
Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot
#65Seeing if I understand what this is doing: this keeps running the same Linux kernel and kernel modules, but swaps out absolutely everything else up to and including the init system - is that right?
More precisely, what it does is start a new init system on a pseudofilesystem, starts an sshd chrooted to that new system, and lets you then login there, where you can then, if you want, umount the original root fs, wipe it, install a new os, then reboot the system.
Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot
#66Pretty cool, although I'm pretty sure I would never use something like this. What has saved my skin on a number of occasions is the ability to boot remote servers into rescue mode and chroot into the broken system. That way you can use package managers, all your diagnostic tools, and everything else the boot image doesn't provide. Basically you just mount the different partitions and then chroot just swaps /proc /sys…
On our Linux installations we have separated most of the directories into different LVM partitions. Such as '/home', '/usr', '/var' and of course '/' (the root). Just last week I helped a user live boot his system and ran a fsck on his '/home' partition. We had "frozen" the system and hard reset his computer which led to a couple of corrupt blocks and inodes.
Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot
#67* use btrfs, and create your main root filesystem as a btrfs partition subvolume and another btrfs subvolume for snapshots (also a sub of master btrfs partition)
* to start any experiment (e.g. installing whole gnome and 500 different packages you MIGHT WANT TO REVERT in the future) create before the risky operation snapshot (btrfs subvolume snapshot / /.snapshots/yournameofsnap) of current filesystem
* experiment in any way :)
* switch between old root (snapshot you created) or the new one with (btrfs subvoulme set-default)
* delete any of them (btrfs subvolume delete)
btrfs copy-on-write allows all of these commands to happen instantly without (almost) any actual copying. Also booting from both volumes is possible without any additional steps as long as master btrfs partition is the one to be booted from UEFI.
Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot
#68Earlier quoted context omitted.
Haha yes, this is the default install procedure for Gentoo! :D
It's funny, I knew how to do that when I borked my systems back in 2004 only because the Gentoo installation instructions were like that.
Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot
#69Earlier quoted context omitted.
Pretty sure the conflation has been around ever since rocket science and brain surgery have been used as a comparison. :)
I don't tend to link youtube videos on HN, particularly of the comedic type, but I'm just going to leave this here for anyone who wants a good laugh for their morning. https://www.youtube.com/watch?v=THNPmhBl-8I
Re: Takeover.sh – Wipe and reinstall a running Linux system via SSH without reboot
#70Another nice trick of this family (with reboots, or without with using systemd-nspawn) lies with clever btrfs usage. Long story short: * use btrfs, and create your main root filesystem as a btrfs partition subvolume and another btrfs subvolume for snapshots (also a sub of master btrfs partition) * to start any experiment (e.g. installing whole gnome and 500 different packages you MIGHT WANT TO REVERT in the future) c…