Archive for the ‘OS’ Category

Time Machine Backup and Restore Experience

Sometime back, I read Scott Hanselman’s post on how meticulous he is about it backup strategy. That kind of meticulousness ensures you don’t ever lose any data whatsoever and you downtime in case of disaster is a minimum. Well, today I realized that Backups can help you with upgrades as well. So I am going to share how my backup strategy helped me upgrade my Hard disk without any Software Reinstall. A little bit of background first (or you can jump straight to the Upgrade).

Your System Environment

I do most of my development work on Windows 7 but I run all of them on VMWare VMs running on my MacBook Pro (OSX Snow Leopard). All the VMs are stored on another external 500Gb GoFlex drive. So easiest backup strategy for a VM is to simply copy the VMWare’s VM file periodically and you are done.

That strategy didn’t work very well when my Visual Studio got corrupted. I didn’t have anything to roll back to, so I had to create a new VM all together.

Take VM Snapshots

Moral from the corrupt Visual Studio story was to use the VM Snapshot functionality. That’s what I did when I created my new VM. Took a snapshot at significant steps of the installation process, like OS Install, Service Pack Install, Visual Studio Install, SQL Server Install etc.

Now I haven’t had a chance to test this backup strategy, yet, but I am hoping if my Visual Studio ever get’s corrupted, one of those snapshots will come to rescue.

Why not use Restore Points

I like to keep my VMs small about 60Gigs each, creating restore points would mean adding more diskspace to each VM. Also Restore point is too integral a part of Windows to help if some of the windows components got corrupted. Instead Windows Backup may be a better idea.

Use Source control, even for your personal code

I am a big believer in source control and I host most of my personal code on Bitbucket. So whether OSX or Windows 7 all my code is up in the cloud. You can refer to my www.devcurry.com  article on how to use Mercurial on Bitbucket. That way anytime OS has to be abandoned, only loss in source is the part that’s not backed up in cloud.

Time Machine on OSX

Now though my development work is on Windows 7 rest of the stuff is on OSX, so Office, Outlook, XCode etc. all run on the host system OSX. Obviously I have a significant investment in software here. I use Apple’s built in Time Machine software and a Seagate GoFlex 500GB USB2 external drive to do Daily backups. The Time Machine setup is pretty sparse and I use a third party app called Time Machine Editor to set it to a Daily scheduled backup instead of the default hourly backup that Time Machine sets out to do if enabled.

Selecting things to ‘exclude’ in Time Machine

Go to System Preferences –> Time Machine and select ‘Options…’ It will give you a list where you can add folders and drives that you don’t wish to be backed up. My external drives are excluded. So by default I backup everything else.

With this backup strategy in place I make sure Time Machine runs successfully every morning.

The Upgrade

I have been itching to upgrade my internal hard drive to 1TB so that I could host my VMs on the internal drive instead of having them run off an external drive. Was tempted to get an SSD but the high cost and failure rates so far have been a major deterrence. So instead of buying a 128GB SSD for ~$150 I bought myself a WD (WD10TPVT) 1TB for < $130 from good ol’ Amazon. This model is thicker than at 12.5 mm as opposed to the 9.5 mm for the stock drive. But it fits well in my late 2009 MacBook Pro. Your mileage may vary.

The hard drive replacement process is pretty much by the book (refer to the manual that came with your Mac), nothing there. I swapped out the 250 Gig stock Hard Drive with the new one.

Next was the restore part.

- I started the machine and inserted the OSX CD

- The installation process kicks off. Initially the OS won’t ‘see’ your new hard drive, because it’s not formatted. So use the Disk Utility to format and partition it. Then you can continue installing OSX (Snow Leopard in my case).

- The point at which it asks for user name give an account name that’s different from the one you used in your old installation. This comes in handy when running the Migration Wizard.

- Let OS install complete. Boot up and check for Software Updates. Let the Updates finish. Reboot if required.

- Now log on and go to Applications –> Utilities –> Migration Assistant.

- Select the Mac Hard Drive in the first page and go to next

- Select the Time Machine hard drive in the second page. Click next.

- Select all the backed up components including users and Click continue. It takes a little bit of time at this point. Once it is done it will ask what you want to do with the user that was backed up. In my case I had made the mistake of giving the same username and my old installation and as a result the second option ‘Replace’ was disabled. I had to back out, create another admin account, log in as that account, initiate restore then then ‘Replace’ that account from the backed up account. If you selected a different account name at the time of the fresh install, no worries, just continue. That’s it, sit back and let the restore complete. For 152GB odd of apps etc it took me about 2 hours to restore. But once it’s done almost everything is back to where it was.

What didn’t come through

It has been only a few hours since I completed by backup and I noticed the following:

1. I lost all my shortcuts on the Dock. They never got restored

2. Twitter app didn’t start on it’s own. And when it started it had lost all the accounts I was logged in for. I had to re-login every account again.

3. Office is asking for Product Key again. After I provided it, Outlook wants to ‘Rebuild’ the database index.

UPDATE 1 (March 24, 2012):

4. XCode recovery was also not complete. There is a very important tool that get’s installed with the XCode suite. It’s a command line util called ‘purge’. This util forces OSX to garbage collect Inactive memory. Without purge I can’t be as ‘agile’ I want to be with my VMs because either VMWare or OSX doesn’t release the memory of a recently shutdown VM. So either I run purge or reboot. Without which if I try to load a new VM it will crash completely!

What did come through

1. VMWare Fusion 4 works great. I am typing this on a VM that was created in the previous installation.

2. iTunes seems to have it’s clueless indexes of my music correct.

3. More importantly iPhoto seems to have ALL my images intact (a major part of the 150Gigs)

Conclusion

This was my first experience of ‘restoring from backup’. Looks okay so far. Knowing that my data is pretty much where I had left it, is rather comforting. There are some minor niggles as outlined above, but they are all pretty minor compared to setting up all the software all over again.

So backup my dear friends. It will help in more than one way!

Installing Windows 8 Developer Preview side-by-side existing Windows 7

Okay, so my last article was huge hit (by my standards). I was trying to setup Windows 8 Developer Preview on my Mac and thought of sharing the experience. Turns out lots of people were trying the same Smile.

After a day of playing around, I was beginning to feel the pinch of VM so wanted to setup Win8 on some hardware. I have an existing laptop running Windows 7 and oodles of free disk-space. So decided to give it a shot.

Before you start here is the configuration I start with

1. Core i5 Dell Latitude with 8 Gigs of RAM and 250 Gig HDD with about 200+ Gig free and Windows 7 Professional OEM installed

2. The same Developer Preview ISO I used for my previous post

3. An ISO mounting tool like SlySoft’s Virtual Clone Drive

4. After a long twitter exchange with one fellow enthusiast, I need to put in this extra warning. You CANNOT setup Win8 on a Dynamic partition using the method outlined here. This will work only if you have ‘Basic’ partitioning. How to know what type of partition you have, in the Disk Manager select the hard disk and the first column on the left will show DiskN, Basic or Dynamic. If you see in the images for the Disk Manager below it shows ‘Disk0 Basic’. So proceed only if you have a Basic parition.

Standard Disclaimer: The below worked for me, the Windows ecosystem comes with so many permutations and combinations that it’s impossible to predict if it will work for you.

If Shrinking partitions/Installing Drivers doesn’t sound like things you can do, DO NOT ATTEMPT IT. Hopefully nothing is affected but if your system is hosed in the process I cannot be held responsible.

Use the below steps at your own risk, no warranties here.

All set? Here we go

1. Creating a new Partition.

You need to do this ONLY if you don’t have a partition that can be formatted. If you already have a partition that you can format, format it and jump to step 2.

  • Navigate to My Computer->Manage
  • Select Storage->Disk Management
  • Select the drive that has atleast 20GB free.
  • Right click on the drive and select ‘Shrink Volume’. It will take a couple of minutes for the disk-manager to respond but at the end it will show the following dialog
  • image
  • First Line is maximum capacity of the drive. I am writing this blog on the Win8 server so it’s showing ~20GB.
  • Second line is the size up to which you can shrink it down (not sure how Windows came up with that number but I am sure it can’t shrink it down to that size because there isn’t so much space left on the drive currently).
  • Third line is size of new drive.
  • Fourth line shows the future size of current partition (size after shrinking).
  • Click Shrink. Windows will shrink the partition and you’ll have a Unallocated block as follows

image

  • Right Click on it and select New Simple Volume.

image

  • Follow the wizard and create a new partition ready for setup
  • image
  • imageAllocate maximum (that is selected by default)
  • image
  • imageGive a Volume name identifying it as a Win8 Drive.
  • imageClick Finish.

2. Start Installation

  • Load the Win 8 DP iso by right clicking and Open With->Virtual Clone Drive
  • If the AutoRun comes up don’t start the setup from the AutoRun dialog. Instead select Explore File using Windows Explorer.
  • If you have AutoRun disabled just start Explorer and navigate to the virtual Drive.
  • Here is the kicker. Navigate to G:\Sources\ folder (Replace G: with your Virtual Drive letter), and run the Setup.exe from there. If you don’t do this Window 8 installation doesn’t allow side-by-side install, it will insist on deleting you existing partition and overwriting on it.
  • Once setup starts, point it to the newly created empty Drive as the destination drive. Sit back and get some coffee. All the reboot options default to required settings so pretty much no other intervention is required till you boot up. I again forget exact number of reboots, I think it rebooted thrice for me.

3. Notes and potential Gotchas

  • Since side by side install required writing to the MBR (master boot record) any antivirus worth it’s salt will try to prevent you from doing it. So unfortunately you have to disable the Antivirus for the period of installation.
  • Funnily enough the VM installation found ALL required drivers (except for the generic display). But it connected to Internet etc perfectly. It’s not so rosy on hardware. If you have drivers from your laptop for Windows 7 keep them handy. The initial setup did not recognize among other things – Wireless Adapter, TrackPoint, Chipset etc.
      • Luckily enough I just went to Computer->Properties->Device Manager and for each device that had an exclamation mark select “Update Driver” and pointed it to the folder where all my drivers were. Win 8 picked up the required drivers automatically and applied them. All except the multitouch trackpad which I had to run the Setup for it that came with the laptop.
      • That’s it. You are done. Must say running Win8 (‘on the Metal’) with 8 GB RAM is a much improved experience than running it on a VM with 2GB memory.

With that I end my ‘Setup’ series for Win 8. I promise the next one will be ‘Code to Metal’. Planning to explore WinRT and made a ‘real’ Social App.

Cheers.

Setup Windows 8 Developer Preview as a VM on VirtualBox running on OSX 10.6 (Snow Leopard)

Microsoft launched the Windows 8 Developer Preview today at the Build conference. If you like living on the bleeding edge of technology and want to play around with the release, you need a computer to do a clean install of Windows 8 DP. Fortunately if you don’t have a spare computer to mess with, Virtualization solutions are there to the rescue.

I usually use VMWare on OSX to run all my Windows VMs. However VMWare failed to install the Win8 DP. So I decided to install Oracle (formerly Sun) VirtualBox solution. It supports Windows, OSX and Linux as host OSes.

I am of course assuming you have already downloaded the Win 8 DP iso from Microsoft.

Once you have VirtualBox and Win 8 DP iso, lets get started.

Step 1

Fire up Virtual Box. It will look as follows:

Step 2

Click on ‘New’

Step 3

Click Continue

Step 4: Give the VM a Name.

  • I have given ‘Win8 Dev Preview 1’.
  • Select OS as Microsoft Windows. Version as Window 7 (64 Bit).
  • I am assuming you have downloaded the 64 Bit ISO from MS.

Step 5: Selecting memory for the VM.

This is a very critical step. If you over-allocate memory the VM setup will fail.

  • I selected the maximum available at the time on my machine (3584 MB) and failed to setup the VM first time. I had to reduce it down to 2048 MB (2 GB). Mind you I have a system with 8GB of memory installed.
  • A good indication of free memory can be had by running Activity Monitor on OSX or Task Manager if you are doing it on Windows host system. Rebooting the system before starting might give you some more memory. But remember if you don’t have that much memory later when you try to start the VM, Virtual Box will simply Pause the VM load unless it has the allocated memory (+some more) to play with.
  • Below screenshots show how to check free memory in your system currently

image

Above image of Task Manager shows 932Mb free on this Win7 System.

image

Above image from the Activity Monitor in OSX shows free memory available = 516 MB

The example values are very less because I am running two VMs at the moment, but point to note is you need to make a guess of Memory to allocate to the VM based on the above Free Memory available values. So if you see 2.0 GB free then assign about 1.5 GB. Hope this update helps people who are facing setup issues.

Step 6. Create a New Hard Disk

Step 7.  Select type of Image

I selected VDI.

Step 8. Selecting Storage Type

Keep it Dynamically Allocated unless you want to block off a
portion of your HDD to start off with.

Step 9. Specify the VM file location and Size.

20GB is default and it worked for me. My installation left
about 6 GB of the 20 GB left

Step 10. Finish VM Setup

Click Create.

Step 11. Win 8 Installations

Now Click on Start

Step 12. Select source ISO file

Here point it to the iso file you downloaded

Step 13. Fun times begin

Notes:

  • Windows installation will start with the usual wizard interface that you can easily step through.
  • One thing to remember, when it reboots the first time around the ISO will be loaded and you will get a prompt to ‘Press Any Key to Boot from CD/DVD”. DO NOT press any key. Wait for it to boot from the
    virtual HDD. If you press any key by mistake, the installation process will start again. Just cancel out and agree to rebooting the system.
  • I counted 3 reboots. May/may not vary for you.
  • I was able to log in to system using my Hotmail account.
  • Give it a couple of minutes to connect and get all details and also do initial tile setup.
  • 2 GB of memory doesn’t make it a spiffy system.

UPDATE: Some folks have had a hard time in-spite of the tutorial, so that got me thinking and I realized that between the setup failing for me the first time around (that I attributed to lack of memory above) and me getting it working, I also did some configuration changes to the VM that are different from the default shown in Step 10: So here are the final settings that work for me (click to expand). Notice I have enabled Acceleration, given it both the CPU cores to play with (default is 1 only) and given it a healthy dose of Graphics memory. For your system, keep an eye for the Green Line for each setting, don’t stretch beyond the green line in any of the settings. Again, virtualization is tough job simply because of the sheer number of h/w software combinations possible. So if it’s not working for you, sorry to hear that.

VBFinalSettings

UPDATE 2: I just noted on twitter today this site had a very pointed solution to Virtual Box issues on Win 7 http://www.kombitz.com/2011/09/16/status-0xc000025-error-when-installing-windows-8-developer-preview-on-virtualbox/

You can try the above if you are facing the same issue.

Follow

Get every new post delivered to your Inbox.

Join 316 other followers