<div dir="auto">Nice recovery!<div dir="auto"><br></div><div dir="auto">I remember when I managed to trash a raw disk image of a prod server (VM) on a KVM hypervisor host, which I managed to recover by performing a dd from <i>inside</i> the running VM back to the hypervisor host over SSH which would not have been possible if the VM was shut down after the disk image deletion as that would have synchronised the hosts filesystem and all hope would have been lost especially since there was no backup.</div><div dir="auto"><br></div><div dir="auto">I may have blogged an article on my historical blunder and recovery...</div><div dir="auto"><br></div><div dir="auto">Thanks for sharing this little nugget.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 26 Aug 2024, 08:16 Brad Campbell, <<a href="mailto:brad@fnarfbargle.com">brad@fnarfbargle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I learned something new today.<br>
<br>
I have a duplicate test server here I use to stage and script all updates on the prod machine. I had just done a major OS update and was getting ready to tweak the package manager. Before I did that I thought I'll backup the root fs entirely. I did that using rsync to a mounted RAID6 on /server. I performed a few tweaks and wanted to undo them, so I cd to the backup directory and ran this :<br>
<br>
rsync -avxH --delete /root/ /<br>
<br>
What I should have typed was rsync -avxH --delete root/ /<br>
<br>
So I wiped out the entire root filesystem excepting the root directory.<br>
That left me with a running root shell and nothing else. All commands were gone. Unless it was a bash builtin I was stuffed.<br>
<br>
I never knew you could run the dynamic loader as an executable.<br>
<br>
/server/root/lib/x86_64-linux-gnu/<a href="http://ld-2.31.so" rel="noreferrer noreferrer" target="_blank">ld-2.31.so</a> --library-path /server/root/usr/lib:/server/root/usr/lib/x86_64-linux-gnu:/server/root/lib/x86_64-linux-gnu/ /server/root/usr/bin/rsync -avxH --delete /server/root/ /<br>
<br>
And I was back in business. Bad day when you don't learn something!<br>
<br>
Thankfully bash completion still worked, although I still had the fs skeleton on the prod server to refer to for directory names just in case.<br>
<br>
Regards,<br>
Brad<br>
_______________________________________________<br>
PLUG discussion list: <a href="mailto:plug@plug.org.au" target="_blank" rel="noreferrer">plug@plug.org.au</a><br>
<a href="http://lists.plug.org.au/mailman/listinfo/plug" rel="noreferrer noreferrer" target="_blank">http://lists.plug.org.au/mailman/listinfo/plug</a><br>
Committee e-mail: <a href="mailto:committee@plug.org.au" target="_blank" rel="noreferrer">committee@plug.org.au</a><br>
PLUG Membership: <a href="http://www.plug.org.au/membership" rel="noreferrer noreferrer" target="_blank">http://www.plug.org.au/membership</a><br>
</blockquote></div>