Mounting a VMFS5 volume fails with the error: Read from primary gpt table failed
search cancel

Mounting a VMFS5 volume fails with the error: Read from primary gpt table failed

book

Article ID: 341569

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction






Symptoms:
  • A VMFS5 volume fails to mount.

  • In the /var/log/vmkernel.log, you see entries similar to:

    cpu12:23535238)Partition: 644: Read from primary gpt table failed on "naa.60060160bc613c001985de04fbdee411".
    cpu12:23535238)FSS: 5092: No FS driver claimed device 'naa.60060160bc613c001985de04fbdee411:1': Not supported

  • When trying to read the GTP table info using the partedUtil command, you see this error:

    Error: The primary GPT table is corrupt, but the backup appears OK, so that will be used. Fix primary table ? diskPath (/dev/disks/naa.60060160bc613c001985de04fbdee411) diskSize (xxxxxxxxx) AlternateLBA (1) LastUsableLBA (xxxxxxxxxxx)


Environment

VMware vSphere ESXi 5.0
VMware vSphere ESXi 5.1
VMware vSphere ESXi 6.0
VMware vSphere ESXi 5.5

Cause

This issue occurs if the primary GPT table is corrupted.

Resolution

To resolve this issue, use the partedUtil utility to recover the primary GTP table from the secondary GPT table, using the fixGpt option:

  1. If the volume is still mounted on an ESXi host, identify the device ID mapped to by a given datastore name by using this command:

    esxcfg-scsidevs -m

    You see output similar to:

    naa.60060160bc613c001985de04fbdee411:1 /vmfs/devices/disks/naa.60060160bc613c001985de04fbdee411:1 55270b5e-16411bb7-9012-a0369f356970 0 DATASTORE_NAME

    where
    DATASTORE_NAME is the name of the datastore.

    For more information, see Identifying disks when working with VMware ESXi/ESX (1014953).

  2. Confirm that the device has a corrupted GTP table by using this command:

    partedUtil getptbl /vmfs/devices/disks/naa.ID

    Where naa.ID is the naa ID of the partition to evaluate, reported in the /var/log/vmkernel.log file.

    For Example (using the partition identified in step 1):

    # partedUtil getptbl /vmfs/devices/disks/naa.60060160bc613c001985de04fbdee411
    Error: The primary GPT table is corrupt, but the backup appears OK, so that will be used. Fix primary table ? diskPath (/dev/disks/naa.60060160bc613c001985de04fbdee411) diskSize (4294967296) AlternateLBA (1) LastUsableLBA (4294967262)
    gpt
    267349 255 63 4294967296
    1 2048 4294967262 AA31E02A400F11DB9590000C2911D1B8 vmfs 0


  3. To fix the partition table, ensure the datastore is not a Raw Device Mapping (see Note), and then run this command:

    partedUtil fixGpt /vmfs/devices/disks/naa.ID

    Wherenaa.ID is the naa ID of the partition to fix, reported in the /var/log/vmkernel.log file.

    For Example (using the partition identified in step 1):

    # partedUtil fixGpt /vmfs/devices/disks/naa.60060160bc613c001985de04fbdee411

    Note: Ensure the device is not a Raw Device Mapping, and answer "Y" when you get this message:XXXXX

    FixGpt tries to fix any problems detected in GPT table.
    Please ensure that you don't run this on any RDM (Raw Device Mapping) disk.
    Are you sure you want to continue (Y/N): Y
    gpt
    267349 255 63 4294967296
    1 2048 4294967262 AA31E02A400F11DB9590000C2911D1B8 vmfs 0

    For information on how to identify virtual disks which are Raw Device Mappings (RDMs), see Identifying virtual disks pointing to Raw Device Mappings (RDMs) (1005937).

  4. Rescan the VMFS volumes by running this command:

    vmkfstools -V


Additional Information

To manually recreate a partition entry on a datastore, see Using the partedUtil command line utility on ESXi and ESX.Identifying virtual disks pointing to Raw Device Mappings (RDMs)
Identifying disks when working with VMware ESXi/ESX
Using the partedUtil command line utility on ESXi and ESX
VMFS5 ボリュームのマウントに次のエラーで失敗する: プライマリ GPT テーブルからの読み取りに失敗しました
使用辅助(备份)GPT 表修复主 GPT 表

Impact/Risks:
Warning:
This procedure can change the partition table. It should only be used if a valid current backup of the data residing on the datastore exists.