Wednesday, September 23, 2015

Installing ESXi - Operation Failed "Unable to read partition table for device"

In process of re-purposing an existing a Hyper-V host as a VMware ESXi host - no apologies, by the way - I've ran into this error a few times.


The installation process usually consists of re-sizing the original OS mirrored disk set virtual disks as one 32GB virtual disk and the remaining space as a secondary space to utilize as a utility datastore later for vSphere.



So, what's the reason for the this error? Well, the RAID controller didn't and wasn't told to zero out the disks during the changes to the virtual disks. The end result is the original partition table that was saved on the 278GB virtual disk is visible on the new 32GB virtual disk.

To fix this, we need to either create a new partition table or zero out the partition table data.

Two easy ways, is use dd or GParted on a linux distro live boot disk - Lubuntu is my first go-to.

With dd (to zero out the partition table data):
  1. Open a terminal window

  2. Run the command: dd if=/dev/zero of=/dev/sda bs=512 count=1
    • Note: you may need to run as sudo or elevate to su
With GParted (to create a new partition table):
  1. Open GParted

  2. Click Device, and select Create Partition Table...

  3. Click Apply

Monday, September 21, 2015

Disable Start Menu Win+X Hidden Context-Menu

I was hoping to find a GPO (Group Policy Object) setting to disable the hidden context menu for the Start Menu (a.k.a. Win+X) in Windows 8 / 8.1 / 2012 / 2012 R2. I did find the menu items are shortcuts under C:\Users\AUser\AppData\Local\Microsoft\Windows\WinX under Group1-3 folders. I was able to effectively disable the Win+X Menu by moving the Group 2 and Group 3 folders out - so my public terminal users can't have access to those shortcuts.

I still hope to be WOW'd by a GPO setting some day, but until then...

Here's a PowerShell script I launched on each of my Remote Desktop Sessions hosts to effectively disable the Win+X menu:
#kill start menu right-click context menu
$folder = "C:\Users\Default\AppData\Local\Microsoft\Windows"
mkdir $folder\WinX.org
Move-Item -Path $folder\WinX\group[2-3] -Destination $folder\WinX.org
Formatted for web with http://codeformatter.blogspot.com/ 

Before:





Ran the script:

After a log-off and back in (my user profiles are non-persistent):



Note: If you have existing persistent user profiles, you'll need to go through each profile and remove the Group# folder you're targeting. If you need to update all users, here's that script too - you're welcome.

$users = (Get-ChildItem C:\Users -Directory -Exclude "Public", "Administrator").FullName
foreach ($user in $users) {
 $folder = "$($user)\AppData\Local\Microsoft\Windows"
 mkdir $folder\WinX.org
 Move-Item -Path $folder\WinX\group[2-3] -Destination $folder\WinX.org
}
Formatted for web with http://codeformatter.blogspot.com/