It was also actually pretty fun!
Give me more of this and less of the politics. This is what I come to Lemmy for.
Weird
No, you
I also vote for a writeup. This sounds awesome!
@cm0002
I need that!Is there a tutorial for that? I have an Old outdated Synology nas that I wish to replace the system with an Open Media Vault.
What happens if the SSH session closes before dd finishes? Sounds pretty badass but I don’t think I would trust this approach in prod lol
Well the 1 SSH session bit was for dramatic meme-effect lol, you can actually connect back without issue (at least it did for me) so worst case if you weren’t working in tmux you’d just have to start dd again
Worst worst case, you’d just end up back where you were probably heading before anyways, KVM/IPMI
Impressive, sounds like magic, tbh! You know any tutorials?
Not really, I pulled it together from a bunch of random posts lol
Maybe I should write one, but in essence you:
-
Stop all non-OS essential services
-
Create a filesystem in a chunk of RAM
-
Pull essential OS files from the installed OS into it recreating needed directories (Though you could probably just use a tiny pre-built distro but meh)
-
Pivot root into it
-
Reload services (when they restart they’ll be restarted in the context of where you pivot rooted, prior they’re still running under the context of the installed OS)
-
Unmount the boot drive
-
Then do what ever you need to do
-
???
-
Profit
Imagining this process, despite having never done 50% of the steps on the list, makes my brain imagine this:
How exactly so you pivot root? Simply chroot or something more involved?
chroot isn’t enough, you need “real” pivot_root
chroot just changes the shells root point, pivot_root actually changes the root mount point and enables this trick to work
This is god-tier technique, kudos
Holy fuck
-
Yeah, I’d love to see a write up on this to follow.Sounds like useful practice in the lab if nothing else.