Wednesday, March 24, 2010

While Adding LUN to ESX Error --> Unable read partition information from this disk error

Troubleshooting the Add Storage Wizard error:
Unable read partition information from this disk error

Extracted from --> VMware Kbase (Link here)

Caution: Ensure that the selected disks or LUNs do not have production information as this is a destructive operation.
Symptoms

*Cannot use the Add Storage Wizard to format a disk with a new VMFS Datastore
*Creating a VMFS volume in VMware Infrastructure (VI) Client fails
*The Wizard reports that it is unable to read the pre-existing partition table from the disk
*You receive the following error:

Unable to read partition information from this disk

*The available LUN listing shows a blank in the free space column
*You see a message indicating that the ESX host cannot read the partition table
*The hostd logs contain entries similar to:

[2009-01-26 12:56:20.647 'Partitionsvc' 21990320 info] InvokePartedUtil /sbin/partedUtil
[2009-01-26 12:56:20.706 'Partitionsvc' 21990320 warning] Unable to get partition information for /vmfs/devices/disks/vml.0200030000600508b30093fcf0a05b5b8cc739002f4d
5341313531
[2009-01-26 12:56:20.706 'Partitionsvc' 21990320 warning] Status : 255
Output:
Error : Warning: /vmfs/devices/disks/vml.0200030000600508b30093fcf0a05b5b8cc
739002f4d5341313531 contains GPT signatures, indicating that it has a GPT table. However, it does not have a valid fake msdos partition table, as it should. Perhaps it was corrupted - possibly by a program that doesn't understand GPT partition tables. Or perhaps you deleted the GPT table, and are now using an msdos partition table. Is this a GPT partition table?
Error: The primary GPT table is corrupt, but the backup appears ok, so that will be used.
A bug has been detected in GNU parted. Please email a bug report to bug-parted@gnu.orgcontaining the version (1.6.3) and the following message:Assertion (last_usable <= disk->dev->length) at disk_gpt.c:480 in function _parse_header() failed.
Unable to read partition table for device /vmfs/devices/disks/vml.0200030000600508b30093fcf0a05b5b8cc
739002f4d5341313531

*Rescan and ESX boot operations experience long delays (40 - 120 seconds for each LUN with an EFI GPT partition)
*The Add Storage wizard times out while getting the list of available LUNs

Purpose
This article addresses the situation of an ESX host being unable to create a datastore because the volumes contain an existing non-msdos partition table.
Resolution
Cause
There are several different partitioning schemes that can be created. Each has a corresponding identifying disk label. Common labels include bsd, dvh, gpt, loop, mac, msdos, pc98 or sun. Of these, only the msdos label and partitioning scheme is used by ESX. Trying to create a volume using the Add Storage wizard fails unless the volume contains an msdos partition table or if there is no partition table at all. Any other kind of partition is left unchanged.
Note: Similar symptoms have been observed when a LUN which is greater than 2 terabytes is presented to an ESX host. For more information, see ESX does not support 2 terabyte LUN sizes (3371739).
Checking for non-msdos partitions

To check for non-msdos partitions:

1.Log into the ESX host console using an SSH client or the GUI. For more information, see Unable to connect to an ESX host using Secure Shell (SSH) (1003807).
2.Run the command:

fdisk -l

The output is similar to:

Disk /dev/sdb: 536 MB, 536870912 bytes
255 heads, 63 sectors/track, 65 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 66 524287+ ee EFI GPT
3.Make note of the Id and System values (highlighted in red). Depending on the value of these fields, ESX may not be able to perform operations to this disk. To allow ESX to make any modifications to this volume, the volume must have an msdos partition or no partition at all.

Changing the partition type in the ESX Service Console using the parted utility
The command line utility parted can be used in the Console operating system to change the label and partitioning scheme.
Warning: To support certain internal operations, ESX installations include a subset of standard Linux configuration commands (for example, network and storage configuration commands). Using these commands to perform configuration tasks can result in serious configuration conflicts and render some ESX functions unusable. Always work through vSphere Client when configuring ESX, unless otherwise instructed in vSphere documentation or by VMware Technical Support. The steps outlined here are potentially hazardous for your environment if they are not followed exactly. If you are not comfortable performing these steps, contact VMware Technical Support and work with them to resolve the issue.
To change the label and partitioning scheme:

1.Log into the ESX host console. For more information, see Tech Support Mode for Emergency Support (1003677).
2.Identify the LUN or disks which have pre-existing partition tables. For more information, see Identifying disks when working with VMware ESX (1014953).

Caution: Ensure that the selected disks or LUNs do not have production information as this is a destructive operation.
3.Run the command:

parted

Where is the disk or LUN identifier selected in step 2.

The following is an example output using the /dev/sdb identifier:

GNU Parted 1.8.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
4.Within the (parted)prompt, run the command:

print

The output appears similar to:

Disk geometry for /dev/sdb: 0.000-512.000 megabytes
Disk label type: gpt
Number Start End Size File system Name Flags
1 17.4kB 134MB 134MB Microsoft reserved partition msftres
5.Review all of the information and ensure that this drive or LUN is not used for production information.
6.Within the (parted) prompt, run the following command to change the Disk label type to msdos:

mklabel msdos

Caution: The above operation deletes the pre-existing partitions.
7.Within the (parted) prompt, run the command:

print

The output appears similar to:

Disk geometry for /dev/sdb: 0.000-512.000 megabytes
Disk label type: msdos
Minor Start End Type Filesystem Flags
8.Within the (parted) prompt, run the following command to exit the parted utility:

quit
9.Retry the storage operation which was failing initially.

Clearing partitioning information in ESXi using the DD utility
Due to differences between ESX classic and ESXi, the parted utility is not available in ESXi. The following steps describe how to clear partitioning information for a LUN under ESXi.
Warning: The steps outlined here are potentially hazardous for your environment if they are not followed exactly. If you are not comfortable performing these steps, contact VMware Technical Support and work with them to resolve the issue.

1. Log into the ESX host console or via SSH. For more information, see Unable to connect to an ESX host using Secure Shell (SSH) (1003807).
2. Identify the LUN or disks which have pre-existing partition tables. For more information, see Identifying disks when working with VMware ESX (1014953).

Caution: Ensure that the selected Disks or LUNs do not have production information as this is a destructive operation.
3. Run the command:

fdisk -u

Where represents the select disk from step 2.

The output appears similar to:

Disk /dev/disks/vmhba2:0:3:0: 429.4 GB, 429491220480 bytes
255 heads, 63 sectors/track, 52216 cylinders, total 838850040 sectors
Units = sectors of 1 * 512 = 512 bytes

Device Boot Start End Blocks Id System
/dev/disks/vmhba2:0:3:1 128 838850039 419424956 ee EFI GPT
4. Make note of the bytes value highlighted in red.
5. Run the command:

dd if=/dev/zero of=/ bs=512 count=34

Where is the LUN or Disk selected in step 2.

Caution: This replaces the first 34 x 512 bytes of the disk with zeros. This is a destructive command.

Note: If you are using VMware ESXi or the you are specifying is located within the /vmfs/ directory, you may need to append the conv=notrunc parameter to the dd command. Not doing so may result in a Function not implemented error.
6. (GPT Partitions only) Calculate the value by using the following equation:

( / 512) - 34 =

For example:

(429491220480 / 512) - 34 = 838850006

Note: value is the value recorded in step 4.
7.(GPT Partitions only) Run the command:

dd if=/dev/zero of= bs=512 count=34 seek=

Where is the value calculated in step 6, and is the identified identified in step 2.

Caution: This replaces the last 34 x 512 bytes of the disk with zeros. This is a destructive command.
8. Retry the storage operation.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.