Create VMFS volumes from the command-line

http://www.yellow-bricks.com posted a Blog Entry titled : Create VMFS volumes from the command-line

I just had to create a couple VMFS volumes from the command-line on a local disk. It’s pretty straight forward but I needed to document it anyway, here it is:

  1. fdisk -l (check what the last partition is)
  2. fdisk /dev/sda
  3. n (new)
  4. default (start block)
  5. default (end block)
  6. t (partition type)
  7. 10 (partition 10, just created)
  8. fb (vmfs type)
  9. w (write config)
  10. reboot (Reboot the host before you format the newly created partition)
  11. vmkfstools -C vmfs3 /vmfs/devices/disks/vmhba0:0:0:10
  12. Go to VI Client, Refresh storage view and rename the newly created volume
You can align the VMFS volume as follows, before you do step 9:
  1. X
  2. b
  3. 1
  4. 128 (disk alignment, check your SAN manual for the correct value, 128 is correct in most cases…)
  5. W

I was looking for this the other day, and was asking about alignment before the last VMware Roundtable. http://blogs.vmware.com/vmtn/podcasts/

Full post http://www.yellow-bricks.com/2008/12/15/create-vmfs-volumes-from-the-commandline/