Source VMWARE.
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. These steps describe how to clear partitioning information for a LUN under ESXi.Warning: This process will destroy data on the target device. 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.
- Open a console to the ESX or ESXi host.
- Identify the disk device in question from the log messages. For example:
/vmfs/devices/disks/vml.0200030000600508b30093fcf0a05b5b8cc739002f4d5341313531
- Use the
fdiskcommand to obtain the exact size of the target disk device in bytes:fdisk -l "/vmfs/devices/disks/DeviceName"
The output appears similar to:Disk /vmfs/devices/disks/DeviceName: 536 MB, 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/vmfs/devices/disks/DeviceName1 128838850039 419424956 ee EFI GPT
- Use the dd command to erase the first 34 sectors (34x512 bytes) of the disk device with zeros:
dd if=/dev/zero of="/vmfs/devices/disks/DeviceName"bs=512 count=34 conv=notrunc
Caution: This operation deletes the partition table and master boot record on the disk device. The changes take effect immediately. This results in data loss and cannot be reverted.
- The GPT partition scheme stores a backup of the partition table
at the end of the disk device. Erase the last 34 sectors of the device
as well:
- Determine the offset at which the last 34 sectors begins:
(SizeInBytes / 512) - 34 = SeekOffset
For example, using the values in step 3:(429491220480 / 512) - 34 = 838850006
- Use the dd command to erase the last 34 sectors of the disk, starting at the offset found in step 5a:
dd if=/dev/zero of="/vmfs/devices/disks/DeviceName" bs=512 count=34 seek=SeekOffset conv=notrunc
Caution: This operation deletes the partition table and master boot record on the disk device. The changes take effect immediately. This results in data loss and cannot be reverted.
- Determine the offset at which the last 34 sectors begins:
- Depending on the original contents of the disk device, it may be necessary to erase a larger amount of data on the disk.
- Retry the storage operation.
http://www.eversity.nl/blog/2010/08/call-fails-for-hostdatastoresystem-queryvmfsdatastore-createoptions-for-object-ha-datastoresystem/
http://www.digital52.com/help/gptremoval.html
No comments:
Post a Comment