Reformatting the local VMFS partition's block size in ESX 4.x (post-installation)

Purpose

This article provides steps to reformat the local VMFS partition's block size in ESX 4.x, when there already is an existing ESX installation.


Note: For ESXi servers, reformat the local VMFS3 file system using the VMware vSphere client, or the vmkfstoolscommand. For additional instructions, see:

  • ESX Server installer is unable to format VMFS file systems (1476874).
  • Manually creating a VMFS volume using vmkfstools -C (1009829).

Resolution

The VMware ESX 4.x installer formats created VMFS-3 partitions with a 1MB block size. If you have not completed an installation yet, see Increasing block size of local storage in ESX 4.x during installation (1012683).

Post-installation, re-formatting local storage with the intended block size requires relocating the Console OS VMDK after installation, which is not possible while ESX 4.x is booted.

Note: There are a number of workarounds available to utilize a larger block size for the local VMFS file system. These options are the simplest:
  • Create two logical units for the local storage device(s) in the server, utilizing the first for the ESX 4.x installation with the default VMFS block size, and a second VMFS volume with, for now, the default block size. The second may be re-formatted later with a larger block size.
  • Alternatively, if you are going to be upgrading to ESX 4.x, format the local VMFS partition on ESX 3.5 with a larger block size first, then begin your upgrade to ESX 4.x.
If these methods are not suitable or you require retaining the existing ESX installation, you can reformat the existing ESX 4.x local VMFS partition with a larger block size using the ESX 4.x installer environment. Please note, however, that this process will take considerably more time than reinstalling the product and using the steps provided in Increasing block size of local storage in ESX 4.x during installation (1012683), due to Console OS file transfers.

Existing installations: Reformatting the local VMFS partition with a larger block size

To reformat the ESX 4.x local VMFS partition with a larger block size while retaining the original installation of ESX, you require:
  • The ESX 4.x installation CD.
  • You have already migrated all of your locally-stored virtual machines to alternative storage or datastores.
  • A storage device (8.5GB or larger) to temporarily store the Console OS. This device can be a USB flash/hard disk, a SAN LUN, a secondary SCSI disk, logical unit, or volume, or a remote SSH server.

    Note: If you are using a flash/hard drive, it is reformatted in the steps below.

To reformat the local VMFS partition on your VMware ESX 4.x server after an installation has already been completed:

  1. Prepare the server for booting into the installer CD's live environment:

    1. Shut down the ESX host.
    2. Insert, attach, or present the temporary storage device to the ESX host. If you are using an SSH server, disregard this step. This storage is used to store your Console VMDK file.
    3. Power on the ESX host.
    4. Boot into the ESX 4.x installer and select either the graphical or text installer.
    5. Complete the driver loading stage within the chosen installer. This loads the VMkernel drivers required to access the existing VMFS partition.
    6. When you are prompted about the license, choose Evaluation mode. You do not need to configure licensing.
    7. Complete the network configuration steps. After opting for DHCP or manual configuration, click the Testbutton. This commits the networking changes.

  2. Prepare the USB flash/hard drive or alternate block device:

    1. Open an alternate TTY session by pressing Ctrl+Alt+F2. Press Enter to start the login session.
    2. Run fdisk  to modify the partitions for the newly-added device.

      No
      te: Representation of attached devices varies between servers. A USB device used for the purposes of this article is recognised as /vmfs/devices/disks/mpx.vmhba32:C0:T0:L0.

    3. Print the current partition table to ensure that the correct drive is selected by pressing p in fdisk.

      Notes:
      • If you have selected an incorrect device, press q to quit, then try another device.
      • If you are using an old drive or it contains partitions you need to remove, you can destroy the partition table entries by pressing d in fdisk.

    4. Press n to create a Linux EXT3 partition on this device (default). You may use the default parameters and partition the whole device.
    5. When you are finished, press w to write the changes and quit fdisk.
    6. After partitioning, format the new partition as EXT3. For example:

      mkfs.ext3 /vmfs/devices/disks/mpx.vmhba32:C0:T0:L0:1

      Note: If you see a prompt that indicates that the partition is not a block special device, click Continue.

    7. Create a directory or mount point for the device. For example:

      mkdir /mnt/mydrive

    8. Mount the filesystem with the command:

      mount -t ext3

      For example:

      mount -t ext3 /vmfs/devices/disks/mpx.vmhba32:C0:T0:L0:1 /mnt/drive

    9. Copy the console OS directory to the mount point. For example:

      cp -R /vmfs/volumes/Storage1/esxconsole* /mnt/drive

      Note: This process can take some time as the Console OS VMDK is a approximately 8.5 gigabytes or greater.

      Alternatively, you can secure-copy the Console OS to a network location:

      1. Verify that you can reach your designated SSH server from the console using ping.
      2. SCP the contents of the Console OS directory to the SSH server. Adjust the following command as required:

        scp -r /vmfs/volumes/Storage1/esxconsole*
        username@server:/destination_directory 

        Note: The specified SSH server and its storage must have capacity and support for files of 8GB in size and larger.

  3. Reformat the original VMFS volume with your desired block size.

    For example, to format it with an 8MB block size and name it Storage1, run the command:

    vmkfstools -C vmfs3 -b 8m -S Storage1 /vmfs/devices/disks/mpx.vmhba0:C0:T0:L0:5

    Note: The local storage device address may be different on your server. Ensure that you have the correct device and partition selected before formatting with the vmkfstools command. In the above example, the VMFS3 volume was in the fifth partition (highlighted in blue). While this is the default configuration, your configuration may still be different. For example, it may have a different vmhba (highlighted in red), controller (C), target (T), or LUN (L) number.

  4. Copy the Console OS directory back from the mount point:

    • If you used a USB flash/hard drive or alternate block device, copy the Console OS directory from your secondary drive back to the VMFS volume. For example:

      cp -R /mnt/drive/* /vmfs/volumes/Storage1

    • If you used an SSH server, use SCP to copy the Console OS back from the SSH server to the new VMFS volume. For example:

      scp –r username@server:/copied-directory /vmfs/volumes/Storage1

  5. Reconfigure the ESX host:

    1. Navigate to the /vmfs/volumes/Storage1// directory. Run pwd and record the absolute path to the Console OS VMDK file. For example:

      # pwd

      /vmfs/volumes/4a79e784-066e4fef-9d4b-005056ab7e20/esxconsole-4a785116-c442-9826-6f60-005056ab7e20/

      Note: The VMDK filename is esxconsole.vmdk.

    2. Eject the installation CD, then reboot the ESX host.
    3. Interrupt the GRUB Bootloader. During startup, you have a few seconds to select ESX Server 4.0 or Troubleshooting Mode. Press a cursor key or a meta key to interrupt the countdown.
    4. Highlight ESX Server 4.0 (or ESX Server 4.1). Edit the kernel boot parameter for the first menu item by pressing a.
    5. Add the now-required /boot/cosvmdk parameter to your kernel boot line. It must be at the beginning of the line, preceding the values that are already provided already (do not erase them). For example:

      • Before:

        grub append> ro root=UUID=d01bc3a8-1e83-47ea-8250-a77cd15fc54 mem=300M quiet


      • After:

        grub append> /boot/cosvmdk=/vmfs/volumes/4a79e784-066e4fef-9d4b-005056ab7e20/esxconsole-4a785116-c442-9826-6f60-005056ab7e20/esxconsole.vmdk ro root=UUID=d01bc3a8-1e83-47ea-8250-a77cd15fc54 mem=300M quiet

        Note: Double-check your input. Typographical errors may result in a failed boot-up.

    6. Press Enter to save the change. This resumes the booting of ESX.

      No
      te: If you are returned to a recovery shell, there may have been a typographical error in step 5, or there may be other issues reaching the file or starting the host. You can retry the steps in this section (Reconfiguring the ESX host), or you can contact VMware Technical Support for assistance as there may be other issues. For more information on contacting VMware Technical Support, see How to Submit a Support Request.

    7. When ESX is online at the status screen, log into the console. You can log in using an SSH client.
    8. Edit the /etc/vmware/esx.conf file using a text editor.
    9. Locate the line that specifies the Console OS vmdk path and replace the path with the value or path recorded in step 1. For example:

      /boot/cosvmdk = "/vmfs/volumes/4a79e784-066e4fef-9d4b-005056ab7e20/esxconsole-4a785116-c442-9826-6f60-005056ab7e20/esxconsole.vmdk"

    10. Save your changes and return to the prompt.
    11. Run the command esxcfg-boot -b to update the ESX host boot configuration and initial RAM disk image.
    12. (Optional) Using the reboot command, restart the ESX host to verify that it boots without manual intervention or error.

      Based on VMware KB 1013210
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Hardware and firmware requirements for 64-bit guest operating systems

PurposeThis article explains the host machine hardware and firmware requirements for installing...

Logging in to the vCenter Server 5.0 Web Client fails with the error: unable to connect to vCenter Inventory Service

DetailsAfter upgrading from vCenter Server 4.1 to 5.0, you experience these symptoms:Cannot log...

Multiple network entries in vCenter Server 5.0.x after migrating virtual machines from a virtual switch to a virtual distributed switch

SymptomsAfter migrating virtual machines from a virtual switch to a virtual Distributed...

Minimum requirements for the VMware vCenter Server 5.x Appliance

PurposeIf you are using the VMware vCenter Server Appliance, beginning with vSphere 5.0 you can...