Wednesday, March 12, 2014

Adding a new disk to VMWare Virtual Machine in Linux

I have installed VMWare 7.1 on  Windows Server. I already installed RHEL 5-10 64 bit as  the guest operating system.

Adding a new hard disk to the VM.

Go to Initial window   VM  -->Settings
Click Add button  and Choose Hard Disk
Select create a new virtual disk
Choose virtual disk type  SCSI  -- > click Next
Give Maximum disk size --> 20GB
Choose store virtual disk as single file
Give a name to configuration file for this file (.vmdk)

Now already created the ROW disk.

Following steps  are to be carried out

  • Partitioning the Disk
  • Format the partition
  • Create the mount point
  • Modify the fstab file  for new partition 




Now make sure that your created disk is listed in /dev folder.
         use                    ll  /dev/sd*
              This will list down the mounted hard disk with partitions disks together.
(My case It is sdc).


  • Partitioning the Disk


Type fdisk on  terminal to create and manage partition of hard disk.
                                  fdisk /dev/sdc

please refer following screen shot.



1 )When Its first ask for  command  we  enter  n  first.Because we are creating a new partition.

2 )Then Enters P  since this particular partition is going to be the primary partition.

3 )Then Enters 1 for the particular partition is the first partition and  need to consume all the space of the        disk.

4 )You will have to press w to write the changes to the partitioning table and exit the fdisk.

Now we have created the Partition of the disk.


  • Formatting the Partition with the file system
type mkfs   -t   ext3      /dev/sdc1 

This will create a new file system  of  ext3  for  /dev/sdc1 

t is used for tell the type of the file system. ;).



  • Create a Mount Point
Now we have formatted the file system  and ready to mount this file system to the system.

mkdir      /u02          (In my case its u02)

mount the file system to the folder.
       mount   -t       ext3       /dev/sdc1      /u02   (t  used for type )
     mounting the sdc1 to /u02


  • Modify the fstab file  for new partition 
Add an entry for the fstab file.When boots up(run time) this  partition will be mounted according to given order.

vi  /etc/fstab 

/dev/sdc1     /u02     ext3    defaults       1    2


first location   (/dev/sdc1)    -->  partition name
second location  (/u02)        --> mount location
third location (ext3)     --> file system
fourth location (defaults)  --> mount option
fifth location (1)  -->  for dump  this is to be backed up
sixth location  (2)  -->fsck  determine in what order this shold be run.



No comments:

Post a Comment