Wednesday, July 23, 2014

add new virtual disk to vmware linux guest no reboot

     When you add new disk to linux guest virtual machine. You cannot see new disk. But You must be re-scan new scsi device or rebooting OS.

     In this tutorial. I will re-scan disk without rebooting OS. Please follow this step

  • click edit VM you want add new disk.

  • In this window.Click add.

  • Select Hardisk and click next.

  • choose Create new virtual disk.

  • Assign disk size, Choose disk provisioning
    - Thick provision lazy zeroed is Creates a virtual disk in a default thick format. Space required for the virtual disk is allocated when the virtual disk is created. Data remaining on the physical device is not erased during creation, but is zeroed out on demand at a later time on first write from the virtual machine.
      Using the default flat virtual disk format does not zero out or eliminate the possibility of recovering deleted files or restoring old data that might be present on this allocated space. You cannot convert a flat disk to a thin disk.
    - Thick provision eager zeroed is A type of thick virtual disk that supports clustering features such as Fault Tolerance. Space required for the virtual disk is allocated at creation time. In contrast to the flat format, the data remaining on the physical device is zeroed out when the virtual disk is created. It might take much longer to create disks in this format than to create other types of disks.
    - Thin provinsion is Use this format to save storage space. For the thin disk, you provision as much datastore space as the disk would require based on the value that you enter for the disk size. However, the thin disk starts small and at first, uses only as much datastore space as the disk needs for its initial operations.

  • Click next.

  • Verify disk option and click finsh.

  • open console of VM guest.
  • runcommand
    # ls /sys/class/scsi_host/
  • output
    host{x}
  • rum command for re-scan disk.
    # echo "- - -" > /sys/class/scsi_host/host{x}/scan
  • run command for format disk.
    # fdisk -l /dev/sdb
    # mkfs.ext3 /dev/sdb
  • make directory for mount point.
    # mkdir /data
  • mount disk.
    # mount /dev/sdb /data
  • follow next step to auto mount.
    # vi /etc/fstab
  • type this text to last line file.
    /dev/sdb     /disk3     ext3     defaults     1 2
     Congraturation!!! You add new virtual disk to Linux VM guest complete.

No comments:

Post a Comment