Today I wanted to add a new iSCSI Lun to my vSphere Lab. I got the following error:
I had this error in the past, see my previous post: vmware-failed-to-get-disk-partition-information. I tried the solution described in my previous post but it didn’t work in vSphere.
So I had to search for another solution. Luckily VMware released a KB document. See KB1008886. In this KB document VMware uses the command esxcfg-vmhbadevs. This command is replaced with a new command called esxcfg-scsidevs.
So I ran the esxcfg-scsidevs command on the service console:
After running the command, write down the following line: Console Device: /dev/sdc. Start Parted and walk through the following steps.
Note: don’t forget to change the /dev/sdb to the device you need to fix. In my case /dev/sdc.
To change the label and partitioning scheme:
Caution: This removes the pre-existing partition table, and any data on the volume is no longer be available. Ensure you are operating against the correct disk.
- Start parted to analyze the existing partition. Print the existing partition information, taking note of the Partition Table, size, and name. Ensure this is the data intended to be removed.
Run the following commands:
[root@esx ~]# parted /dev/sdb
GNU Parted 1.8.1
Using /dev/sdb
Welcome to GNU Parted! Type ‘help’ to view a list of commands.
(parted) print
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- Change the partition table (disklabel) type to msdos. This deletes the pre-existing partitions. Print the partition table again to observe the changes. Quit parted.
Run the following commands:
(parted) mklabel msdos
(parted) print
Disk geometry for /dev/sdb: 0.000-512.000 megabytes
Disk label type: msdos
Minor Start End Type Filesystem Flags
(parted) quit- Return to the VI Client and use the Add Storage wizard again. Choose the same LUN, create a new partition, and format it with a VMFS Datastore as normal.
Thanks a lot. This command saved my life. Do you know how to do it in Esxi 4.0 ? It seems quite different.
Best regards
Paul
Thanks for the post, i done same with Vsphere 4.
Regards,
Thusith.
Thx a lot! Worked for me too! ( vSphere 4 update 1 )
This worked like a charm. Thanks for the info.
Something to keep in mind with regards to this error, this is a very vague error and from my experience I had two issues that were throwing the same error. One, check the block size of your drive, apparently VMware doesn’t support block sizes above 512B. The other problem I had was I was trying to add a 4TB ISCSI drive from my SAN and VMware doesn’t support drives larger than 2TB, at least in the version I’m running.
ESXi 4.0
CPU: 4 x 2.009GHz
RAM: 12GB
Using a SAN that has hardware on their HCL.
This is my home setup so it may not be the same as others, and it’s not really in a production environment, that is my disclaimer.
Doesn’t this delete everything? What good is that? I need to mount a partition that exists with data.