Add Additional Hard Disk on Oracle Linux 6.5
Add Additional Hard Disk on Oracle Linux 6.5/Red Hat/CentOS
This is a virtualization environment in VMware ESXI 6.0. To add additional Hard Disk in Oracle Linux 6.5 first add hard drive in Virtual Machine then configure the hard disk inside the operating system. This is a fixed size additional hard disk means not resize.
Add 535GB hard disk in virtual machine, you can take different size of hard disk as per your requirement.
To check hard disk has successfully added type the below command inside the operating system Oracle Linux 6.5.
To create a partition in hard disk sdb start fdisk in interactive mode by use of below command.
fdisk /dev/<device name>In Our Case:fdisk /dev/sdb
Then type sub-command p to check there is free space in Hard Disk.
Type sub-command n to create a new partition then type p for primary partition. Type 1 for partition number. Press enter for first cylinder then again press enter for last cylinder, In Last cylinder you can use custom hard disk size.
for example: 5000M means 5GB
Here we are creating single hard drive partition therefore for first and last cylinder use default cylinder value by just press enter.
Type sub-command p to check partition has successfully created.
Here you can change the type of partition by use of sub-command t, you must know the HEX Code partition type number for example: SWAP partition HEX code is 82.
Type sub-command w to write the new partition table on disk.
At this point kernel is still using old table, you will need to reboot the operating system. If you don't want to reboot so force the kernel to re-read the partition table by type the below command.
To check partition has successfully created type the below command.
To format the partition with ext4 linux file system type the below command. If you not format the partition the partition will not mount.
To mount a partition on directory, first create a directory "DB" on root "/" by use of mkdir command. you can create directory with different name on any location.
To mount a partition sdb1 on directory DB type the below command.
mount /dev/sdb1 /DB
To permanently mount the partition sdb1 on directory DB edit the file fstab that available in directory "/etc/fstab" by use of vi editor.
Edit the below line in file fstab.
/dev/sdb1 /DB ext4 defaults 1 2