Sysadmin profile picture
Red hat linux

Adding a New Disk Drive to a CentOS 6 / 7 System

Finding the New Hard Drive in CentOS

Creating Linux Partitions

As instructed, switch off DOS compatible mode and change the units to sectors by entering the c and u commands:

In order to view the current partitions on the disk enter the p command:

As we can see from the above fdisk output, the disk currently has no partitions because it is a previously unused disk. The next step is to create a new partition on the disk, a task which is performed by entering n (for new partition) and p (for primary partition):

In this example we only plan to create one partition which will be partition 1. Next we need to specify where the partition will begin and end. Since this is the first partition we need it to start at the first available sector and since we want to use the entire disk we specify the last sector as the end. Note that if you wish to create multiple partitions you can specify the size of each partition by sectors, bytes, kilobytes or megabytes.

Now that we have specified the partition we need to write it to the disk using the w command:

If we now look at the devices again we will see that the new partition is visible as /dev/sdb1:

The next step is to create a file system on our new partition.

Creating a File System on a CentOS 6 Disk Partition

Mounting a File System

Configuring CentOS 6 to Automatically Mount a File System

Leave a Reply

Your email address will not be published. Required fields are marked *