How to add additional hdd in MOR

From Kolmisoft Wiki
Revision as of 09:01, 20 March 2009 by Admin (talk | contribs)
Jump to navigationJump to search

Add new HDD to your server and then login via ssh. Do

mkdir /mnt/secondhdd

Now follow these instructions:

fdisk -l

You should see something like this:

[root@testbilling ~]# fdisk -l                        

Disk /dev/disk: hdd space GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          13      104391   83  Linux 
/dev/xvda2              14        1044     8281507+  8e  Linux LVM
/dev/xvda3            1045       26108   201326580   83  Linux    

Disk /dev/xvdd: 71 MB, 71251968 bytes
255 heads, 63 sectors/track, 8 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Now do:

fdisk /dev/disk , change disk to correct value.

Press n, then p, and choose number, usually you'll need to press 3 here. You must chose from 3 to 4 , because 1 and 2 is already used by other partitions. Then you'll be questioned about other thing, just press ENTER and when you'll see Command (m for help): again, enter write and press ENTER. If everything was fine, fdisk will ask you to reboot the system, reboot it and follow next steps.

Now you'll need to make filesystem for new partition. Do:

mkfs.ext3 /dev/diskandnumber (for example mkfs.ext3 /dev/xvda3). It will take couple of minutes , depending of side of new hdd. 

Last task is tell Linux to mount this partition at startup.

open /etc/fstab file with your favorited editor like nano or mcedit, you should see something like this:

/dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0


add this line to the most bottom of the file:

/dev/disknumber         /mnt/secondhdd          ext3 defaults 1 1

The file should look something like this:

/dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0
/dev/disknumber         /mnt/secondhdd          ext3 defaults            1 1

Thats it, now reboot machine and check if new hdd is mounted:

df -h

you should see something like this: