Adding Disks

This section describes how to add a disk to an existing Exalogic VM image. It contains the following topics:

Example Procedure: Adding a 10 GB Disk Using modifyjeos

To add a 10 GB disk, such as ExtraDisk.img, to an Exalogic VM image using modifyjeos, complete the following steps:

Note:

This procedure applies to guest vServers created by using version 2.0.4.x.x (or earlier) of the Exalogic Guest Base Template. For guest vServers creating using v2.0.6.x.x of the Exalogic Guest Base Template, you can manage disks by using LVM commands, as described in Managing LVM Partitions on Guest vServers.

  1. Run the following command to add a 10 GB disk:

    # modifyjeos -f System.img -P ExtraDisk.img 10240 <mount_location>

    In this command, <mount_location> is the path to the location at which you want to mount the new disk (ExtraDisk.img) on System.img.

  2. Ensure that the vm.cfg file for the VM references the new disk as follows:
    disk = ['file:<Path_to_System.img>,hda,w',
            'file:<Path_to_ExtraDisk.img>,hdb,w'] 
    

    In this command, <path_to_System.img> is the path to the mount location, and <path_to_ExtraDisk.img> is the path to ExtraDisk.img mounted on System.img.

Example Procedure: Adding a 10 GB Disk Manually

To manually add a 10 GB disk, such as ExtraDisk.img, to an Exalogic VM image, complete the following steps:

Note:

This procedure applies to guest vServers created by using version 2.0.4.x.x (or earlier) of the Exalogic Guest Base Template. For guest vServers creating using v2.0.6.x.x of the Exalogic Guest Base Template, you can manage disks by using LVM commands, as described in Managing LVM Partitions on Guest vServers.

  1. Ensure that the VM is not running.
  2. Create a blank disk as follows:

    # dd if=/dev/zero of=ExtraDisk.img bs=1M count=10240

    This example uses a 10 GB disk. You can create a disk of your desired size.

  3. Edit the vm.cfg file to include the new disk:
    # vi vm.cfg
    ...
    disk = ['file:<Path_to_System.img>,hda,w',
            'file:<Path_to_ExtraDisk.img>,hdb,w']... 
    

    In this command, <path_to_System.img> is the path to the mount location, and <path_to_ExtraDisk.img> is the path to ExtraDisk.img mounted on System.img.

  4. Start the VM.
  5. Find the device with the new disk by running the following command:

    # cat /proc/partitions

    This example procedure uses the /dev/xvdb device.

  6. Make the disk ext3 as follows:

    # mkfs.ext3 /dev/xvdb

  7. Edit the /etc/fstab file to add the mount point for the disk:
    /dev/xvdb     /<mount_point>     ext3     defaults     1 2 
    
  8. Mount the disk either by restarting the VM or by running the following command:

    # mount -t ext3 /dev/xvdb <mount_point>