How to create partitions and format them under Linux (Centos 7)

When you add new disk first you need to identify device path.
Please type:
# fdisk -l
and find path to your new disk, e.g.

Now create new partition:
# fdisk /dev/sdbThen press:
Command (m for help): p
Command (m for help): n
Command action
e extended
p primary partition (1-4)
Partition number (1-4): 1
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.

Now you can verify if new partition is visible by Linux system by typing:
ls /dev/sd*
You should see entries of old hard drive like:
/dev/sda /dev/sda1 /dev/sda2
and new ones:
/dev/sdb /dev/sdb1

Now you must create file system by typing:
mkfs.ext4 /dev/sdb1
This will create ext4 filesystem.

If you prefer xfs or other then check installed formatters by:
ls /sbin/mkfs.*
and use preferred one by:
mkfs.xfs /dev/sdb1

On the last step you need to mount newly created file system.

Create directory where to mount:
mkdir /new_directory
or mount to already created directory.

NOTE: do not mount to directory containing files because they become not accessible.

Now do mount:
mount /dev/sdb1 /new_directory

At the end do not forget to make proper entries in /etc/fstab file to make mounts permanent.