I attempted to add a disk to a VMware ESXi 5.0. The system recognized the drive, but would not allow me to add it as a datastore. The disk had data on it, but I did not care and just wanted to format it to add it my datastores. Conveniently, I actually was able to use fdisk much that same way I would in linux to delete all the partitions. I found this much easier than some of the other solutions I found.

Note: I removed some of the “_” in the disk names to preserve the format.

To list the disks installed:

~ # fdisk -l

Disk /dev/disks/t10.ATA_____WDC_WD1600AAJS2D60Z0A0_…_WD2DWCAV3C053389: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/disks/t10.ATA_____WDC_WD1600AAJS2D60Z0A0_…_WD2DWCAV3C053389p1 * 1 16072 129090560 7 HPFS/NTFS
/dev/disks/t10.ATA_____WDC_WD1600AAJS2D60Z0A0_…_WD2DWCAV3C053389p2 19072 19456 3087360 7 HPFS/NTFS
/dev/disks/t10.ATA_____WDC_WD1600AAJS2D60Z0A0_…_WD2DWCAV3C053389p3 16072 19072 24100864+ f Win95 Ext’d (LBA)
/dev/disks/t10.ATA_____WDC_WD1600AAJS2D60Z0A0_…_WD2DWCAV3C053389p5 16072 17325 10066944 b Win95 FAT32
/dev/disks/t10.ATA_____WDC_WD1600AAJS2D60Z0A0_…_WD2DWCAV3C053389p6 17325 18616 10371072 b Win95 FAT32

Partition table entries are not in disk order

Disk /dev/disks/t10.ATA_____WDC_WD2502ABYS2D18B7A0_…_WD2DWMAT16698967: 250.0 GB, 250000000000 bytes
64 heads, 32 sectors/track, 238418 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot Start End Blocks Id System
/dev/disks/t10.ATA_____WDC_WD2502ABYS2D18B7A0_…_WD2DWMAT16698967p1 5 900 917504 5 Extended
/dev/disks/t10.ATA_____WDC_WD2502ABYS2D18B7A0_…_WD2DWMAT16698967p2 901 4995 4193280 6 FAT16
/dev/disks/t10.ATA_____WDC_WD2502ABYS2D18B7A0_…_WD2DWMAT16698967p3 4996 238419 239025745 fb VMFS
/dev/disks/t10.ATA_____WDC_WD2502ABYS2D18B7A0_…_WD2DWMAT16698967p4 * 1 4 4080 4 FAT16 <32M /dev/disks/t10.ATA_____WDC_WD2502ABYS2D18B7A0_..._WD2DWMAT16698967p5 5 254 255984 6 FAT16 /dev/disks/t10.ATA_____WDC_WD2502ABYS2D18B7A0_..._WD2DWMAT16698967p6 255 504 255984 6 FAT16 /dev/disks/t10.ATA_____WDC_WD2502ABYS2D18B7A0_..._WD2DWMAT16698967p7 505 614 112624 fc VMKcore /dev/disks/t10.ATA_____WDC_WD2502ABYS2D18B7A0_..._WD2DWMAT16698967p8 615 900 292848 6 FAT16 Partition table entries are not in disk order

To make changes to a disk select the correct that you previously listed. I put quotes around the name. I do not know if you need to do that.:

~ # fdisk /dev/disks/”t10.ATA_____WDC_WD1600AAJS2D60Z0A0_…_WD2DWCAV3C053389″

To display the current disk partitions I am trying to add:

The number of cylinders for this disk is set to 19457.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/disks/t10.ATA_____WDC_WD1600AAJS2D60Z0A0_…_WD2DWCAV3C053389: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/disks/t10.ATA_____WDC_WD1600AAJS2D60Z0A0_…_WD2DWCAV3C053389p1 * 1 16072 129090560 7 HPFS/NTFS
/dev/disks/t10.ATA_____WDC_WD1600AAJS2D60Z0A0_…_WD2DWCAV3C053389p2 19072 19456 3087360 7 HPFS/NTFS
/dev/disks/t10.ATA_____WDC_WD1600AAJS2D60Z0A0_…_WD2DWCAV3C053389p3 16072 19072 24100864+ f Win95 Ext’d (LBA)
/dev/disks/t10.ATA_____WDC_WD1600AAJS2D60Z0A0_…_WD2DWCAV3C053389p5 16072 17325 10066944 b Win95 FAT32
/dev/disks/t10.ATA_____WDC_WD1600AAJS2D60Z0A0_…_WD2DWCAV3C053389p6 17325 18616 10371072 b Win95 FAT32

Partition table entries are not in disk order

Delete the primary partitions:

Command (m for help): d
Partition number (1-6): 1

Command (m for help): d
Partition number (1-6): 2

Command (m for help): d
Partition number (1-6): 3

List to verify the partitions are deleted:

Command (m for help): p

Disk /dev/disks/t10.ATA_____WDC_WD1600AAJS2D60Z0A0_…_WD2DWCAV3C053389: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

Create one large partition on the drive. This probably did not need to be done.:

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-19457, default 1): Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-19457, default 19457): Using default value 19457

Write or save the new configuration. This is the point of no return.:

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table

List the saved partition scheme.:

~ # fdisk -l /dev/disks/”t10.ATA_____WDC_WD1600AAJS2D60Z0A0_…_WD2DWCAV3C053389″

Disk /dev/disks/t10.ATA_____WDC_WD1600AAJS2D60Z0A0_…_WD2DWCAV3C053389: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/disks/t10.ATA_____WDC_WD1600AAJS2D60Z0A0_…_WD2DWCAV3C053389p1 1 19457 156288321 83 Linux

~ #