[plug] Dumb stuff recovery
Juneidy
j at awesomest.me
Mon Aug 26 08:27:33 AWST 2024
I have been using borg to back-up some directory, but never really done a full system backup.
Done some full system clone to migrate between drive with the command here: https://wiki.archlinux.org/title/Rsync#File_system_cloning
But I always done it by attaching the source and target drive from another system or booting installation image.
One thing I am curious though, does that actually work for source OS that is currently running? Is there any caveat?
Regards,
Juneidy
On Monday, August 26th, 2024 at 08:16, Brad Campbell <brad at fnarfbargle.com> wrote:
>
>
> I learned something new today.
>
> 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 :
>
> rsync -avxH --delete /root/ /
>
> What I should have typed was rsync -avxH --delete root/ /
>
> So I wiped out the entire root filesystem excepting the root directory.
> That left me with a running root shell and nothing else. All commands were gone. Unless it was a bash builtin I was stuffed.
>
> I never knew you could run the dynamic loader as an executable.
>
> /server/root/lib/x86_64-linux-gnu/ld-2.31.so --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/ /
>
> And I was back in business. Bad day when you don't learn something!
>
> 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.
>
> Regards,
> Brad
> _______________________________________________
> PLUG discussion list: plug at plug.org.au
> http://lists.plug.org.au/mailman/listinfo/plug
> Committee e-mail: committee at plug.org.au
> PLUG Membership: http://www.plug.org.au/membership
More information about the plug
mailing list