Tuesday, May 21, 2013

Windows Multi-boot cliff

My laptop has a legacy Windows 7 boot image on it that I want to preserve, but I want to also install Windows 8 and set that up as a development box so I can work on the move if necessary.

I used the built in Disk Management to shrink my Windows 7 partition and create ~200 GB free space, which I left unallocated.

I boot the Windows 8 install disk, create a 128 GB partition and install Windows and some dev tools. Ok so far – I can boot back to Windows 7 whenever I want to.

Next I decide to create another partition for data, so in future I can reinstall Windows without worrying about rebuilding source code repositories’ working folders, etc. I use Disk Management in Windows 8 (WinKey+X to access a handy cheat popup of tools). It warns me that to do this it will need to convert the drive to Dynamic Disks or something. Hmm.

Cancel and reboot to Windows 7. Same thing. Oh well. I can’t be the first person in the world to want more than 3 partitions. I accept the warning and watch as the partitions change from Basic to Dynamic.

I reboot. Windows 8 goes into repair mode and starts fixing things. After a few minutes it lets me login, but I’m worried I didn’t get asked whether I wanted Windows 7 or Windows 8. I reboot. Straight back to Windows 8 – no way to boot to Windows 7.

Disk Management in Windows 8 shows my Windows 8 partition and my new Data partition as both being Basic again. The other partitions are gone – just showing as Unallocated space. Oopsy. Not the end of the world and I intended to rebuild my Windows 7 at some point, just not right now.

Wikipedia has some good info on basic disk partitioning. It seems that there really is a cliff after 3/4 partitions. My laptop already had a small FAT32 partition and a recovery partition that were factory installed, so adding my 5th partition triggered some pretty drastic changes (and a warning I, um, ignored, *ahem*).

TestDisk is a free utility that I ran from within Windows 8 which showed my my old partitions and let me undelete them.

Then I booted from a Windows 7 Repair disk I made ages ago and lobbed into a desk drawer. This auto-detected boot problems and fixed them. Now the pretty Windows 8 boot loader shows me two options: “Windows 8 Enterprise” & “Windows 7 Professional (recovered)” both of which boot.

Thursday, May 2, 2013

APC Smart-UPS 1500

Frequent power cuts have caused my dev workstation to restart unexpectedly a few times recently. This isn’t really a problem for individual desktops, but as this machine runs Hyper-V and hosts 20+ virtual machines there’s some small risk that sudden power failure might leave one or more boxes in an inconsistent state leading to some work to repair them once power is restored. Seems like a no-brainer: stick an uninterruptable power supply (UPS) on and do a clean shutdown before the juice runs out.

I’ve not bought a UPS before so was not really sure what to go for. This Dell Precision T7600 chassis is rated for 1300W, but I’ve no idea what it actually consumes or how variable that might be. In the end I got an APC Smart-UPS 1500 for around £500, which reports my current load, for the workstation and one monitor, as around 20% loading giving 80 minutes of battery time.

Windows Server 2008 R2 detected the battery automatically when I connected the UPS to the server via a USB lead and integrates it with power options just like with a Windows laptop. I configured a new power plan and set the critical level to 50% and the action to Shutdown, which is the only one available, expecting this to initiate the same shutdown you get from Start > Shut Down.

I switched the power to the UPS off and the battery took over. After 30 minutes it got to 50% remaining. A crash message window appeared briefly before the server was dropped. It wasn’t a nice Windows shutdown – it just gutted itself!

Upon power restore we get asked the “unexplained shutdown” question and the VMs are “Off” when I was expecting them to be “Saved”. Not good. More Microsoft stuff that doesn’t work out of the box. Worse is that it all looks OK, until you try it.

Fortunately the UPS comes with its own monitoring system, APC PowerChute, which monitors the battery and does do a proper shutdown. It’s just a shame I have to install some vendor-specific crapware to achieve something that Windows can clearly handle itself (if only it were not bugged).