Skip to main content

LUN VMFS partition table corrupted

Last week I got an issue where customer was having issue where one of the shared LUN got disappeared from all the ESXi host.

Well, while troubleshooting I found some error found in vmkernal.log

2017-11-30T06:47:09.272Z cpu78:12160496)WARNING: Partition: 1224: Partition 1 is active, failure to update partition table for naa. 600666666666666666666
2017-11-30T06:47:09.422Z cpu78:12160496)WARNING: Partition: 1224: Partition 1 is active, failure to update partition table for naa. 600666666666666666666

Try to verify if the LUN is attached to ESXi by using below command and found its connected.
esxcli storage core path list OR esxcfg-mpath -l

Later, Verified if the LUN status is showing online, degraded or offline by using command esxcli storage core device list -d NAA_ID

At present, I was able to see the LUN status online. However the LUN is still not visible in device section.

From the vmkernal.log error which was mentioned above “WARNING: Partition: 1051: Partition 1 is active, failure to update partition table for naa.0000000000000000” which indicate that the partition table is corrupted and require to recreate the partition table.

From the below we can observe that the datastore is missing the partition table information,
PartedUtil getptbl/vmfs/devices/disks/naa.000000000000000

Here you will get the output like this.
31121 255 63 499974144
1 2048 499974110 AA31E02A400F11DB9590000C2911D1B8 vmfs 0

If your output appears similar to the following, it indicates the partition is missing:

31121 255 63 499974144

Now to find the beginning and end of VMFS partition run below script on ESXi host.

# offset="128 2048"; for dev in `esxcfg-scsidevs -l | grep "Console Device:" | awk {'print $3'}`; do disk=$dev; echo $disk; partedUtil getptbl $disk; { for i in `echo $offset`; do echo "Checking offset found at $i:"; hexdump -n4 -s $((0x100000+(512*$i))) $disk; hexdump -n4 -s $((0x1300000+(512*$i))) $disk; hexdump -C -n 128 -s $((0x130001d + (512*$i))) $disk; done; } | grep -B 1 -A 5 d00d; echo "---------------------"; done

Now if you see the readable value in the output field then we can create recreate the partition table. However, if we see the output into unreadable format and getting error that means it is quite possible that there are rare chance to re-create the partition table.

Option 1 (Where the output is showing readable output)
By running the above script you will get the first block of VMFS which is ideally 128 (in case of 5.5) and 2048 in case of (5.1 and above)

To get the end block for the partition, run this command:

# partedUtil getUsableSectors /vmfs/devices/disks/naa.000000000000 gpt “1
Output comes as:
34 499974110

If running the above command if you are not able to get the specified output and receiving the error stating “Partition table invalid, unable to satisfy all constraints on the partition.. or something similar to that.

Try below command which create the temporary partition and after that you can read the disk information

# partedUtil setptbl /vmfs/devices/disks/naa.0000000000000 gpt "1 2048 4123456 AA31E02A400F11DB9590000C2911D1B8 0"

Now run the command to set the correct value of first and last block
# partedUtil setptbl /vmfs/devices/disks/naa.6006016045502500c20a2b3ccecfe011 gpt "1 2048 499974110 AA31E02A400F11DB9590000C2911D1B8 0"

Now, last run this command to attempt to mount the VMFS datastore:

# vmkfstools –V

If nothings works as above, then please log a case with VMware support to get assistance.

Please comment me if you have any further queries.

Happy Sharing … J


Post a comment

Popular posts from this blog

Changing the FQDN of the vCenter appliance (VCSA)

This article states how to change the system name or the FQDN of the vCenter appliance 6.x You may not find any way to change the FQDN from the vCenter GUI either from VAMI page of from webclient as the option to change the hostname always be greyed out. Now the option left is from the command line of VCSA appliance. Below steps will make it possible to change the FQDN of the VCSA from the command line. Access the VCSA from console or from Putty session. Login with root permission Use above command in the command prompt of VCSA : /opt/vmware/share/vami/vami_config_net Opt for option 3 (Hostname) Change the hostname to new name Reboot the VCSA appliance.   After reboot you will be successfully manage to change the FQDN of the VCSA . Note: Above step is unsupported by VMware and may impact your SSL certificate and face problem while logging to vSphere Web Client. If you are using self-signed certificate, you can regenerate the certificate with the

VM Creation Date & Time from Powercli

Most of the times we have several requirement when we talk about IT environment like designing , deployment , compliance check or for Security auditing the environment. Somewhere during security auditing we require to provide several information to security team to get successful audit. One of them is the compliance of Virtual machine auditing of creation date and time. Here into this post we will explore how to get the creation date and time of virtual machine hosted into the vCenter or ESXi. To get the details we will use VMware Powercli to extract the details. By default there is no function added into Powercli to get such details, so here we will add a function of vm creation date. Below is the function which needed to be copy and paste into the Powercli. ======================================================================= function  Get-VMCreationTime  {     $vms  =  get-vm     $vmevts  = @()     $vmevt  =  new-object  PSObject     for

Unable to poweron the VM. (Failed to lock the file)

I have encountered may issues like where after some upgrade or migration we were unable to power on the VM. Figure 1 An error was received from the ESX host while powering on VM HSSVSQL01. Failed to start the virtual machine. Cannot open the disk '/vmfs/volumes/578d835c-18b2c97a-9b0d-0025b5f13920/SAMPLE1_cloud/000000.vmdk' or one of the snapshot disks it depends on. Failed to lock the file In above Figure:1, where while powering on the VM, its prompt for an error. Well, there are several reason for where the VM unable to poweron and you can find many article on this. Here in this article we will discuss to resolve this issue. Please use below step to resolve the disk lock issue  C hecked that VM is running on snapshot if its getting error " VM Consolidation required". Checked the snapshot manager if its showing any snapshot. If yes, try to delete the  snapshot. Verified the same from Esxi cl