Quick tip: Adding new hard drives on an installed Linux Server

These are the steps on adding additional hard drives on a pre-installed Linux server.

Drives will be detected and can be checked thru the “dmesg” command.

[root@localhost ~]#fdisk /dev/cciss/c0d1

press n to create partition, just use the default settings for it
press w to write exit

3.    Create ext3 filesystem

[root@localhost ~]# mkfs.ext3 /dev/cciss/c0d1p1

4.    Mount that drive to test but first create a directory where to mount it.

[root@localhost ~]#mkdir /data
[root@localhost ~]#mount -t auto /dev/cciss/c0d1p1 /data

5.    Verify if its mounted already.
[root@localhost cciss]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
65G  2.2G   59G   4% /
/dev/cciss/c0d0p1      99M   12M   83M  12% /boot
tmpfs                1005M     0 1005M   0% /dev/shm
/dev/cciss/c0d1p1     135G  188M  128G   1% /data

6.    We need to put the mount function on startup so in case of shutdown or reboot, the new HDD is still be recognized by the system

#vi /etc/fstab

Add this line:

/dev/cciss/c0d1p1       /data                    ext3    defaults        1 3

wherein:
/dev/cciss/c0d1p1 – device to be mounted
/data – mount point
ext3 – type of filesystem
defaults – mount options, Uses the default options that are rw, suid, dev, exec, auto, nouser, and async.
1 3 – dump and fsck options (5th column is dump options, checks and uses the number to decide if a filesystem should be backed up; 6th column is the order the filesystems should be checked by fsck.

Save and exit

7.    Verify if the config is correct on /etc/fstab after changes
[root@localhost cciss]#mount –av
[root@localhost cciss]#df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
65G  2.2G   59G   4% /
/dev/cciss/c0d0p1      99M   12M   83M  12% /boot
tmpfs                1005M     0 1005M   0% /dev/shm
/dev/cciss/c0d1p1     135G  188M  128G   1% /data

As you can see c0d1p1 already recognized on the system.

8.    Reboot the server and check for errors, then issue again the “df” command to see if the new partition/drive is already there.

About the author

tux

View all posts

3 Comments

Leave a Reply