It was also actually pretty fun!
Give me more of this and less of the politics. This is what I come to Lemmy for.
Hopefully you don’t lose power or something else bad happens or there goes your data
Impressive, sounds like magic, tbh! You know any tutorials?
Yeah, I’d love to see a write up on this to follow.Sounds like useful practice in the lab if nothing else.
i experimented with this some time ago, see my post here: https://lemmy.ml/post/18706002/12772832
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
The man page has a good example.
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
I have never gotten it to work. It always implodes
read this over on Linux community a few days ago