Strategic Informatics

A blog about the strategic application of technology

By

Recovering a hard driving using SpinRite on a Mac using VMWare Fusion

I recently found myself faced with a 2.5″ NTFS formatted laptop hard drive from a 5 year old laptop that wouldn’t cooperate and would constantly fail so I decided to try and recover what I could from the drive by running SpinRite, a great application from Steve Gibson of Gibson Research that I have used successfully many times in the past to recover damaged or unreadable magnetic based media.  The last time I actually used it was about 12 years ago over the course of several days to recover a failing HD.  Computing and hard drive technology has changed a lot since then but they are still very much part of our day-to-day IT lives.  When I encounter a problem that needs extensive evaluation I would just run SpinRite on the x86 based PC from which the hard drive came.  However, after creating a bootable CD and USB key with SpinRite for use on the 5 yo laptop neither one would work so I decided to take a different route.  Without another PC handy I decided to assess my options…  My daily laptop is a MacBook Pro, doesn’t (thankfully) have an internal 2.5″ SATA bay and is sealed tighter than the sub in the Hunt for Red October…  So what’s a Mac user to do with an NTFS formatted magnetic HD that can’t be read, an old Laptop that won’t boot SpinRite, and no other PC’s within easy reach?  Try to run SpinRite from a Virtual Machine on a Mac of course….

Now for those of you who don’t know SpinRite was written in assembly and does very low level reads and writes against a computers magnetic mass storage drives.  FreeDOS has been incorporated into SpinRite distribution to allow it to boot to a bare-metal PC and mount any connected drives so you can exercise the individual bits of 1’s and 0’s stored on the drive, exercising it enough to get a magnetic drive in as good a working condition as the physical hardware will allow.  With any luck it will operate just well enough to get your information to a readable state and backed up before you have complete hardware failure…   Running SpinRite from a VM was a bit more involved to configure via VMWare Fusion on a Mac and I wasn’t completely sure it would work… so I thought I would share my experiences.

 

I created a spinrite.iso file from another Windows VM I use.  I then created a new MS-DOS based VM mounting the SpinRite.iso created from the SpinRite.exe file.  It booted to a familiar screen without any issues.

SpinRite_and_Blank_website__Blank_site__Nothing_to_see_here_

SpinRite_and_Blank_website__Blank_site__Nothing_to_see_here_

Now the challenge was to get the physical hard drive mounted to the VM…  Looking through the settings there was no way to get RAW access to a physical HD.  I used a SATA to USB adapter and had to connect the drive to my Macbook Pro ensuring it was mounted to the Mac not the VM.

I needed to create a Raw Disk vmdk to make the RawDisk accessible to the VM so I did the following:

From a Mac terminal (I prefer iTerm) type:

diskutil list

In my case the 160GB HD came up as /dev/disk2 but your particular configuration may be different.

1__bash

 

Next from the terminal run the following command to list the partitions that rawdiskCreator can see:

/Applications/VMware Fusion.app/Contents/Library/vmware-rawdiskCreator print /dev/disk#

Note: Ensure that the last entry /dev/disk# is changed to the drive you are targeting for raw access.  In my case it was /dev/disk2

1__bash

What you should see next is your drive partitions…  My particular drive was split into two partitions (#1 was very small and #2 made up the bulk of my 160G HD)

With your partitions known and visible by the rawdiskCreator tool you can create the vmdk file that refers to the physical hard disk you are trying to mount and make it available to the existing SpinRite VM you created earlier.  You will need to know the location of the Disk and the partitions you want to mount from the previous command, which in my case is /dev/disk2 1,2 which says it’s disk2 and both partitions 1 & 2.  You will also need the path to the actual SpinRite .vmwarevm Virtual Machine that you created earlier (in my case ~/Documents/Virtual Machines/SpinRite.vmwarevm/rawDiskFile).  Now I used rawDiskfile but this is the name of your vmdk file and can be called whatever you like.  Make sure to include the ide designator at the end so the VM knows how to mount the drive.

/Applications/VMware Fusion.app/Contents/Library/vmware-rawdiskCreator create /dev/disk2 1,2 ~/Documents/Virtual Machines/SpinRite.vmwarevm/rawDiskFile ide

After you execute this command successfully you can option click the SpinRite.vmwarevm file and choose Show Contents.  Here you should see the files that makeup the .vmwarevm file including the new .vmdk file (if that’s what you named it) for each partition you listed above (1,2).  In my case it was rawDiskFile.vmdk & rawDiskFile-pt.vmdk

If you boot the VM now you won’t see the additional drive so you have to manually edit the configuration file for the VM to recognize the drive.  With the VMWare file contents still being displayed in finder you need to edit the .vmx virtual machine configuration file.  In my case it was called SpinRite.vmx because SpinRite is what I named my VM…  You should probably back up this file incase there is a problem and you need to start over.  Use your favorite editor (BBEdit, TextWranger, TextEdit, etc…) to edit the .vmx configuration file.  You want to insert the following lines to your configuration file being careful not to duplicate an existing ide#:# entry:

ide0:1.present = “TRUE”
ide0:1.fileName = “rawDiskFile.vmdk”
ide0:1.deviceType = “rawDisk”
suspend.disabled = “TRUE”

If the VM already has in its .vmx configuration ide0:1, use another port such as ide1:1.  It is also possible to use scsi#:# or sata#:# if the VM is somehow configured to use a SATA or SCSI controller.   The suspend.disabled=”TRUE” entry prevents the VM from suspending and being out of sync with the attached HD.  Important since most of SpinRite’s scans can take a long time to run.

The last step is to power on the VM and select your HD…  You may be prompted to enter your administrators password to get RAW access to the HD as the VM powers up.

Screenshot_4_30_15__4_12_PM

If you run into trouble it may be necessary to unmount the HD from your Mac by ejecting or un-mounting from Disk Utility prior to turning the VM on.

I won’t go into detail on how to use SpinRite as the tool is pretty self explanatory but the 160GB HD partition did appear in the interface ready to begin SpinRite’s operations.

SpinRite

SpinRite_and_Blank_website__Blank_site__Nothing_to_see_here_

SpinRite

 

Again this certainly isn’t an ideal setup as SMART access to the HD wasn’t available from within SpinRite menu options because, and I’m guessing here, of the SATA to USB setup but it might work in a pinch.  Hopefully it proves useful to your IT Toolkit and helps you extend the life of your SpinRite license which is worth every penny…

Update:  I tried a couple of drives and while it worked for one drive there was an error that completely stopped SpinRite and the VM in it’s tracks…   It only occurred on a specific section of the hard drive where there was clearly an issue…

SpinRite

SpinRite

By

Installing Windows 7 from a USB Drive

The installation for Windows 7 is much faster via USB than CD so I decided to cut as much time off any install as possible by installing the distribution media onto USB rather than the old-school circa 1998 CD-ROM method.  If you want to install Windows 7 via a portable USB key then read on…

NOTICE:  Pay close attention to each step.  Every installation is different so be sure to read through all steps before attempting to format your USB key.  It is easy to type the wrong drive ID when formatting.  I will not be responsible formatting the drive so proceed at your own risk.  If you don’t feel comfortable doing these steps then stop and do the install via DVD instead.

Blah…Blahh…Blahhhh….OK, now that the disclaimer is out of the way let’s dig in…

http://gopaultech.com/wp-content/uploads/2007/04/usbdrive.jpg

Step 1:  Grab a 4GB or larger USB key.  the entire distribution is a little over 2GB so 4GB drives work nicely.

Step 2:  Plug the key into a workstation with a DVD drive that can read the Windows 7 Install media.  I used an existing Windows 7 desktop but you can also use a Vista/XP workstation as well.

Step 3:  Open a command prompt.  If using Vista be sure to open the command prompt as administrator by right clicking on the command prompt icon and selecting “Run as Administrator”

Step 4: Type the following into the command prompt window

  • diskpart
  • listdisk (The disk number for my USB key was 1, be sure to identify the size to get the correct disk ID.  This is important)
  • select disk 1 (you are about to format the disk so be sure you get the correct disk ID...See above step)
  • clean
  • create partition primary
  • select partion 1 (mine was 1.  be sure to put your ID here instead!)
  • active
  • format fs=NTFS
  • assign
  • exit

Step 5:  Insert the Windows 7 disk into the same workstation you used to format the USB key

Step 6:  In the same command prompt window navigate to the boot directory on the DVD drive where the Windows 7 Install disk is located

Step 7:  To make the drive bootable enter the following command

  • bootsect /nt60 E: (Where E: is the drive letter assigned after you typed the assign command above)

Step 8:  With the USB key formatted and bootable you can now copy all the files from the Windows 7 install DVD onto the USB Key

When you boot your target PC be sure to boot via the USB option in your boot priority.  Some workstations have a key you can press during intial startup to change the boot drive.

By

Running Citrix ICA client on Linux – Ubuntu 8.10

As fate would have it I have the need to access Citrix applications again so as a matter of convenience I wanted to install the ICA client on my Ubuntu 8.04 desktop. After way too much effort I was finally able to get the client installed and launch application from within the SSL web interface via Firefox.

To install the ICA client on Linux go to the Citrix website and click Download to find the Linux client or click here http://www.citrix.com/English/SS/downloads/details.asp?downloadID=3323&productID=-1 for the tar.gz version

Note: You will have to turn scripting on to view the download link.

Extract the en.linuxx86.tar.gz file to your desktop

gunzip linuxx86.tar.gz

tar -xf linuxx86.tar

In the extracted directory type the following from a terminal window:

sudo ./setupwfc

Follow the prompts to install the application and install the linux for your Gnome or KDE installation.

After installing this successfully I tried to run the ICA client from within Gnome but the application would not run. After a little searching I discovered I needed a missing library. From the desktop open System > Administration > Synaptic Package Manager

Search for libmotif3 and click the checkbox and select Mark for Installation then click the Apply button.

After installing this missing library I was able to see the application and spawn the ICA client from within Firefox when visiting our Metaframe server. However after launching an application I received an “SSL Error 61: You have not chosen to trust the issuer of the server’s security certificate” message. A little more research indicated I needed to copy the ca-certs in the mozilla directory to the cacerts directory in the ICA client installation. So open a terminal window again and type the following:

sudo cp /usr/share/ca-certificates/mozilla/* /usr/lib/ICAClient/keystore/cacerts/

There you have it…another wonderful installation on Linux that is horribly more complex than it has to be. As much as I love Linux it is installs like this that make me appreciate my Windows and OS X systems.

By

Hamachi Personal VPN for OS X

Hamachi is the original name for the VPN client application for Linux, Windows, and Macs that allows for a virutual network to be created by simply joining with a Network name and a secure shared key. A virutal network adapter is installed and operates in the background tranfering traffic through a private (publically non-routable) IP address space. I’ve used this successfully on Windows and Linux and more recently Mac OS X. Windows installation is pretty straight forward. In this post I’ll review how to install the Hamachi client on the Mac. First, go to www.logmein.com and click to download the Hamachi client for Mac OS X. This is a command line installation so download the latest .tar.gz file to your Mac’s HD. Double-click on it to extract the Hamachi installation and configuraiton files.

Open up terminal, or my favorite iTerm, and navigate to the hamachi-x.x.x.x-x-osx folder you just downloaded. You will need to run the following commands as root so you will need to prepend sudo to your commands as follows.

Install hamachi:

sudo ./install

You will also need to install the tunneling adapter by issuing the tuncfg command.

sudo ./tuncfg/tuncfg

Now you can continue to utilize the command line interface or the easiest way to impelement this is to download the GUI interface HamachiX. This provides a visual interface much like the windows version that comes directly from the LogMeIn Hamachi Windows executable. Installing this in OS X will allow you to complete the remaining configuration.

You can click on the + Add button at the top of the HamachiX window


to add a network or create a new one.


Just don’t forget the Network name and password as you will need this for other Hamachi installation to access your virutalized network.

By the way for Linux users there is a similar but less feature rich Gnome GUI front end called ghamachi and can be downloaded here.


By

How to configure the iPhone with Sherweb’s MS Exchange 2007

So I jumped the gun and downloaded the iPhone restore firmware (iPhone1,2_2.0_5A347_Restore.ipsw) from Apple and upgraded my phone using a Windows XP desktop I have in my home office.   Here are the steps I took to install the firmware and configure Exchange to work with my hosting provider Sherweb.

How to upgrade to the 2.0 version of the firmware:
(NOTE:  This will wipe out any of your previous settings and media stored on your iPhone)

1.  Download the latest version of iTunes 7.7 from Apple

2.  Download the 2.0 firmware restore image from Apple and save to your desktop

3.  After installing iTunes and syncing your iPhone one last time go to the iPhone device config section by selecting your iPhone from the DEVICES side of the iTunes interface.  In the Summary tab hold down the shift key and click “Check for Update”  this will prompt you for the ipsw firmware image you downloaded earlier.  Select the iPhone1,2_2.0_5A347_Restore.ipsw image and click OK.

4.  Follow the simple steps to upgrade your pre 2.0 version iPhone.  It will take several minutes to update the firmware from the 225MB image file.

Once complete your iPhone will reboot and you will see the App Store listed on your home screen.

Note when the phone first boots you will be prompted to enter your VM password, and you may want to reconfigure any Wi-Fi settings you had set before the upgrade.

iPhone_Exchange_Setup 001

How to configure Sherweb Hosted Exchange 2007:

1.  Tap on the Mail Icon from the home screen and you are presented with the following screen

iPhone_Exchange_Setup 002

2.  Select “Microsoft Exchange” (Obviously) :) and you will be presented with the following screen

iPhone_Exchange_Setup 003

Now here are the key fields I found after many attempts (Since there is no support thread on the Sherweb site other than how to configure the iPhone with IMAP which I don’t want to do)

Email: Existing E-Mail Address (i.e. name@yourdomain.com)
Username: ihostSAM Account Name ( i.e ihostyourname_yourdoma  which can be found by logging into the Sherweb admin console at http://admin.ihostexchange.net
Password: Your current Exchange password

3.  Click Next and the server will verify your account settings.  It should come up automatically but in the event you are prompted for a Server enter the following:  webmail.ihostexchange.net and click Next again to verify.

The process is pretty quick and the next screen prompts you to enter the synchronization settings.  If you want to Sync your Mail, Contacts, and Calendars then just make sure all the selections are ON.

iPhone_Exchange_Setup 004

There you have it…  I’m finally getting to take advantage of the Active Sync features in the 2.0 firmware.  It feels a little like Christmas since the Apple should be releasing the 2.0 firmware sometime tomorrow with the 3G iPhone.

Now on to the App Store for some free applications…

iPhone_Exchange_Setup 005