Last Saturday, I switched the power off a bit too early, before the system completely shut down. I knew it was wrong but it's done and I got sidetracked with stuff. The next day, I couldn't log in—it gave me beach ball right after I entered my login.
Tried fsck, safe mode, recovery mode, no luck.
Feels like banging my head. |
Good thing I have a MacBook Pro. I took out the SSD from the PC, and put it inside my laptop as secondary disk. Darn, Disk Utility couldn't help.
I had to start fresh. To my disappointment, many files, especially recently (1-2 weeks) accessed files, were corrupted. Unfortunately, those were the source code for Sarah Shopper, the Lazada price tracker I've been working on.
I did use Git, but I have a habit of not pushing to server until the commit is tidy. Since I tend to work on multiple projects at the same time, I can leave them "unpushed" for a while. For Sarah Shopper, it's two months. Ouch.
I also ran a backup software, but it was not configured properly (I procrastinated). Ouch. Good thing Dropbox was working, but I didn't put my code inside it (since I use Git). Ouch again.
Anyway, I managed to "restore" my hackintosh. Here's what I did:
- Salvaged anything I could. Apparently, if you copy a folder with any corrupted file inside, the whole copy process stops, leaving the destination in limbo. Strangely, if I select all the files in the folder and copy them, it works and it will ignore corrupted files. So, I did that, recursively.
- After everything was copied, I reformatted the SSD and put it back inside my PC.
- Reinstalled the hackintosh. I usually use tonymacx86, but I couldn't find the exact page inside the 1st page of search result, so I tried a different method. After a few failures, I gave up and used tonymacx86's method. Worked flawlessly.
- After the OS was installed, I had to download, install and configure apps. Office, dev tools, etc.
- Setup backup. This time I include my code.
About backup
I use Arq backup software. Now, I backup my home folder with these subfolders excluded:- Dropbox, OneDrive, etc, because they can just resync
- Downloads, because this is just for "transit" items
- Some folders inside Library
- Cache folders, e.g. .m2/repository folder for Maven cache
About source code
Now I use myrepos, a small command line utility so I don't need to "cd" and "git status" to dozens of my projects one by one.It took me three days to do everything. Configuration-wise, it's done, but now I need to rewrite the missing code for Sarah Shopper, the Lazada price tracker.