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).
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:
Prepare the server for booting into the installer CD's live environment:
Shut down the ESX host.
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.
Power on the ESX host.
Boot into the ESX 4.x installer and select either the graphical or text installer.
Complete the driver loading stage within the chosen installer. This loads the VMkernel drivers required to access the existing VMFS partition.
When you are prompted about the license, choose Evaluation mode. You do not need to configure licensing.
Complete the network configuration steps. After opting for DHCP or manual configuration, click the Testbutton. This commits the networking changes.
Prepare the USB flash/hard drive or alternate block device:
Open an alternate TTY session by pressing Ctrl+Alt+F2. Press Enter to start the login session.
Run fdisk to modify the partitions for the newly-added device.
Note: 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.
Print the current partition table to ensure that the correct drive is selected by pressing p in fdisk.
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.
Press n to create a Linux EXT3 partition on this device (default). You may use the default parameters and partition the whole device.
When you are finished, press w to write the changes and quit fdisk.
After partitioning, format the new partition as EXT3. For example:
Note: If you see a prompt that indicates that the partition is not a block special device, click Continue.
Create a directory or mount point for the device. For example:
Mount the filesystem with the command:
mount -t ext3
mount -t ext3 /vmfs/devices/disks/mpx.vmhba32:C0:T0:L0:1 /mnt/drive
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:
Verify that you can reach your designated SSH server from the console using ping.
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.
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.
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
Reconfigure the ESX host:
Navigate to the /vmfs/volumes/Storage1// directory. Run pwd and record the absolute path to the Console OS VMDK file. For example:
Note: The VMDK filename is esxconsole.vmdk.
Eject the installation CD, then reboot the ESX host.
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.
Highlight ESX Server 4.0 (or ESX Server 4.1). Edit the kernel boot parameter for the first menu item by pressing a.
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:
grub append> ro root=UUID=d01bc3a8-1e83-47ea-8250-a77cd15fc54 mem=300M quiet
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.
Press Enter to save the change. This resumes the booting of ESX.
Note: 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.
When ESX is online at the status screen, log into the console. You can log in using an SSH client.
Edit the /etc/vmware/esx.conf file using a text editor.
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"
Save your changes and return to the prompt.
Run the command esxcfg-boot -b to update the ESX host boot configuration and initial RAM disk image.
(Optional) Using the reboot command, restart the ESX host to verify that it boots without manual intervention or error.
Based on VMware KB 1013210