Tuesday, July 25, 2006

Expand (resize/enlarge) virtual disk

Only for advanced users!


This is quite complicated procedure (because of reiserfs partition), so if you are not advanced user, I recommend to wait for "doknir II" which will be released in fall 2006.

For adventurous people, here are the details for growing VMware virtual disk:
  1. We will need the latest version of "resize_reiserfs" utility:
    apt-get update
    apt-get install reiserfsprogs
  2. Close virtual appliance and copy entire folder to new folder.
  3. Resize virtual disk in new folder using "Virtual DiskFactory". There must be VMware Server or Workstation installed, because utility depends on "DiskManager GUI" (command is vmware-vdiskmanager):

  4. Add enlarged disk to original VM as second SCSI disk (sdb)
  5. Start virtual appliance
  6. Use QTParted to remove linux swap partition (do not forget to commit) from second disk
  7. Start Konsole and type sux
  8. Use fdisk to change partition table of second SCSI disk (this will not delete data) in the following way:
    - delete existing partition sdb1 (Start Cylinder: 1, End: 283)
    - create new partition (Start Cylinder: 1, End: 450)
    - write changes to partition table and exit
  9. Start QTParted and create linux swap partition from remaining free space (cylinders from 451 to 509). Commit and exit!
  10. Expand the filesystem to fully fill the new size of the partition with the following command:
    resize_reiserfs /dev/sdb1
  11. Close VM and remove second SCSI disk from it
  12. Start new (cloned) VM.
  13. Verify the size of partition:

[]

1 comment:

Unknown said...

I have put a step-by-step tutorial together on how to expand a virtual disk under a Windows 2003 Server VMWare image.

http://www.seandeasy.com/expanding-a-drive-within-a-vmware-image/