본문 바로가기
서버 프로그램/Vmware

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

by 삼성그룹이장 2023. 1. 11.

 

 

https://kb.vmware.com/s/article/2121741

 

 

 

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)

Cause

This issue occurs if the primary GPT table is corrupted.

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.

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
반응형