Format a ESX & ESXi VMFS file system manually

Recently I came across a query in the VMware communities, the query was “How to reformat a VMFS file system or Datastore manuallly”

The preferred method of reformat the VMFS file system is from a console or SSH session as you can simply recreate the file system without having to make any changes to the disk partition.

Note: All data on a VMFS volume is lost when the datastore is recreated. Migrate or move all virtual machines and other data to another datastore. Back up all data before proceeding.
Note: This procedure should not be performed on a local datastore on an ESX host where the Operating System is located as it may remove the Service Console privileged virtual machine which is located there.

 

From the ESX/ESXi console:

Use the vmkfstools command to format the VMFS-5 or VMFS-3 datastore (Partition), specifying a Block Size of 1 to 8MB, a friendly name for the datastore, and the chosen disk device and the created partition.

vmkfstools -C vmfs3 -b BlockSize -S DatastoreVolumeName /vmfs/devices/disks/ DeviceName:Partition

vmkfstools -C vmfs5 -b BlockSize -S DatastoreVolumeName /vmfs/devices/disks/ DeviceName:Partition

 

STEPS:

1, Storage vMotion, or move the virtual machines located on the datastore you would like to re format.

2, Log in to the Local Tech Support Mode console of the ESX/ESXi host. For more information, see Unable to connect to an ESX host using Secure Shell (SSH) (1003807), Tech Support Mode for Emergency Support (1003677), or Using Tech Support Mode in ESXi 4.1 and ESXi 5.0 (1017910).

3, Use the esxcfg-scsidevs command to obtain the disk identifier (mpx or naa) for the datastore you want to re format.
# esxcfg-scsidevs –m

clip_image002[6]

4, Use vmkfstools to create a new VMFS datastore file system with the corresponding block size.

Note: vSphere 5.0 and later releases have a block size of 1MB only. For ESX/ESXi in Vsphere 4 it is from 1MB to 8MB

# vmkfstools -C VMFS-type -b Block-Size -S Datastore-Name /vmfs/devices/disks/Disk-Identifier:Partition-Number

For Vsphere 5x
vmkfstools -C vmfs5 –b 1m -S Storage1 /vmfs/devices/disks/mpx.vmhba1:C0:T0:L0:3

For Vsphere 4x
vmkfstools -C vmfs3 –b 8m -S Storage1 /vmfs/devices/disks/mpx.vmhba1:C0:T0:L0:3

clip_image004[4]

5, Performing a rescan of the storage on an ESX/ESXi host

Using the ESXi 5.x

To rescan all HBAs:
esxcli storage core adapter rescan –all

To rescan a specific HBA:
esxcli storage core adapter rescan –adapter <vmkernel SCSI adapter name>

Where <vmkernel SCSI adapter name> is the vmhba# to be rescanned. To get a list of all adapters, run the esxcli storage core adapter list command.

OR

esxcfg-rescan <vmkernel SCSI adapter name>

esxcfg-rescan –all

Where <vmkernel SCSI adapter name> is the vmhba# to be rescanned.

In Vsphere 4x

esxcfg-rescan <vmkernel SCSI adapter name>

esxcfg-rescan –all

Where <vmkernel SCSI adapter name> is the vmhba# to be rescanned.

Or simply in Vsphere 4x and 5x

To search for new VMFS datastores, run this command:
vmkfstools –V

Note: This command does not generate any output.

 

REFERENCES

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1003988

http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&externalId=1009829

http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=1014953

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1003565

http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=1013210

Advertisements

About GK_RAJ

An enthusiastic IT person, with an intense passion towards Datacenter technologies. I am a VMware vExpert Title holder and working as a Technical Consultant, in Qatar. I am exposed to VMware vSphere, Storage, Bladecenters, Datacenter operations, Symantec Backup, Deduplication technologies and carry rich and diversified experience in these domains. I specialize in Designing & Consulting on VMware VSphere, the integration of Storage and Network Stacks to VSphere. With my experience, I help Organizations/Enterprises to achieve their CAPEX & OPEX savings, develop DR and BCP strategies, Consolidation services with Virtualization using VSphere, and prepare them to move to Cloud. In the meantime, I would like to share my knowledge and do a good contribution to the community. I am an Indian citizen, and have a Engineering degree in Electronics and Communication. I have certified in VCAP5-DCD, VCP-Cloud, VCP 4 & 5, MCITP, MCSE.

Posted on July 18, 2012, in ESXi, VMFS, VMware. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Dan Gorman's Technology News Aggregation

My Daily Readings from Zite

Virtual Reality

Lets dive into world of virtualization

VMware Professional Services

VMware Professional Services

Brad Hedlund

stuff and nonsense

VCDX56

A blog focusing on day 2 day virtualization stuff

UCSguru.com

Every Cloud Has a Tin Lining.

pibytes

Experience the Datacenter Technologies

boche.net - VMware vEvangelist

Experience the Datacenter Technologies

blog.scottlowe.org

The weblog of an IT pro specializing in virtualization, networking, cloud, servers, & Macs

Eric Sloof - NTPRO.NL

Experience the Datacenter Technologies

Technodrone

Experience the Datacenter Technologies

Welcome to vSphere-land!

your ultimate VMware information destination

Michelle Laverick...

Laverick by Name, Maverick by Nature...

CloudXC

By Josh Odgers - VCDX#90

Long White Virtual Clouds

all things vmware, cloud and virtualizing business critical applications

Virtual Geek

Experience the Datacenter Technologies

Yellow Bricks

by Duncan Epping

%d bloggers like this: