Using partedUtil to add FAT16 partitions to a USB flash drive with ESXi installed
search cancel

Using partedUtil to add FAT16 partitions to a USB flash drive with ESXi installed

book

Article ID: 334559

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides steps to add FAT16 partitions to a USB flash that has ESXi installed.

Environment

VMware vSphere ESXi 6.5

Resolution

 

Note: These steps are intended to be used to create a /scratch partition for ESXi host logging purposes.

For details on sizing the partition, see Using the partedUtil command line utility on ESXi and ESX (323144).

To add FAT16 partitions to a USB flash drive using partedUtil:

 

  1. Connect to the ESXi host using an SSH session and root credentials.
  2. Run this command to view the existing partitions on the USB device:

    partedUtil getptbl /vmfs/devices/disks/DeviceName

    For Example:

    partedUtil getptbl /vmfs/devices/disks/mpx.vmhba33:C0:T0:L0

    gpt
    1947 255 63 31293440
    1 64 8191 C12A7328F81F11D2BA4B00A0C93EC93B systemPartition 128
    5 8224 520191 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0
    6 520224 1032191 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0
    7 1032224 1257471 9D27538040AD11DBBF97000C2911D1B8 vmkDiagnostic 0
    8 1257504 1843199 EBD0A0A2B9E5443387C068B6B72699C7 linuxNative 0
    9 1843200 7086079 9D27538040AD11DBBF97000C2911D1B8 vmkDiagnostic 0
  3. Run this command to create a new partition:

    partedUtil setptbl "/vmfs/devices/disks/DeviceName" DiskLabel ["partNum startSector endSector type/guid attribute"]*

    Note: All existing partitions will need be included setptbl command. Otherwise the existing partitions will be removed.

    For example:

    partedUtil setptbl /vmfs/devices/disks/mpx.vmhba33:C0:T0:L0 gpt "1 64 8191 C12A7328F81F11D2BA4B00A0C93EC93B 128" "5 8224 520191 EBD0A0A2B9E5443387C068B6B72699C7 0" "6 520224 1032191 EBD0A0A2B9E5443387C068B6B72699C7 0" "7 1032224 1257471 9D27538040AD11DBBF97000C2911D1B8 0" "8 1257504 1843199 EBD0A0A2B9E5443387C068B6B72699C7 0" "9 1843200 7086079 9D27538040AD11DBBF97000C2911D1B8 0" "10 15646703 23446703 EBD0A0A2B9E5443387C068B6B72699C7 0"

  4. Run this command to verify that the partition is created:

    partedUtil getptbl /vmfs/devices/disks/mpx.vmhba33:C0:T0:L0:

    For example:

    partedUtil getptbl /vmfs/devices/disks/mpx.vmhba33:C0:T0:L0

    gpt
    0 0 0 0
    1 64 8191 C12A7328F81F11D2BA4B00A0C93EC93B 128
    5 8224 520191 EBD0A0A2B9E5443387C068B6B72699C7 0
    6 520224 1032191 EBD0A0A2B9E5443387C068B6B72699C7 0
    7 1032224 1257471 9D27538040AD11DBBF97000C2911D1B8 0
    8 1257504 1843199 EBD0A0A2B9E5443387C068B6B72699C7 0
    9 1843200 7086079 9D27538040AD11DBBF97000C2911D1B8 0
    10 15646703 23446703 EBD0A0A2B9E5443387C068B6B72699C7 0


  5. Run this command to format the new partition with FAT16:

    vmkfstools -C vfat -S fsName deviceName

    For example:

    vmkfstools -C vfat -S vfatPrt1 /vmfs/devices/disks/mpx.vmhba33:C0:T0:L0:10

    Note: The vmkfstools -C vfat command supports a maximum sectors of 8386560 on the partition otherwise it will error with Error: Invalid argument.


  6. Run this command to verify the partition is available:

    ls /vmfs/volumes/ -l.

    For example:

    ls /vmfs/volumes/ -l

    total 2304
    drwxr-xr-x 1 root root 8 Jan 1 1970 ########-####-########2d31
    drwxr-xr-t 1 root root 2800 Mar 22 01:46 ########-####-########5292
    drwxr-xr-x 1 root root 8 Jan 1 1970 ########-####-########a720
    drwxr-xr-x 1 root root 8 Jan 1 1970 ########-####-########a720
    drwxr-xr-x 1 root root 8 Jan 1 1970 ########-####-########a720
    lrwxr-xr-x 1 root root 35 Apr 6 05:38 MACPro -> ########-####-########5292
    drwxr-xr-x 1 root root 8 Jan 1 1970 ########-####-########0c57
    lrwxr-xr-x 1 root root 35 Apr 6 05:38 vfatPrt1 -> ########-####-########a720



Additional Information