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 on a Mac OSX Bootcamp Partition


So I’ve been running Windows 7 since early September when the release to production copy was opened up for MSDN subscribers.  I can honestly attest that this is by far the best relese of Windows to come out of Redmond to-date.  The ugly duckling known as Vista has shed its skin and what has emerged is an efficient and capable operating system that performs well on relatively underpowered hardware.  I’ve created a few posts in the past that outline how to install Vista on a MacbookPro via bootcamp and also how to install at 500GB hard drive and maintain both partitions.  I’ve done all of this including the initial Leopard upgrade from Tiger without a total rebuild.  This is an amazing feat considering the number of trips to Apples Genius Bar desk to replace faulty video controllers for my now aging and out of warrantee Macbook Pro.  So I decided since I had been testing Windows 7 for a while now on a Dell XT and XT2 that I would tempt fate and perform an upgrade to the Bootcamp partition currently running Vista.  The other installations of Windows 7 on Intel hardware have been clean installs so this would be my first upgrade.  An upgrade, mind you, that has a significant amount of software installed. 

The process was actually fairly straight forward but I thought I would share none-the-less since the how-to posts seem to get the most attention. 

Step 1:  From either OS X or Windows open up the bootcamp manager and select the Windows partition. 

 bootcamp

Step 2:  Reboot to ensure that the default setting loads windows

Step 3:  Insert USB or Windows 7 CD into drive (I’ll post how to create a USB version of the Windows 7 Install Disk in a separate post)

Step 4:  Run the setup.exe from the Auto Run dialog box or manually via Windows Explorer.   From the initial setup dialog box run the compatibility testing tool (not shown in the image below) to ensure you meet all the minimum requirements and your software is compatible.  I had an issue with Windows OneCare to which I had to uninstall prior to installing.  Ironically it states there is an issue with the bootcamp software loaded on the Vista OS along with iTunes.   I proceeded none-the-less with the installation by clicking Next>after the check was complete.

windows7setup

Step 5: Setup of the OS is about as straight forward as it can possibly get.  Nothing special to do here just follow the instructions for an upgrade and enter in your key when prompted.

Step 6:  You will eventually reboot your system at which time you get the initial boot screen for windows indicating which Windows OS you want to boot into.  Keep the default Windows or Windows 7 (not Vista) and proceed with allowing setup to configure your system.

Step 7 (Optional):  Open up bootcamp setup and configure your default boot OS.  Either Windows or OS X

The setup depending on the software you have installed will take quite a while but for the most part it is a hands-off process.  Enjoy…

By

VMWare Fusion 2.0 for the Mac

About two weeks ago VMWare released the 2.0 version of their Fusion VM software for the Mac.  It is certainly worthy of a full point release with the level of integration between the host OS and the virtualized OS increased tremendously.

It is interesting to note that VMWare Fusion offers the option to install McAffee VirusScan Plus on windows virtual machines (even BootCamp) by mounting an install ISO on the virtualized Windows system.  This is interesting to note especially with increased integration and ability to access or share files from virtual to host as virus infected files can pass from one VM to the host without much effort by the user.  While it does not seem viable this could occur in a scripted way through the hypervisor from VM to the host it does have to be a consious effort by the user to move the files over so this provieds another layer of protection for the user who might not otherwise use this software on a freshly created Windows VM.

The visuals on the 2.0 version have also increased with a rather handy screen snapshot of the running VM provided in the Virtual Machine Library window.  This window is updated approximately every 10 seconds with a current view of the guest VM.

One other suprise with this upgrade occured when I tried to unzip a file on OS X and was prompted with the abilty to utilize WinZip within BootCamp to open the file.  This really starts to blur the line between the two OS’s and enables the end-user to utilize the best application for the job.  So far performance has been snappy and very responsive.  With the integration of optimized video drivers for the VM’s I tried to run Compiz 3D effects on my Ubuntu Hardy VM but unfortunately wasn’t able to get the visuals running as they do on my dedicated Ubuntu PC’s.

By

iPhones-Macintosh Computers Are Now Targeted by More Hackers

It was only a matter of time before the popularity of Apple’s OS X and iPhone attracted hackers.  Security specialists said Saturday that hackers are taking increasing aim at iPhones and Macintosh computers as the hot-selling Apple devices gain popularity worldwide. Hackers have historically focused devious efforts on computers using Windows operating systems because the Microsoft software has more than 90 percent of the global market.  Apple is now going to have to deal with all the “Enterprise” issues that Microsoft has gotten flack about in the past several years.  This is not going to be an easy road for Apple and many senior IT leaders are going to be watching this closely.  Apple has already gotten some flack for their “misuse” of the word push in their recent MobileMe announcements.  Enterprise IT professionals attribute the word “push” to mean something altogether different than the semi-push features brought about in MobleMe’s latest incarnation.  Apple will certainly have to stay on top of their game if they are to quickly address the sundry of security issues their OS assumes with its increased popularity.

read more

By

Installing OS X on an HP nw8240 laptop

So I was doing a little research on how Apple has differentiated itself with its hardware compared to that of the commodity hardware in the PC Markets. I’ve heard of several stories when Apple converted to Intel processors of hackers trying to run OS X on non-Apple hardware. The biggest setback is the legacy BIOS that many PC’s still use today. Given that Apple controls the entire user experience by designing best-of-breed hardware with an operating system developed around this hardware they can pretty much choose whatever works best and fits their designs. One of these design requirements has been the use of Intel’s EFI which is an entire generation of technologies ahead of other PC makers.


This of course makes it next to impossible to install OS X which utilizes this EFI firmware to boot. Through Intel’s own spec they have developed a software specification for emulating this which is how some clever hackers have gotten past this requirement on PC’s with legacy BIOS’.

As you may have read through other posts I’ve been very happy running the latest 8.04 version of Ubuntu on my old HP nw8240 complete with the Compiz effects. However after reading this I had to see if I could get OS X to run on my laptop to see how it compared with Ubuntu on the same hardware. After doing a little searching I came across several articles on how to do this but none on how to do this on my specific hardware.

There are not many updates that can be made to the nw8240 bios however the one change that I made that eventually allowed me to boot the install disc was to enable multi-boot and set the timeout to 10 seconds. After that I was able to accept the defaults on the patched install disc and proceed with the install.

A couple of minutes later I was greeted with the following screen that gave me some glimmer of hope this would work.


A couple of more minutes later I got the initial install screen for Leopard.


After the typical registration screens I was greeted with a paltry sized 1024×768 resolution OS X desktop; a far cry from the 1920×1200 this LCD is capable of. Audio worked beautifully, Performance was moderately zippy. Since I didn’t have any wireless access I connected to an Ethernet cable and was quickly online with Safari. I downloaded Quicksilver and Firefox and was good to go. I changed the default background image and started looking at the core animation features built into the OS and quickly found out that their are several functions that rely on the OpenGL capabilities of the graphics card to work. While the FireGL 5000 adapter in the nw8240 is certainly capable of handling this the driver on the patched DVD I used did not support this by default so I was out of luck. Also updating this hackintosh caused a panic on reboot so I had to reinstall to get back to where I was before the updates.

Overall Impressions…

While this was just an exercise to see if I could get this to work I had no intention of keeping this on my laptop. I have become much too attached to Linux and compiz on this PC to move away so quickly not to mention I have a fully functional MacBook Pro that functions as my daily PC anyway and runs Windows and Ubuntu VM’s perfectly well. If you want to use OS X buy an Apple and take advantage of the integrated HW support. Yes, their hardware is more expensive but IMHO it is worth it if you really want to run OS X and support isn’t too far away for most people within a drive to an Apple store. The resolution and inability to change the underlying video drivers (and yes I tried) as well as the lack of updates were a big killer for me. This attempt while successful will quickly be rolled back to the latest version of Ubuntu which runs way better on this legacy hardware anyway.

Do you need OS X? Well that’s a topic for another post but I don’t think I can recommend anyone switch given the breadth of applications available on the Windows platform and the developer base is far greater for .Net applications than for Coco. For me I love the underlying *nix framework OS X is based on (BSD) which allows me some flexibility in mounting different drives, shell access to web servers, etc… Sure you can accomplish these things on a Windows server but running native Linux apps via X11 server on OS X is a killer feature baked right into the OS. Cygwin, while very useful, never really cut it for me on XP.


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

Virtualization on the Mac with VMware Beta 2

I am a big proponent of virtualization in the enterprise and it has come in quite handy on my primary PC for virtualizing development environments for some of my .Net development as well as hosting several LAMP stacks running atop of Linux.  VMware is my application of choice on the desktop and on the server.  I’ve run VMWare for well over 6 years now on XP, Windows Servers, Linux, and now OS X and have had solid performance with consistent updates from what is now a property of EMC.

The first release of VMware fusion left a bit to be desired but I jumped on it none-the-less because of the portability of existing VMware appliances and machines.  Within a few months another point release was issued that made it an almost daily utility for me.  Now with the upcoming release of 2.0 VMware has added several features I think feature-for-feature will give other competitors, even the open source Zen, a run for it’s money.

Here is a snapshot of what is anticipated in the 2.0 release:

  • Multiple Snapshots
    • Save your virtual machine in any number of states, and return to those states at any time
    • Automatically take snapshots at regular intervals with AutoProtect
  • File and URL Sharing
    • Share applications between your Mac and your virtual machines
    • Finder can now open your Mac’s files directly in Windows applications like Microsoft Word and Windows Media Player
    • VMware Fusion can configure virtual machines to open their files in Mac applications like Preview and iTunes
    • Click on a URL in a virtual machine and open it in your favorite Mac browser, or configure your Mac to open its links in a virtual machine
    • Map key folders in Windows Vista and Windows XP (Desktop, My Documents, My Music, My Pictures) to their corresponding Mac folders (Desktop, Documents, Music, and Pictures)
    • Greatly improved reliability of shared folders—now compatible with Microsoft Office and Visual Studio
  • Experimental Support for Mac OS X Server Virtual Machines
    • You can create Mac OS X Server 10.5 virtual machines (experimental support). Due to Apple licensing restrictions, the standard edition of Mac OS X 10.5 is not supported in a virtual machine
  • Display Improvement
    • Improved 3D support
    • Use 1080p full high definition video in Windows XP or Windows Vista
    • Freely resize your virtual machine’s window and enter and exit Full Screen view while playing games
    • Run Linux applications directly on your Mac’s desktop under Unity view
  • UI Improvements
    • The New Virtual Machine Assistant has Linux Easy Install in addition to Windows Easy Install
    • Cut and paste files up to 4 MB, including graphics and styled text
    • Status icons glow when there is activity
    • A screen shot of the last suspended state of a virtual machine is displayed in Quick Look and Cover Flow
    • You can remap keyboard and mouse input
    • Keyboard compatibility between the Mac and the virtual machine is improved
    • The vmrun command line interface is available for scripting
  • Broader Hardware and Software Support
    • VMware Fusion supports Ubuntu 8.04 Hardy Heron
    • VMware Fusion supports 64-bit Vista Boot Camp; handles activation for Microsoft Office 2003 and Office 2007
    • Experimental support for 4-way SMP (note: Windows Vista and Windows XP limit themselves to two CPUs)
  • Support for Virtual Hard Disks
    • You can mount the virtual disk of a powered-off Windows virtual machine using VMDKMounter (Mac OS X 10.5 or higher)
    • You now have the ability to re-size virtual disks

All of these features are worthy of an upgrade in and of itself but VMware is offering this as a free upgrade to current Fusion customers – even better.

Source: VMware