ThoughtPolice VMware Images

Adding a SCSI disk to a VMware machine

1. Add the virtual hardware

  1. Shutdown your VM
  2. Go into the directory containing the VMware image
    cd vmware/IMAGENAME
  3. Decide which disk size you want, and save it there
    wget http://www.thoughtpolice.co.uk/vmware/howto/10-gig-scsi-disk.vmdk.zip    # 10 gigabytes
    wget http://www.thoughtpolice.co.uk/vmware/howto/50-gig-scsi-disk.vmdk.zip    # 50 gigabytes
    wget http://www.thoughtpolice.co.uk/vmware/howto/200-gig-scsi-disk.vmdk.zip   # 200 gigabytes
    
  4. Uncompress the disk image (example for 10 gigabyte disk)
    unzip 10-gig-scsi-disk.vmdk.zip
  5. Rename the 10 gigabyte disk image to something useful
    mv 10-gig-scsi-disk.vmdk YOUR-FILENAME.vmdk
  6. Edit the .vmx file for the image
    vi *.vmx
  7. Add the two lines:
    scsi0:1.present = "TRUE"
    scsi0:1.fileName = "YOUR-FILENAME.vmdk"
    

2. Prepare the partition for use

  1. Boot the VM
  2. Your new disk should be /dev/sdb, confirm this:
    fdisk -l /dev/sdb
  3. It must read
    Disk /dev/sdb doesn't contain a valid partition table.
  4. If it says anything else, STOP.
  5. Create a partition
    fdisk /dev/sdb
  6. Type n for new partition
  7. Type p for a primary partition
  8. Enter 1 for the Partition number
  9. Accept the defaults for First cylinder, Last cylinder
  10. Type w to write changes to disk
  11. Format the partition
    mkfs.ext3 /dev/sdb1

3. Use the partition

  1. Make a mountpoint
    mkdir /mnt/disktwo
  2. Mount the disk
    mount /dev/sdb1 /mnt/disktwo

To make this permanent (so the disk will be there once you reboot):

  1. Edit fstab
    vi /etc/fstab
  2. Add the line:
    /dev/sdb1     /mnt/disktwo     ext3     defaults     0 2

An alternative to this last step is to use LVM.

Comments? Feedback? e-mail me