There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

bss03 ,

I’ve never gotten pivot_root to work well / as documented. Major props for being able to pull this off. Hopefully you didn’t have much time where a connection-drop would require a reboot. SSH in the new root on an alternate port before the pivot? idk.

gaylord_fartmaster ,

I did this once to install a different distro on a free oracle VPS lol

tomkatt ,

Give me more of this and less of the politics. This is what I come to Lemmy for.

aMockTie ,

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

cm0002 OP ,

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

aMockTie ,

Sure, I suppose as long as sshd is up and running in the ramdisk environment (which you mentioned in another comment, along with all other services) you could always reconnect. Very neat and clever!

exu ,

You could use screen or tmux for a persistent terminal session.

aMockTie ,

True, but I was more thinking about the issue of reconnecting in general when you just nuked sshd.

Prunebutt , (edited )

Impressive, sounds like magic, tbh! You know any tutorials?

cm0002 OP ,

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
exu ,

How exactly so you pivot root? Simply chroot or something more involved?

cm0002 OP ,

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

4am ,

This is god-tier technique, kudos

barkingspiders ,

I work in this field and I think this is 🔥 af

A_cook_not_a_chef ,

Yeah, I’d love to see a write up on this to follow.Sounds like useful practice in the lab if nothing else.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines