Adding new hard drives live on an Ubuntu guest with VMware ESX

The documentation for this is somewhat scattered around the net; so, since I had to do this today, I thought I’d share it for others.

Create the disks in the Virtual Infrastructure Client

  1. Right click on the guest, click “Edit Settings…”
  2. Under the “Hardware” tab, click “Add”
  3. For the device type, select “Hard Disk”, click “Next”, and “Next” again
  4. Specify the size of your disk, optionally enable Thin Provisioning, and click “Next”, “Next”, “Finish”, “Ok”

Re-scan the scsi bus for new hardware

  1. cat /proc/partitions
    1. Note the list of devices
  2. sudo apt-get install scsitools
  3. sudo rescan-scsi-bus.sh
  4. cat /proc/partitions
    1. See what devices got added

Partition and format your disks

  1. sudo fdisk /dev/<newdevice>
  2. sudo mkfs -t ext3 /dev/<newdevice><partitionnumber>

Add the devices to /dev/disk/by-uuid/

  1. sudo partprobe
  2. sudo blkid /dev/<newdevice><partitionnumber>
    1. Note the UUID

Add the new mount to /etc/fstab, and mount the filesystem

  1. vi /etc/fstab
  2. mount -a
  • Great article. I was looking for exactly the same thing !
    Thanks you !

  • Michael

    Thanks for this! Really well put! Helped me out today.

    Cheers!