How to add additional disks in Linux based Servers


To add and partition secondary disks in a linux server follow the steps.

1.  Login to server as root.

2.  Run the command      fdisk -l

You can see the new disk like /dev/sdb

3.   To format and partition the disk run the following commands.

fdisk /dev/sdb

#  m –> prints all commands
#  n  –>  to create a new partition
#  d –>  to delete a  existing partition
#  p –>  for primary partition
#  1 –>  for 1st partition
#  w –>  to write and exit

4. To create the filesystem in the new partition run the following command.

mkfs.ext3 /dev/sdb1

5.  To mount the created partition in the server as /disk2 .

#   mkdir /disk2

#    vi  /etc/fstab  (Edit fstab for the new disk add the following line )

/dev/sdb1               /backup                 ext3    defaults        0 0

#   mount  -a ( To mount the devices entered in fstab)

#  df -h (  To verify the mounted devices )

Advertisements

3 responses to “How to add additional disks in Linux based Servers

  1. Hi, nice and intersting site

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s