ESXi

 View Only
Expand all | Collapse all

Re-creating partition table for VMFS 5 datastore

  • 1.  Re-creating partition table for VMFS 5 datastore

    Posted Feb 11, 2021 04:42 PM

    Hello, am currently trying to recover a couple of datastores but running into an error. No sure how to proceed.  I'm very green when it comes to working with disks at this level.

    Overview: New ESXi hardware. Removed DAS controller cards from old 6.5u3 server and installed into new 6.5u3 server.  Controllers and DAS arrays are detected but the datastores are not accessible. Made the mistake of trying to re-create the partitions using https://kb.vmware.com/s/article/1002281  and realized after the fact that this doesn't apply to VMFS5.

    Acquired disk info:

    --------------------
    /vmfs/devices/disks/naa.6842b2b0137708001c9e8cca14a5f355
    gpt
    2188204 255 63 35153510400
    offset found at 2048:
    0200000 d00d c001
    0200004
    1400000 f15e 2fab
    1400004
    0140001d 44 53 30 31 00 00 00 00 00 00 00 00 00 00 00 00 |DS01............|
    0140002d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
    -

    --------------------

    Procured last sector from this output:

    partedUtil getUsableSectors /vmfs/devices/disks/naa.6842b2b0137708001c9e8cca14a5f355
    34 35153510366

    Pulled existing table info:

    partedUtil getptbl /vmfs/devices/disks/naa.6842b2b0137708001c9e8cca14a5f355
    msdos
    2188204 255 63 35153510400
    1 128 4294967294 251 0

    Deleted existing table info:

    partedUtil delete /vmfs/devices/disks/naa.6842b2b0137708001c9e8cca14a5f355 1

    Set to gpt:

    partedUtil setptbl /vmfs/devices/disks/naa.6842b2b0137708001c9e8cca14a5f355 gpt

    Attempted to re-create table w/resulting error:

    partedUtil setptbl /vmfs/devices/disks/naa.6842b2b0137708001c9e8cca14a5f355 gpt "1 2048 35153510399 AA31E02A400F11DB9590000C2911D1B8 0"
    gpt
    0 0 0 0
    1 2048 35153510399 AA31E02A400F11DB9590000C2911D1B8 0
    Error: Unable to satisfy all constraints on the partition.

     

    Am unsure on how to proceed at this point.

     

    Note: While it'd be wonderful if I could recover said data, it's not a show-killer. So if it's beyond fudged I'm prepared to reformat new datastores and continue on my merry way but wanted to put this out there just in case I can get over the hump and back in business w/the old datastores.

    Thanks in advance for any pointers.

     

     

     



  • 2.  RE: Re-creating partition table for VMFS 5 datastore

    Posted Feb 11, 2021 05:24 PM

    Your details are confusing.
    offset found at 2048:
    0200000 d00d c001
    contradicts
    1 128 4294967294 251 0

    Please run
    hexdump -C /vmfs/devices/disks/naa.6842b2b0137708001c9e8cca14a5f355 | less
    until you see the magic number d00d c001.
    Report at which offset you see the magic number appear.

    Ulli



  • 3.  RE: Re-creating partition table for VMFS 5 datastore

    Posted Feb 11, 2021 08:48 PM

    Pardon my ignorance but I'm not at all versed in translating these hexdumps.  Would the following results be of use?

    hexdump -C /vmfs/devices/disks/naa.6842b2b0137708001c9e8cca14a5f355 | grep "d0 0d c0 01"
    331c6530 ee a6 d0 0d c0 01 13 e4 02 b8 9f 15 e8 1e 4b fe |..............K.|
    e723a400 40 2a d0 0d c0 01 3d cb 3f 28 19 23 f2 07 cd a4 |@*....=.?(.#....|



  • 4.  RE: Re-creating partition table for VMFS 5 datastore

    Posted Feb 11, 2021 09:33 PM

    Please run

    od -A x -t x2 /vmfs/devices/disks/naa.6842b2b0137708001c9e8cca14a5f355 | grep "0000 d00d"

    First match is what we are looking for - the value you received is completely unexpected.

     

     



  • 5.  RE: Re-creating partition table for VMFS 5 datastore

    Posted Feb 11, 2021 09:53 PM

    Here ya go:

    od -A x -t x2 /vmfs/devices/disks/naa.6842b2b0137708001c9e8cca14a5f355 | grep "0000 d00d"


    200000 d00d c001 0005 0000 0015 0000 1602 0000



  • 6.  RE: Re-creating partition table for VMFS 5 datastore

    Posted Feb 11, 2021 11:45 PM

    That makes more sense.

    Now read Andres reply - and then fix your original setptbl command.
    partedUtil setptbl /vmfs/devices/disks/naa.6842b2b0137708001c9e8cca14a5f355 gpt "1 2048 35153510366 AA31E02A400F11DB9590000C2911D1B8 0"
    If the result is unmountable try
    vmkfstools -V

    If that does not work - check wether the volume is detected as a snapshot - very likely when you switched the controllertype.
    Check with:
    esxcli storage vmfs snapshot list

    If that does not allow you to mount the volume - there maybe a bigger problem.

    Then read
    https://communities.vmware.com/t5/VMware-vSphere-Documents/Create-a-VMFS-Header-dump-using-an-ESXi-Host-in-production/ta-p/2795669

     

    Ulli



  • 7.  RE: Re-creating partition table for VMFS 5 datastore

    Posted Feb 12, 2021 01:51 AM

    Sorry for the slow reply, attention was diverted elsewhere.

    >>> esxcli storage vmfs snapshot list

    No snapshot found.

    Upon attempting to run setptbl I get a read-write error:

     

    Warning: Unable to open /dev/disks/naa.6842b2b0137708001c9e8cca14a5f355 read-write (Device or resource busy). /dev/disks/naa.6842b2b0137708001c9e8cca14a5f355 has been opened read-only.
    Error: Can't write to /dev/disks/naa.6842b2b0137708001c9e8cca14a5f355, because it is opened read-only.
    SetPtableGpt: Unable to commit to disk

     

    Currently reviewing your suggested header dump link.



  • 8.  RE: Re-creating partition table for VMFS 5 datastore

    Posted Feb 12, 2021 02:32 AM

    The read/write error previously mentioned was resolved by a reboot. Recovery of /vmfs/devices/disks/naa.6842b2b0137708001c9e8cca14a5f355 has been successful, thank you!

     

    I'm now struggling w/the remaining datastore:
    /vmfs/devices/disks/naa.6842b2b01335e80015569beeabc666b1
    gpt
    2188204 255 63 35153510400
    Checking offset found at 2048:
    0200000 d00d c001
    0200004
    1400000 f15e 2fab
    1400004
    0140001d 44 53 30 32 00 00 00 00 00 00 00 00 00 00 00 00 |DS02............|
    0140002d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
    -

    partedUtil getptbl /vmfs/devices/disks/naa.6842b2b01335e80015569beeabc666b1
    gpt
    2188204 255 63 35153510400

     

    partedUtil getUsableSectors /vmfs/devices/disks/naa.6842b2b01335e80015569beeabc666b1
    1 35153510399

     

    partedUtil setptbl /vmfs/devices/disks/naa.6842b2b01335e80015569beeabc666b1 gpt "1 2048 35153510399 AA31E02A400F11DB9590000C2911D1B8
    0"
    gpt
    0 0 0 0
    1 2048 35153510399 AA31E02A400F11DB9590000C2911D1B8 0
    Error: Unable to satisfy all constraints on the partition.

     

    od -A x -t x2 /vmfs/devices/disks/naa.6842b2b01335e80015569beeabc666b1 | grep "0000 d00d"
    074e00 4256 4b4c 0000 d00d 0000 0000 0000 0000
    200000 d00d c001 0005 0000 0015 0000 1602 0000
    2bc0c30 0000 0000 0000 0000 d00d 0000 0000 0000
    1500d110 148b 00dc aa46 1df6 0930 e447 0000 d00d
    205de1e0 6991 da74 d1a5 0820 2047 0000 d00d 4497



  • 9.  RE: Re-creating partition table for VMFS 5 datastore

    Posted Feb 12, 2021 03:03 PM

    After stepping through the procedure for the 2nd datastore this morning I was successful in recovering that datastore, also. I'm back in business.

    Thanks to all for the pointers in the right direction. It is very much appreciated.

     



  • 10.  RE: Re-creating partition table for VMFS 5 datastore

    Posted Feb 11, 2021 09:32 PM

    getUsableSectors shows 35153510366 as the last usable sector, so why do you use 35153510399 in the setptbl command? You cannot use more that available.

    André



  • 11.  RE: Re-creating partition table for VMFS 5 datastore

    Posted Feb 12, 2021 01:48 AM

      



  • 12.  RE: Re-creating partition table for VMFS 5 datastore

    Posted Feb 12, 2021 01:49 AM

    Thank you for pointing this out, a_p_