ThoughtPolice VMware Images
Adding a SCSI disk to a VMware machine
1. Add the virtual hardware
- Shutdown your VM
- Go into the directory containing the VMware image
cd vmware/IMAGENAME
- 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
- Uncompress the disk image (example for 10 gigabyte disk)
unzip 10-gig-scsi-disk.vmdk.zip
- Rename the 10 gigabyte disk image to something useful
mv 10-gig-scsi-disk.vmdk YOUR-FILENAME.vmdk
- Edit the .vmx file for the image
vi *.vmx
- Add the two lines:
scsi0:1.present = "TRUE" scsi0:1.fileName = "YOUR-FILENAME.vmdk"
2. Prepare the partition for use
- Boot the VM
- Your new disk should be /dev/sdb, confirm this:
fdisk -l /dev/sdb
- It must read
Disk /dev/sdb doesn't contain a valid partition table.
- If it says anything else, STOP.
- Create a partition
fdisk /dev/sdb
- Type n for new partition
- Type p for a primary partition
- Enter 1 for the Partition number
- Accept the defaults for First cylinder, Last cylinder
- Type w to write changes to disk
- Format the partition
mkfs.ext3 /dev/sdb1
3. Use the partition
- Make a mountpoint
mkdir /mnt/disktwo
- Mount the disk
mount /dev/sdb1 /mnt/disktwo
To make this permanent (so the disk will be there once you reboot):
- Edit fstab
vi /etc/fstab
- 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
