Technology

Recovering Files with Runtime Software’s GetDataBack

I like to think I am fairly decent at data recovery, or I used to be, though I have not really had a need in more recent times, and being “fairly decent” is mostly, “Knowing where to find what tools to use.” It’s not like I am out here replacing drive power boards or, I don’t know, manually laser imaging disc platters or something. I used to use a piece of software called R-Studio. I am not sure it even really exists anymore. Whatever the case, the key I have for that is from a version from the mid-2000s.

It’s… Like 20 years old…

Fuck I am old.

….

Anyway, my experience with R-Studio was pretty great, I mostly used it in my old office IT job. We bought a copy when one night the automation system we used to run the TV station had a drive failure. Reprogramming it would have been a bitch (but doable). I pulled the PC out, we thought about our options and went with this data recovery route. The drive was able to be reimaged onto a good drive and the system was up and running again.

Yay.

Over the years I used it pretty regularly to recover crashed laptops from coworkers. Generally just the Documents and PST files in those cases though. It was also useful for my own drives and drives of people I knew.

The years, however, made me a bit jaded about being IT Support for everyone I had ever met. There are quite a few jokes about this around online, and it’s true. These days, I basically will just “play dumb” because if you fix one problem for one neighbor, now you will be fixing everyone’s PC issues.

And let me tell you, that is often self-inflicted on what those issues are, which is worse than dealing with real technical problems. Sorry I can’t recover your Pentium, no I can’t make it run Facebook Faster, it’s just too old.

Anyway, at one point I lost some family photos when an external drive crashed on me. This caused two things to happen. One, I will never ever buy a USB drive again, or at least not trust them with important data. I am talking about things like those Seagate drives that have a TB or more that plug into the wall and your PC. It doesn’t help that they also are designed in a way that the plastic housing can’t be removed easily and often requires DESTROYING the housing to recover them. Two, it caused me to get serious about backup, and the cloud. I have used a few different services over the years, but for a long time, I have been at the point where my entire house could burn to the ground and my data would be safe and recoverable.

I have a cloud-synced backup with some versioning and the whole “recycle bin” option in One Drive and I keep an incremental backup on a hard drive in a static bag in a fire safe in the house. Plus all the data is in a RAID on my NAS.

But I don’t back up EVERYTHING. That would be too much data because I am a bit of a data hoarder. And a lot of the non-essential stuff gets stored on an assortment of “dodgy drives” that I have collected over the years from a variety of places. For example, I am currently using my previous “Degraded per Synology” NAS drive as a base to build a PLEX server. I mean, it didn’t technically fail, Synology just didn’t like it, and so I replaced it in the NAS, and now it’s a 4TB drive that, is probably mostly still sort of good.

Anyway, I had one of those USB drives that I mentioned above as having sworn off that was previously working for this task. My wife goes to a LOT of estate sales as part of her business and I often tag along. At one I found this drive stuck buried on a bookshelf, so I bought it for like $5. I figured it was probably good, and it worked, for a bit. But as they usually seem to do, this sucker decided to die on me.

I tried to see if I could get it to read with some Linux tools, but I had little luck. I went online looking for data recovery tools and remembered using straight search is a bad idea for this because it’s going to be 99% “articles” from companies recommending their own software. So I went to Reddit, and had GetDataBack suggested.

I downloaded it and it managed to detect the drive and files. I decided to bite the bullet and paid for the full version, which is not cheap at $80, but I have some other drives I could run through this and it’s a “lifetime license” so I will eventually feel like I am getting my money’s worth.

And it’s working just great. The only real problem I am having is that it won’t recover to a network drive and my PC’s internal drive does not have 2TB of space on it, so I have to recover things in chunks, then copy it over to its final storage place. Well, that and the normal issues that come with a failed/failing drive where sometimes things get hung up and just don’t recover. The interface is straightforward and nice as well, though not super pretty.

Like I said, I am sure I will get my money’s worth. I have a drive that was my brother’s somewhere that I can try to recover. I also have some NVME drives that I will need to get a USB hook up for, but I wouldn’t mind trying to get data back off of those.

Dead Memory Cards and Using Docker

More often that it feels like it should, something in technology breaks or fails. I find that this can be frustrating, but often ultimately good, especially for learning something new, and forcing myself to clean up something I’ve been meaning to clean up. I have a Raspberry Pi I’ve been using for a while for several things as a little web server. It’s been running probably for years, but something gave out on it. I’m not entirely sure it’s the SD card or the Pi itself honestly, because I’ve been having a bit of trouble trying to recover through both. It’s sort of pushed me to try a different approach a bit.

But first I needed a new SD card. I have quite a few, most are “in use”. I say “in use” because many are less in use and more, underused. This has resulted in doing a bit of rebuild on some other projects to make better use of my Micro SD cards. The starting point was a 8 GB card with just a basic Raspbian set up on it.

So, for starters, I found that the one I have in my recently set up music station Raspberry Pi is a whopping 128gb. Contrary to what one might thing, I don’t need a 128gb card in my music station, the music is stored on the NAS over the network. It also has some old residual projects on it that should really be cleaned out.

So stuck the 8GB card in that device and did the minor set up needed for the music station. Specifically, configure VLC for Remote Control over the network, then add the network share. Once I plugged it back into my little mixer and verified I could remote play music, I moved on.

This ended up being an unrelated side project though, because I had been planning on getting a large, speedy, Micro SD card to stick in my Retroid Pocket. So I stuck that 128GB card in, the Retroid and formatted it. This freed up a smaller, 32GB card.

I also have a 64GB that is basically not being used in my PiGrrl Project I decided to recover back for use. The project was fun, but the Retroid does the same thing 1000x better. So now it’s mostly just a display piece on a shelf. Literally an overpriced paperweight. I don’t want to lose the PiGrrl configuration though, because it’s been programmed up to work with the small display and IO Control Inputs. So I imaged that card off.

In the end though, I didn’t end up needing those Micro SD cards though, I opted for an alternative option to replace the Pi, with Docker on my secondary PC. I’ve been meaning to better learn Docker, though I still find it to be a weird and obtuse bit of software. There are a handful of things I care about restoring that I used the Pi for.

  • Youtube DL – There seem to be quite a few nice Web Interfaces for this that will work much better than my old custom system.
  • WordPress Blog Archives – I have exported data files from this but I would like to have it as a WordPress Instance again
  • FreshRSS – My RSS Reader. I already miss my daily news feeds.

YoutubeDL was simple, they provided a nice basic command sequence to get things working.

The others were a bit trickier. Because the old set up died unexpectedly, The data isn’t easily exported for import, which means digging out and recovering off of the raw database files. This isn’t the first time this has happened, but its a lot bigger pain, which isn’t helped by not being entirely confident in how to manipulate Docker.

I still have not gotten the WordPress archive working actually. I was getting “Connection Reset” errors and now I am getting “Cannot establish Database connection” issues. It may be for nothing after the troubles I have had dealing with recovering FreshRSS.

I have gotten FreshRSS fixed though. Getting it running in Docker was easy peasy. Getting my data back, was… considerably less so. It’s been plaguing me now when I try to fix it for a few weeks now, but I have a solution. It’s not the BEST solution, but it’s… a solution. So, the core thing I needed were the feeds themselves. Lesson learned I suppose, but I’m going to find a way to automate a regular dump of the feeds once everything is reloaded. I don’t need or care about favorited articles or the articles contents. These were stored in a MySQL database. MySQL, specifically seems to be what was corrupted and crashed out on the old Pi/Instance because I get a failed message on boot and i can’t get it to reinstall or load anymore.

Well, more, I am pretty sure the root cause is the SD card died, but it affected the DB files.

My struggle now, is recovering data from these raw files. I’ve actually done this before on a surver crash years ago, but this round has lead to many many hurdles. One, 90% of the results looking up how to do it are littered with unhelpful replies about using a proper SQL dump instead. If I could open MySQL, I sure as hell would so that. Another issue seems to be that the SQL server running on the Pi was woefully out of date, so there have been file compatibility problems.

There is also the issue that the data may just flat out BE CORRUPTED.

So I’ve spun up and tried to manually move the data to probably a dozen instances of MySQL and MariaDB of various versions, on Pis, in Docker, on WSL, in a Linux install. Nothing, and I mean NOTHING has worked.

I did get the raw data pulled out though.

So I’ve been brute forcing a fix. Opening the .ibd file in a text editor gives a really ugly chuck of funny characters. But, strewn throughout this, is a bunch of URLs for feeds and websites and well, mostly that. i did an open “Replace” in Notepad++ that stripped out a lot of the characters. Then I opened up Pycharm, I did a find and replace with blanks on a ton of other ugly characters. Then I write up this wuick and dirty Python Script:

# Control F in Notepad++, replace, extended mode "\x00"
# Replace "   " with " "
# replace "https:" with " https:"
# rename to fresh.txt

## Debug and skip asking each time
file = "fresh.txt"
## Open and read the Log File supploed
with open(file, encoding="UTF-8") as logfile:
    log = logfile.read()

datasplit = log.split(" ")
links = []

for each in datasplit:
    if "http" in each:
        links.append(each)

with open("output.txt", mode="w", encoding="UTF-8") as writefile:
    for i in links:
        writefile.write(i+"\n")

Which splits everything up into an array, and skims through the array for anything with “http” in it, to pull out anything that is a URL. This has left me with a text file that is full of duplicates and has regular URLs next to Feed URLS, though not in EVERY case because that would be too damn easy. I could probably add a bunch of conditionals to the script to sort out anything with the word “feed” “rss”, “atom” or “xml” and get a lot of the cruft removed, but Fresh RSS does not seem to have a way to bulk import a text list, so I still get to manually cut and paste each URL in and resort everything into categories.

It’s tedious, but it’s mindless, and it will get done.

Afterwards I will need to reset up my WordPress Autoposter script for those little news digests I’ve been sharing that no one cares about.

Slight update, I added some filtering ans sorting to the code:

# Control F in Notepad++, replace, extended mode "\x00"
# Replace "   " with " "
# replace "https:" with " https:"
# rename to fresh.txt


## Debug and skip asking each time
file = "fresh.txt"
## Open and read the Log File supploed
with open(file, encoding="UTF-8") as logfile:
    log = logfile.read()

datasplit = log.split(" ")
links = []

for each in datasplit:
    if "http" in each:
        if "feed" in each or "rss" in each or "default" in each or "atom" in each or "xml" in each:
            if each not in links:
                links.append(each[each.find("http"):])

links.sort()

with open("output.txt", mode="w", encoding="UTF-8") as writefile:
    for i in links:
        writefile.write(i+"\n")

ActivityPub and WordPress

The whole concept of the “Fediverse” and decentralization has been gaining a lot of traction lately, especially with the recent bull shit around Twitter. I’ve had a Mastodon account for a few years and have tried a few times to get into the whole ActivityPub decentralized thing a few times over the year after hearing it discussed on the TWIT Podcast a few times.

With the recent news of Automattic (owners of WordPress) buying the most popular Activity Pub plug in, I’ve decided to give it another go. So I’ve re-enabled the plug in, and actually made a better effort to look into what it means, and it, was, surprisingly pretty simple. I am sure it can do more, but basically, both of my blogs can now be followed on other ActivityPub based Fedi-verse systems. Specifically, the two accounts, for now, are:

@[email protected]

and

@[email protected]

I followed both, basically, the easy way, is to slap one or the other in the search box on Mastodon or a Mastodon app, and they show up like any other account. I checked, and though the post is very long, and the images don’t show properly, sure enough, it shows up in Tusky.

i could see some fun possibilities here, though I don’t know that anyone cares enough to actually follow any of it in the first place. The first I’ll probably try, i have a system that posts blobs of links that I share via Fresh RSS daily (if there is anything to share). These currently just post with me as the author. However, I could easily change this to another user, say, “LinkBot” and give it a separate feed, so @[email protected] could be followed, just for those links.

I could make other sub accounts like this too, maybe I could have one that’s just a feed of random food photos. I could set up something on Lameazoid for toy photos or video games screen shots.

I will add in that the concept is neat, but I also am not sure I really prefer it to just straight RSS. It seems a bit overly complicated when “Really Simple Syndication” is a thing.

SQL Woes

For the most part, managing my web server is pretty straightforward, especially because I don’t really get a ton of traffic. Its mostly just keeping things up to date through standard channels.

Occasionally I have a bit of a brain fart moment. I recently was doing regular Linux updates on the server. I noticed a message I had seen before about some packages being held back. Occasionally I will go through and update these, because I am not real sure why they are being held back, but don’t really see any reason they should be.

Then MySQL broke.

So I went digging in some logs and searching for solutions, and decided I needed to roll back the version. Following a guide I found, I discovered… I had done this before, which I now vaguely remebered. Because the old .deb file was still there from last time I broke it.

Anyway, this didn’t fix it, MySQL still was not launching.

I decided that maybe it was time to just switch to MariaDB, which I believe is the spiritual successor to MySQL. And the process was simple enough, I would not even need to dump my Databases. So I uninstalled MySQL, installed MariaDB and… It worked!

Then it stopped working.

I restarted the SQL service and it worked!

Then it…. Stopped working… Again…

So I checked logs again and corrected some issues there and again it worked, then a half hour or so later it stopped working.

One thing I had come across in troubleshooting the original MySQL issue was that there was a command, mysql_upgrade that needed to be run to change how some tables are configured. I couldn’t do that before because I couldn’t even get MySQL to run. But I could get MariaDB to run at least for a bit, and had successfully gotten this upgrade command to run.

So I decided to, once again, try MySQL again, so I uninstalled MariaDB, and purged everything out, rebooting a few times to be sure. And MySQL would not even install anymore, so more purging, this time, including the Databases.

One thing I was glad I had decided to do, “Just in Case” when MariaDB was “working” was dump the databases out with backups. I was glad I did at this point. So with absolutely everything purged, MySQL installed and was working.

I set about recreating the databases from the dumps, and while I was at it updated all the passwords, since I had to recreate the user accounts used by WordPress anyway.

And now everything is working smoothly again.

A couple of links that were actually helpful in solving my problem.

https://stackoverflow.com/questions/67564215/problems-installing-mysql-on-ubuntu-20-04

https://learnubuntu.com/install-mysql/

Leaving Google, Part 2

I discussed briefly last post, about what’s come up with my GSuite Legacy account. I wanted to mention a few other things that came up, and some additional steps I made. A lot of the other issues were pretty easy to correct. One extremely useful tool in all of this I found, was the Google Dashboard. This lists all of the services used with some generic metrics of how much might be there to look into.

For example, I found I had a few “Saved locations” in Google maps. They ended up being some inconsequential hotels from a trip years ago, but it was good to know so if they were something meaningful, I could resave them to my regular old Google Account.

There is also some useless and even slightly misleading information here. For example Google Cloud Print no longer exists, but it’s still listed. There doesn’t seem to be a way to purge out that data. Youtube lists “112 Purchases”, which isn’t true either, it’s “112 titles synced through my connected Vudu/Ultraviolet/MoviesAnywhere” access.” It’s not something I need to care about.

One, I had forgotten about was Contacts. I could have done a straight import/export, but I opted to take the long road and manually transfer everything to Outlook. This way I could also clean things up. This also meant I had to do some settings changes and shuffling on my phone, so it would use my Outlook Contacts instead of my Google contacts. I was, thankfully, already using Outlook as my email client anyway.

I also remembered that I used my domain account for my Google Analytics and Search Console credentials (Why aren’t these just one service?). Fortunately, these were fairly easily transferred to my standard Google Account. I found 4 services where I was able to do this, so I’ll roughly cover them all together.

Google Search Console, Google Analytics, Blogger, and Youtube, could all be directly transferred to a standard Gmail/Google account. The process is similar but slightly different on each.

Search Console allows you to delegate access to a secondary account. This account can then be made the primary owner, though to do this they need to be re-verified using DNS records.

Google Analytics is similar to Search Console, without the need to re-verify. I simply added my Gmail account as a user, promoted it to Admin, then deleted my domain account’s access.

Blogger worked the same way. I don’t really use Blogger, but I did have an empty blog with a name I’d like to hold on to, so I transferred it over.

Youtube is a bit more complex. Channels have to first be converted to “Brand Accounts”. Then you can delegate secondary users. Also, there is a waiting period of 7 days before a delegated user can be elevated to be the “Primary Owner”. After that period, I made my Gmail log in the Primary, and deleted access from my domain account. I had initially started simply consolidated playlists between accounts, but this was a pain in the ass. Going with the Brand account method, I was able to transfer everything. I BELEIVE, but am not positive, that there may be a way to convert the channels back to personal accounts, but I’m not positive on that one.

I’m am nearly ready to see what steps I need to take to cancel out the Gsuite part of the domain account, which HOPEFULLY will convert it to a Web ID. The only thing left is my Google Play apps. It’s not cleat at all what will happen here. If it converts to a Web ID, the Play Purchases should just continue to be used and licensed to that account. I have documented everything I’ve every bought, free or not, in case I need to “re-purchase” anything I use or care about (free or not) on my Gmail Account. I still plan to use the Gmail account going forward. I do also need to figure out how to transfer my Pokemon Home subscription to my Gmail account.

The whole process has gone surprisingly smoothly, it’s just been time consuming. It helped a lot that frankly, I wasn’t really using many Google Services anymore to start with. The reality is, that consolidating all my email to one (Microsoft) account has been great, because I can better use Rules to manage it before it’s shuffled off to the archive ball on my NAS.