💾 Archived View for jacksonchen666.com › posts › 2023-06-12 › 13-32-03 › index.gmi captured on 2024-05-26 at 14:56:07. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-11-04)
-=-=-=-=-=-=-
2023-06-12 11:32:03Z (last updated 2023-10-16 08:55:03Z)
Recently on 2023-06-09T17:45+02:00, I noticed something wrong with my external drive: I couldn't mount it.
Long story short (2023-06-09T18:06+02:00): I lost all my data on my external drive due to some "unrepairable" corruption according to first aid on macOS (basically fsck).
So, now what?
Well, I had a complete time machine backup before I lost my stuff.
In between the time of last backup of my external drive to noticed corruption, I did not even touch my drive.
However, I have never only restored a part of my complete backup (which includes stuff on my macOS system and my external drive).
So, now I am entering "untested backups territory"
I check my backups, I have stuff for the external drive. So I'm good here for having my backups.
macOS time machine backups automatically delete old backups.
Even though my backup is recent, I won't trust it because I only had a single copy of my data left.
So I turned off automatic backups, and just... started restoring the files.
So I need to format it so I can have a filesystem to write my files to.
Here's some commands I used:
diskutil list diskutil apfs deleteContainer diskutil apfs encrypt diskutil apfs setpassphrasehint
The result is a reformatted APFS container that's also encrypted, right from the command line. Nice.
Now to restore my files. Except how?
Of course as I already mentioned, rsync.
But before that, where is the backup?
Well, I just found snapshots by opening up my backup drive in finder, then dragged a snapshot into my terminal to get the path. I then entered the directory.
Here was the command that I used:
rsync --info=progress2 --progress --no-inc-recursive -a --append -S -H -U -N -X -progress -vv -x .Trash-501/ */ /Volumes/Jackson/
The info argument specifies to show the progress for the *entire transfer* that will happen. `--no-inc-recursive` makes rsync build the file list before starting so it can properly count.
I leave it over night, all files counted and 60% of the transfer done... at the cost of having a completely unstructured file structure and some missing files.
So I decided to restart with another command:
sudo rsync --info=progress2 --progress --no-inc-recursive --super -a --append -S -H -U -N -X -progress -vv -x . /Volumes/Jackson/
That restores a lot of information and metadata, while also keeping stuff that gets permission denied (got a few of that)
Now, I just have to wait patiently for this to complete... (As of 2023-06-12T23:27:00+02:00, it's done!)
Get a backup of your files. You're not getting them back magically through any means other than having another copy (not so expensive) or doing data recovery (quite expensive).
Back up your iPhone. Back up your Android phone. Back up your phone, your computer, your laptop, your desktop, your external drives, everything.
Things break, and the only way to not lose the files contained on those storage devices is to make a back up of it, a complete separate copy on a different hard drive/SSD.