Fixing Home Server VM Restore for Win7

I've been trying to restore my development virtual machine in order to test out some apps, and found out the vmware image must have gotten corrupted. So Windows Home Server backs up all my machines, but in this case wouldn't restore all that well -- yielding a no-boot scenario. So after replacing the Home Server Restore disk with the Windows 7 install disk and booting, I expected to just adjust the boot partition location in BOOT.INI, but was surprised to see that had been done away with.

In it's place is a new command line tool "BOOTREC", but there's requirements on it actually being able to poll the active drive paritions ("active" being the key here).

This link shows how to fix the boot partition for Windows 7. Notice the difference between the legacy use of the hidden, system, readonly BOOT.INI with a command line app.

 http://social.technet.microsoft.com/Forums/en/w7itproinstall/thread/7791044e-db7f-4144-a96c-945299811f58

Now for me, the initial bootrec command wouldn't let me rebuild the boot configuration, instead giving an "element not found" error. Insead, the DISKPART instructions in the post about setting the active disk partition allowed me to get to an BOOTMGR not found error. 

Now Kevon Walcott's solution didn't work on it's own for me, but was the first step:

 

Diskpart

LIST DISK

SELECT DISK (followed by the number of the disk . most likely 0)

LIST PARTITION

SELECT PARTITION (followed by your partition number. most likely 0)

ACTIVE

EXIT

Second step was from Vivian Xing [MSFT], and rebuilt the boot config for the drive itself and the boot list:

 

Bcdboot C:\windows

 

NOTE: Replace C with the drive letter where the system is installed.

 

BOOTREC /FIXMBR

BOOTREC /FIXBOOT

BOOTREC /REBUILDBCD

BOOTREC /SCANOS

 

Rebooting gave me a "BOOTMGR is missing" error. Bouncing the machine a 3rd time, and using the windows system recovery option to repair the installation at least let me try. However so far, the error "BOOTMGR is missing" is still present. So far, Win7: 1, Me:0.

 

Restarting the VM and again rebooting into windows system recovery gave me the message that the disk I was trying to repair with was not the right media for the installation (note: took a bit to realize the installation was Win7 Pro x64, and I had Win7 Ultimate media in the drive).

 

Putting the right media in this time, and now it's just saying Windows. Use the command prompt, bcdboot c:\windows AGAIN, and choose startup repair again. More repeated failures, and another restore from home server -- this time adjusting the partitions in Disk Manager in the restore window.

 

 

Posted on 6/10/2010 9:52:00 PM by Jason Nadal

Permalink | Comments |

Categories: personal | troubleshooting | virtualization | windows

Tags:

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Corrupted Suspended VMWare VM How to discard suspended state

Oh boy is this one fun... so you like having your VMWare images (virtual machines) on a separate hard drive, so they run faster. You have your PC's OS hard drive on different physical hardware than the VMWare image. Here comes the fun part -- you love the portability of being able to move the hard drive from machine to machine, running the virtual machine on both VMWare Workstation and VMWare player. You suspend your VM when you're done for a while, and resume it later on, sometimes on a different PC. You always safely remove your hardware using the windows OS tools, until one fateful day.

You unplug the harddrive thinking you're done, when you get a windows error message: "Delayed Write Failed". Uh oh.

You've just corrupted your saved state. This is because even though vmware said it was done writing the ram out to disk, it really was still writing... this way you could still work in the background!

OK, you think -- as far as the VM is concerned, the RAM is corrupt (or rather the data stored in virtual RAM is corrupt). How can we get this back?

The easy way is to close your vm software of choice (vmware player or workstation), rename your *.vmem file (a file containing the contents of the virtual ram), and start up the virtual machine again.

It will die. You'll get a message saying the vmem file cannot be found, and there's something corrupt with the saved state... do you want to preserve or discard?

You should select "Discard", and then start up the VM again. This time it'll boot up, just like windows crashed (do you want to enter safe mode? no.). You should still have all of your data (assuming nothing was acting on the data in RAM as you were suspending, in which case you can add data loss to your list of accomplishments for the day.

Posted on 5/4/2009 6:47:00 PM by Jason Nadal

Permalink | Comments |

Categories: network | troubleshooting | windows | virtualization

Tags: , , , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Compaq/HP Hardware Woes

Told a friend I'd fix their wireless issue after the manufacturer quoted them $1k for a simple wireless fix. Turns out that's not actually (that) crazy (if you consider how overpriced their parts are). This laptop, a compaq presario v6133 (from the v6000 line) has the nice 'feature' of a non-working fan sensor / regulator.

The good is that it runs nice & quiet... the bad is that it'll just burn itself out. Guess what part of the mobo dies first? Nope, not the CPU, not the RAM, and not even the northbridge -- it's the good old onboard WIFI adapter.

What might actually save this laptop is an addendum to the (expired) 1 year warranty, declaring free fix & free shipping for this issue as long as it's w/in 2 years. It's declared as an "HP Limited Warranty Service Enhancement".

Otherwise, it's a BIOS update (to fix the fan control, not the damage already caused), and an external card -- or an ebay of the MOBO.

It's pretty sad, actually -- it's rare that someone drops off their PC that's fully virus and malware protected, with proper restore points & generally in perfect working order.

Posted on 4/27/2009 9:47:00 PM by Jason Nadal

Permalink | Comments |

Categories: hardware | troubleshooting

Tags:

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Crushed Computer

Working on trying to repair a friend's PC, I've encountered a hard drive so toasted, the file system is unrecognizable. The funny thing is that there's actually no "click of death" coming from the disk, but even a FIXMBR failed to recognize the old school FAT file system ("unrecoverable errors", file names that are all smiley faces (!), and my personal favorite, the reporting of the size as "10,XXX kilobytes" -- ouch!).

So I'm installing a fresh OS on the machine and giving it back as a pristine machine.... sans all saved data, documents, personal information, and settings.

Makes me feel a bit defeated....

Posted on 1/5/2009 9:34:00 PM by Jason Nadal

Permalink | Comments |

Categories: General | network | troubleshooting | windows | hardware

Tags: , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

The Longest 60 Seconds

I moved servers within our location at work today. While it was a pretty physical workout (servers containing many drives & redundant power supplies make for some heavy lifting), it was much more mentally draining.

It's amazing how long & panicked the wait between powering up a RAID array is, and the time it states it's fully functional is. All went well, and Hyper-V is right where it belongs. I could actually feel my heart beating in my chest as I watched the lights cycle... finally rendering their blue verdict.

My only complaint so far with Hyper-V in Windows 2008 is the weak support of P2V (that is, Physical to Virtual conversion). I've got some pretty dated win 2000 servers that I'd like to retire, but it seems I need to create the VM's the old-fashioned way, through windows install disks, and manually copying the data over. The only other issue so far I've found with windows 2008 is the difficulty in Apple machines getting an IPv4 address through DHCP on a Windows 2008 server. Hopefully I'll find a way around that, since I can force people to use Windows.

Posted on 10/24/2008 8:22:00 PM by Jason Nadal

Permalink | Comments |

Categories: network | troubleshooting

Tags: , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Failure, the #1 Teacher

I've had pretty much my entire adult life as experience in diagnosing, troubleshooting, and usually repairing various computer woes. The best lessons were usually after catastrophic mistakes (which I committed, naturally).

 When I was about 13, I managed to reverse polarity on a 4-pronged power cord, and shorted out my pc. The magic smoke escaped (it's blue, apparently!), and a loud snap & that burning smell you never want to associate with hardware were suddenly present. Needless to say there were casualties. Surprisingly, most everything survived -- except for the power supply (to be fair, it was mostly dead to start with) and the hard drive. This was when I was heavy into Pascal programming, and I lost quite a bit of computer time. When you're only 13, replacing a power supply and a hard drive take months (the drive was only 40mb, but weighed about 15 pounds). I learned my lesson about polarities, though!

So how does this relate to development? Well, if you write code that performs poorly, there's obvious repercussions. In a similar vein, when code that is not scalable, or scales poorly reaches production, the flaws can become readily apparent. The ideal scenario would be to be able to recognize poor code / poor situations by sight, and have a common plan of action to address them.

Enter "Anti-patterns". These are an attempt to document types of common mistakes seen in the wild, so to speak, and give a sample way to refactor to 'better' code. Someone has actually registered "antipatterns.com", to address some of those concerns. These may be with development, and they also may be with project managment. Not everything is on their site, but what is there is pretty insightful. Check it out here... 

Posted on 10/11/2008 8:33:00 PM by Jason Nadal

Permalink | Comments |

Categories: development | patterns | troubleshooting

Tags: , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Retrofitting Unit Tests -- NCover to the rescue

Writing unit tests is the right thing to do to provide regression testing and just provide some proof that things work how they should. They are the safety net that make sure that when you change the facing on the capstone that the rest of the arch won't collapse.

That being said, one does not always get the opportunity to invest the time it takes to get past that big learning curve to make it part of the daily toolbelt. But knowing unit testing will help in the long term, you get the itch to add them after the fact.

The problem is that they're much harder to just tack on as methods aren't guaranteed to be truly granular in their purpose. Methods and classes tend to be responsible for too much. So how can you write tests to cover all of the responsibilities?

The simplest answer is to write to what you know. I know that Method FastCash() logs into my bank account and withdraws $60. So I write a unit test to check a good login, bad login, pad pin number, scenario where I have $60 to withdraw, and a scenario where I'd be overdrawn. Seems like a decent bunch of simple tests for the FastCash() method, right?

Well, by using NCover, you can run coverage reports on your unit tests. When I do this, I discover i'm only hitting 67% of the logic of the FastCash method. As it turns out, there's a third bit of functionality in there -- automatically, it assumes you choose the Checking account. NCover shows you the lines that are not getting hit by your unit tests, and allows you to specifically target those additional scenarios you weren't truly testing.

I was able to put this into good use today while finding some pure business logic classes. That makes it much more simple to write unit tests for as there are minimal dependancies and coupling occasional, and a great opportunity for well defined acceptance criteria. Both make it that area of code a natural fit for unit testing.

Posted on 10/10/2008 6:21:00 PM by Jason Nadal

Permalink | Comments |

Categories: development | software | troubleshooting | tdd

Tags: , , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Vista UAC Meltdown -- With Solution

Recently, I swapped out the last machine I had on XP, a 5 year old laptop, to Vista. I even got my wife a Vista box, and things went mostly smoothly. Until she came to me one day and said things weren't working.

I dug around for a while, and tried to get into the management console as admin, sure enough a UAC dialog beep sounded, but there was no dialog asking for elevation of privileges. That's when things went crazy -- there was no dialog, but the system was still waiting for input. The screen didn't dim with the protected desktop, and the app that was asking for permission was hung. Alt-Tab worked except for the hung tab -- but no windows/apps could be closed/exited.

I pulled out the standard tricks to combat the situation, all failures, and finally went to safe mode. Even that failed to pull up the dialog. It wasn't drivers, it wasn't registry. Then came the last straw. I restored a backup of the machine from before the problem -- it didn't work!

Gave up for a night, and the next day she mentioned: "Oh, and the date's wrong". So I figure, ok.. i'll just change the date. But you can't because it requires UAC! I was fed up and booted into BIOS to fix the date, laughing -- at least I can fix this, I thought.

The punchline?

Changing the date fixed UAC. The machine was set to a year in the future. The worst part of this is that the PC should not have known it was a year in the future... is Windows phoning home on UAC requests? What's really going on with the time/date settings?

Posted on 10/2/2008 7:27:00 PM by Jason Nadal

Permalink | Comments |

Categories: windows | vista | troubleshooting

Tags: , , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5