Spyderserve Web Development

Here is a straight forward method for partitioning, format, and mount a new volume on a Centos or RHEL system.  These steps would be performed after physically (or virtually) connecting the new volume.

sudo fdisk -l

This command will display a list of volumes and their partitions on the system.  You can use this to identify the new volume.  You will be looking for a designation or device file similar to: /dev/xvdj

sudo fdisk [device file]

Command (m for help): c

Command (m for help): u

Command (m for help): p

This last command will display the current partitions on the volume.

Command (m for help): n

Starts process of creating a new partition.

Type p to create a primary partion

Secify the partition number (1)

Command (m for help): w

After process is complete use “w” to re-read partition table and sync.

sudo fdisk -l

Now when you run this command you will see a partition in the new volume.  Write down the device file for use while mounting the volume.

sudo mkdir [directory to mount partition]

Creates a new directory on the system that the partition can be mounted to.

sudo mkfs.ext4 -L [directory to mount partition] [partition device file path]

Formats the new partition using the ext4 filesystem.

Then add the following line to the /etc/fstab file:

[partition device file path] [directory to mount partition] ext4 defaults 0 0

Source: http://www.techotopia.com/index.php/Adding_a_New_Disk_Drive_to_a_CentOS_6_System

Spyderserve  2225 Bemiss Road Suite D Valdosta, Georgia 31602 United States