Personal tools
     DOCUMENTATION

Appliance:Adding disk space under VMware

From rPath Wiki

Jump to: navigation, search

Adding more disk space (VMware)

If you're using the VMware ® version of this appliance, and you have VMware Workstation, you can add more disk space as follows:

Image:Bulbgraph.png   These instructions assume you're using the VM ware image generated

by rBuilder Online™. If you're using an image you created by installing from the ISO images produced by rBuilder, then the assumption about your disk device names, etc. will all be invalid.

    1. Take a snapshot of your existing VM as a safety precaution.
    2. Shutdown the VM cleanly.
    3. Either use rPath Appliance Agent Web UI or login as root and issue:

      shutdown -h now
    4. Add the new virtual disk in Workstation's VM -> Settings menu.
    5. Choose SCSI for the virtual hardware.

      Image:Bulbgraph.png   If the existing virtual drive is SCSI, use /dev/sdb in all instructions below. If the existing drive is IDE use /dev/sda. SCSI drives are mapped to /dev/ device entries in order, starting with /dev/sda then /dev/sdb /dev/sdc, etc.

      Make it growable to whatever maximum you desire.

    6. Startup the VM.
    7. Login as root
    8. Create a partition table on the new disk using fdisk. This is an interactive tool, so you're going to need to answer a few questions.
    9. fdisk /dev/sdb 
      
      • choose n for "new partition"
      • choose p for "primary"
      • type 1 for the partition number
      • accept the default start and end options (hit Enter twice)
      • choose w to "write the partition table"
    10. Make a filesystem on the new partition
    11. mkfs.ext3 /dev/sdb1
    12. Mount the filesystem on a temporary location
    13. mount /dev/sdb1 /mnt
    14. Copy all the /srv contents to the new partition
    15. cp -rp /srv/* /mnt
    16. Move the old contents out of the way
    17. mkdir /srv.old; mv /srv/* /srv.old
    18. Add a line to /etc/fstab to cause your new partition to be mounted at boot
    19. Either use echo to append a line, or use vi to edit if you're comfortable with vi

      echo '/dev/sdb1 /srv  ext3  defaults  1 1' >> /etc/fstab
    20. Reboot
shutdown -r now

After rebooting, you can confirm that your disk setup now has the new disk on the /srv directory mount point by typing on the command line:

df -h

You should see something like

  Filesystem   Size   Used  Avail Use%  Mounted on
  /dev/sda1    512M   256M  256M   50%  /
  none         126M      0  126M    0%  /dev/shm
  /dev/sdb1    7.9G    73M  7.5G    1%  /srv

After confirming that the contents have all been copied correctly, you can remove the backup data:

rm -rf /srv.old