Monday, March 27, 2017

Solid State Drive (SSD) Upgrade - Part 2 of 2

A journey from Windows .vhd to .img to SSD to HDD to .mrimg to SSD to Windows.

"If you have it, then you won't be in need of it." Preparedness can keep bad situations from turning catastrophic. Along with preventative maintenance, routine backups are two important but neglected tasks for users. Most personal computers no longer come with operating system installation disks. A rescue partition with a recovery utility is all you get, now. That might be okay for some situations. However, if the entire disk is replaced, then there's no recovery utility to boot.

Fortunately, Windows 7 (and higher) has a native backup utility called Recovery. It's accessible through Control Panel as Backup and Restore. It can make a repair disk (CD) and a full system image.


While in the OS, you can even choose to reinstall Windows. The recovery disk alone can't do that (it's just a bootstrap environment with some disk check utilities). You'll also need a source of installation files, such as a complete recovery partition or existing installation of Windows. That's great, unless you've replaced your system's HDD (including its recovery partition) with a blank SSD. I'm a fairly responsible user, so I keep system images (backup copies of the entire disk) ready. After the swap, I launched the System Recovery disk and plugged in my external storage with my backup image.


And, that's when this all went south. The first Google hits for this error were a bunch of dead ends. Most people were just encountering a USB 3.0 driver issue. I knew Recovery could access my backup image on the external drive:


The .vhd is clearly there. Unfortunately, Recovery has no means of manually selecting a particular image. It must be doing integrity checks to decide which backups are "valid" and can be "found." After some deep searching, I found a post by Schneider on Super User:
The following changes will cause the backup not to be recognized...
  1. If you delete or modify the MediaId file from the root
  2. Delete or modify the Catalog/GlobalCatalog file (deleting the BackupGlobalCatalog seems to have no effect)
  3. Rename the Backup <Date> folder to anything else (such as changing it by 1 second)
  4. If its not inside D:\WindowsImageBackup\<PC-NAME>\ folder
Whatever the case, Recovery wasn't going to let me copy my image using the native Windows utility. So, I busted out my copy of Hiren's Boot CD and tried to find something that could help.

Clonezilla looked promising. It had a built-in .vhd to disk utility. Unfortunately, it wrote the data but the system wasn't bootable. It also had a .vhd to .img, which I then copied to the SSD. Still didn't work.

Some forum guys recommended Macrium Reflect. I gave up on my Windows-made .vhd and opted to image my old HDD using Reflect. I swapped the HDD back in and made an .mrimg. I swapped the SSD back in (my USFF tower only has one SATA connector). I partitioned the SSD to match, and used Macrium to write the .mrimg. That kind of worked.


Windows wasn't bootable, but I could see all the right files in the right places. So I put the Windows Recovery disk back in, and managed to convince it that I had an existing installation that just needed fixing. So, it offered to reinstall. Let's do it!


I buttoned everything up, spent hours installing software, and copied personal files from my backup-backup location. I have to say, SSD is remarkably faster. It only took VeraCrypt about an hour to encrypt the entire drive. The old HDD took overnight for less storage.

This got me wondering about two things. First, why did my Windows image fail? Second, was this re-installation method legal?

To study my first question, I made a fresh Windows Recovery image on the newly finished system and immediately rebooted into the Windows Rescue Disk. No joy--Windows still "cannot find a system image." I didn't change anything, so there's no good reason for that to happen. I won't be relying on Recovery, anymore. Maybe I'll switch to Reflect since it really pulled through for me.


The second question reminds me of an existential thought exercise. If a broom's worn head is replaced with a new one, is it still the same broom? What if the repaired broom then has its handle replaced? How much of the original system can we swap before it is no longer the original? Does a new hard drive make a new computer? The OEM Windows license is for a single computer. I wonder if some of the imaging failures are meant to prevent unauthorized copying. Anyway, I'm not a lawyer. As far as I'm concerned, my Windows license is still on the same computer it was originally installed on... merely faster.

Sunday, March 26, 2017

Solid State Drive (SSD) Upgrade - Part 1 of 2

I swapped the HDD in my old desktop for an SSD. Changing hardware was the easy part:
 Crack the case.
Pop the trim.
Dig into the peripheral slots until we get to the disk.
Bam! Hard drive caddy.
Just exchange the old SATA drive for the new one.
Assemble in reverse.
Then came the hard part... Reinstalling Windows without an installation disk.

Wednesday, January 18, 2017

Instax Hacks

In a quest to get back into film photography, I spent a long while lusting after vintage SLR like a Nikon FM-2 or Canon AE-1. My motivations were mostly boredom and nostalgia. I eventually came to the realization that I enjoy sharing my photos, and that the world has gone digital. The prospect of digitizing film made me remember days of scanning negatives and prints of old family albums. It was awful. I'll stick with my digital bodies.

My modified Fujifilm Instax Mini 8 with its new tripod socket and remote shutter release
Enter instant film. I mostly use it to give out instant souvenirs at social events. The current market for self developing film is dominated by Fujifilm's Instax line. The typical "mini" version is 54 x 86mm, 800 ISO, color film. There is a variety of cameras to choose from, but I settled on the cheapest bare-bones unit knowing I would tinker with it. Also, the reviews for the fancier ones were plagued with electronics failures.

Mini 8 circuit board
The Mini 8 has a 60mm prime lens (single element plastic optic) and a mechanical shutter fixed at 1/60s. Aperture is a user-selectable rotating plate with different holes for f/12.7, f/16, f/22, and f/32. Flash is compulsory. I used the Mini 8 for a while but wanted additional functionality: 1) tripod mount, 2) remote release/timer, 3) flash control.

New tripod socket
My tripod mount is a 1/4-20 tee nut. I found some void space and step drilled a hole in the body to slip fit. I pinned it with one screw then epoxied it all in place. Goal 1 accomplished.



The camera is driven by a single hobby motor. A rather complicated gear, lever, and cam system cycles the shutter, flash, and film rollers.

Opened Mini 8 with new leads on the flash switch and shutter switch
The shutter release button is a single pole single throw switch. I tapped the circuit by soldering wires to the corresponding pins on the PCB. I had to map the pinout by visually tracing wires and checking continuity with a multimeter. Most of the exposed leads are for various switches.


I decided on 3.5mm audio jack as my port because it's compact. I rigged up a push button SPST and housed it in some PVC fittings. The cable is a 3.5mm stereo patch cord. Depressing the push button closes the "SP" circuit to begin the shutter cycle. I still need to rig up some kind of timer, but the hard part of getting the signal out of the body is done.

Custom remote release, connects via an audio cable
UPDATE
An intervalometer with Canon pinout, plus a 2.5mm to 3.5mm stereo adapter
Canon shutter remotes happen to use the same stereo pinout that I chose. Adapting an off-the-shelf intervalometer turned out to be the best way to get timed release.

I thought I could toggle the flash by interrupting the "SSY" switch. That's the circuit triggered during shutter opening. I think the SSY circuit ground clamps, because cutting the SSY leads didn't stop the flash from firing. I couldn't interrupt the high voltage side of the flash capacitor (I don't think I could fit an appropriate 320V switch into this little body). I would have cut off the 3V side, but there are some charging electronics and sensors that probably would have disagreed with my meddling. I'll leave this issue for another intrepid individual.

www.bhphotovideo.com
Fujifilm Instax Mini 70
Or maybe I should have just bought an Instax with built in tripod socket, self-timer and flash control...

Saturday, December 24, 2016

2012 Subaru Impreza Engine Oil Change

With appropriate tools and work space, routine car maintenance is a nice do-it-yourself experience. There are plenty of tutorials elsewhere for an engine oil and filter change, so I'll highlight some personal tips and vehicle specific information for a 2012 Subaru Impreza 2.0i 5-door.
parts.subaru.com
Factory Specifications:
  1. Engine Oil - SAE 0W-20 synthetic
  2. Capacity (Oil+Filter) - 5.0 quarts
  3. OEM Engine Oil Filter - Subaru P/N 15208AA15A
  4. Drain Plug Head - 17mm hex
  5. Drain Plug Gasket - 16 x 21 x 2.3mm crush washer, Subaru P/N 803916010
  6. Drain Plug Torque - 30.8 ft-lb

Tip #1: Roll down a window so you don't accidentally lock yourself out


Tip #2: Wheel chocks for safety! (Both directions.)

The oil filter and filler tube are located on the driver's side. The dipstick is on passenger side.

Tip #3: Wear gloves so you don't get burned and oily.
I undo the cap and filter first. I think the oil flows out faster by breaking the vacuum. I haven't done a scientific study, though.


The drain plug is under the driver's side. The skid plate has a cutout so you don't even have to remove any trim.


Last time I tried to get a gasket from a chain store, their database had incorrect dimensions for the drain plug. The engine oil pan drain plug is a 17-mm M16-1.5 flanged hex head. The OEM gasket is therefore 16mm ID. If someone gives you a 20mm, it will barely stay on the flange.

Tip #4: Secondary containment for your oil pan! I'm using a plastic tray.
Let the old fluid drain fully, then reinstall the drain plug with a new gasket. My trash service takes used oil and filters curbside, so I don't have to take it to a recycling center.


You should oil the new filter seal before installation. I also prime the filter with enough oil to wet the element so it won't be dry during start up.


I refill with a full 5 quarts of synthetic oil. Walmart and Amazon seem to have the best prices.


Since you're already in the engine bay, it's a good time to check the air cleaner element. The factory manual suggests removing the air scoop from the front of the air box. I find it easier to go from the back side, instead.


Undo the clamps and it should wiggle out easily. I've been buying aftermarket filters because it's all just paper anyway.


Since we're on the subject of filters, the cabin air filter is behind the glove box. Undo the dampener on the right side of the glove box, squeeze the hinge pins in towards each other, then swing the glove box down and pull out.


This one was pretty clogged. A new element seemed to improve air flow in the cabin. It smelled fresher, too.


Be sure to check fluid levels and watch for leaks after you're done. My Impreza seems to need about 1.5 quarts of top-off between oil changes (7,500 miles). Apparently, that's within specification. However, there are lots of internet stories about this FB20 engine. See Technical Service Bulletin 02-157-14R "Engine Oil Consumption" for details. Or, just Google "FB20 engine oil consumption" for some irate forum posts and YouTube videos.

Sunday, August 16, 2015

American Society of Civil Engineers Water Treatment Competition 2015

The Water Treatment Competition (WTC) at the 2015 Mid-Pacific Regional Student Conference tasked students to design, develop, fabricate, and present a small-scale raw water treatment system. The influent contained 9 gallons of simulated agricultural run-off. Teams were allocated 30 minutes to construct a filtration system onsite. Water quality scores were determined by measured: turbidity, electrical conductivity, dissolved oxygen, free chlorine, pH, and recovered volume.

My team’s final design was a dual media filter with chemical amendments for oxygen and pH.
Cross section of dual media filter
The filter column is raised above the catchment to allow air entrainment by trickling.
Peroxide and acetic dissociation
Hydrogen peroxide and acetic acid were used to introduce O2 and H+. One of the most controversial decisions was to exclude chlorine. Without disinfectant, the design has no pathogen removal. This ignores the design scenario for making rinsing water for a lettuce farm.
Conductivity increasing with chlorine
The scoring rubric equally weighted all water quality parameters. Empirical data reflected a strong correlation between increasing chlorine and conductivity. Up to a point, chlorine increased score. Conductivity reduced score. The result is a one-for-one trade-off, or net zero.
6 points for both bleach and no-bleach scenario
Thus, the design omits bleach for simplicity. If the project specifications had emphasized the use of disinfectant, the team’s decision would have been different. However, point maximization supported this no-bleach approach. Much as the team was during design meetings, the judges at competition were leery of water treatment without disinfection. Although not technically improper within the scope of the rules, the spirit of the competition was to make washing water.

The team placed 4th of 14. Turbidity performance was significantly worse than in lab trials. A construction issue likely created a short circuit in the filtration column. This experience demonstrated two engineering lessons. First, specifications and requirements are the starting point for any design. Their interpretation drives the final output, so clear understanding between the client and consultant is essential. Second, preparation and research will be challenged by problems in the field. These lessons can be carried forward to make next year’s project even more successful.