Recovery

Dead Hard Drive and My Process

So, I have been pretty sure for a while that the main Hard Drive in my desktop was going out.  It’s probably the oldest drive I own and occasionally it got feisty during reboots.  For a variety of reasons, I kept putting off replacing it.

… and putting it off…. and putting it off…

Then I went down to my office one day, the wife and kids were heading out for the weekend, I had grand plans to waste away my weekend on Overwatch and Battlefield 1.  Those plans came to an abrupt halt because I was greeted with a GRUB error.  My first assumption was that, as has happened before, Windows 10 did an update and screwed things up again.  A good while back I encountered  similar problem and after some troubleshooting I found that my Linux partition had been wiped out.  I reinstalled Ubuntu there and everything booted just fine.  Windows 10 had just done and update and after some searching online there were sporadic reports of similar issues.  After some troubleshooting trying to use a Windows disk to do a Master Boot Record fix and then trying to reinstall Ubuntu again, it became apparent that instead, the drive had failed.

This complicates things a bit.  I pulled out my SpinRite disc and threw it in the drive, hoping it would find and correct the error.  It instead threw out an error partway through the scan.  It’s an older disc, I’m honestly not sure if it’s compatible with the newer set up.  Instead I tried a copy of Norton Ghost to clone the drive to a spare 1TB drive I had in the cabinet.  It looked promising as well, though it also listed that it would take nearly 50 hours to finish.

I guess that meant no Battlefield but Overwatch runs fine on the laptop so a weekend of Overwatch and Netflix it would be.

Unfortunately, the clone crapped out as well after about an hour.

The final solution was to simply reinstall Windows 10, on a new drive.  I never use Ubuntu on the desktop so I opted not to bother reinstalling it.  I downloaded the official Windows 10 recover ISO and ran through the install.  During the install I skipped over entering the CD Key, Windows 10 is supposed to activate itself based on account credentials and hardware on the same machine, time to test that concept out.  The install finishes up and Windows 10 loads up just fine.  It’s even activated as promised in all of the Windows 10 feature lists.

The next task involves getting things back up and running order.

In recent years I’ve pushed a lot of my data off onto either my NAS or into Cloud accessible storage.  This makes this whole task much much easier.  I keep very little irrecoverable data on any one machine these days.  There are a few folders that I will need to recover from the old drive, but nothing super important, and I should be able to simply hook the drive up using a USB drive bay and do normal recovery operations to get to my data.

More interesting through, I ended up saving a ton of time and bandwidth with the games I had on the machine.  At one point I had nearly all of my 1000 Steam Games downloaded and installed, all of my GOG galaxy games and all of my Origin games installed.  These games are spread across several drives of varying size in this machine.  Once I reinstalled Steam, I set up Steam to use each of these drives and it simply detected all of the downloaded games, automatically.  The same happened with GOG Galaxy.  I didn’t see a way to make Origin to reattach to it’s old data so I just dumped that folder and redownloaded things as needed.

Honestly, ultimately this whole debacle has been a bit of a godsend.  I now have a fresh clean Windows 10 install, not one from my Windows 7 upgraded to Windows 10.  I also have a slightly nicer and faster drive as the main drive, which helps performance a bit.  It also gave me an excuse to purge out a lot of cruft I wasn’t really using.  I’ve shifted a lot of my computer use to my laptop, the desktop is primarily used for gaming, so it doesn’t really need anything else installed that doesn’t serve that purpose.

Saving a Slice of Raspberry Pi

Raspberry_Pi_LogoSo of all the things on the network, the DNS and DHCP server are pretty important.  Especially because my experience has been the router the ISP provided is kind of mediocre at doing the DHCP job.  So when the Raspberry Pi I’ve tasked with doing the work started flaking out I was a little worried.

After some investigation, it seems the SD card had lost a sector, or whatever the equivalent thing is to a sector on flash memory.  These things do have a bit of a limited life and this particular one was a small 4GB card that was a little older.  Four gigabytes isn’t even above the recommended size for the Pi, but I knew I wasn’t planning on putting a lot on it.  Problems arose when it started dying though.  There actually isn’t much using the PiHole, some of the things my wife does with coupons and such I suspect might get blocked and I don’t want the headache of dealing with trying to manually whitelist things and complaints that this and that isn’t working.  The DHCP is another issue.  When the DHCP server disappears, it seems anything using it simply can’t connect to the internet.  I have a lot of static assignments but there’s quite a few assigned by the server.

I may have to look into setting up a secondary backup server, maybe on one of the CHIPs even.

I started out simply re-imaged Raspbian onto a fresh card and setting things up again following the tutorial I had posted.  Everything went pretty smoothly except that I was now out my old config file and would have to go through the hassle of recreating all of the changes I’d made adding and removing devices.

So I went with a new strategy, why not just clone the old card to a new one.  Unfortunately, Win32 Disk Imager, the recommended tool for imaging these SD cards, couldn’t read the whole card, it got hung up and failed partway in.  So I turned to my laptop and Linux hoping for something more robust, which I found in ‘dd’.  It probably stands for “Disk Duplicator”, but don’t quote me on that.

I started running dd to make an image of the old card to put onto a new card, unfortunately, it also failed, like Win32DiskImager.

Back to Square One…

After some searching, I found this post suggesting something called ddrescue.  Most of it wasn’t anything I needed aside from the following.

sudo apt-get install gddrescue
sudo ddrescue -v /dev/sdb /dev/sdc

A few things of note.  My laptop, like many, has a build in SD slot, I added a second using my USB card reader.  I opened the disk manager to get the path to each card, /dev/sdb and/dev/sdc.

This command also hit an error at the same point as both Win32DiskImager and the “dd” command, but it pushed on through, recovering everything else.  At this point it’s a matter of hoping that one bad spot wasn’t int he middle of an important file.