Difference between revisions of "How to add additional hdd in MOR"

From Kolmisoft Wiki
Jump to navigationJump to search
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
= Do full backup of your system or atleast of database before performing following tasks!!! =
= ----> '''Make a full backup of your system or atleast of database before performing following actions!!!''' <---- =




Line 74: Line 74:
you should see something like this:
you should see something like this:


  [root@izibilling mor]# df -h
  [root@testbilling mor]# df -h
  Filesystem            Size  Used Avail Use% Mounted on
  Filesystem            Size  Used Avail Use% Mounted on
  /dev/mapper/VolGroup00-LogVol00
  /dev/mapper/VolGroup00-LogVol00

Latest revision as of 15:15, 28 March 2011

----> Make a full backup of your system or atleast of database before performing following actions!!! <----

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
Example:
/dev/xvda3         /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:

[root@testbilling mor]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      5.8G  2.3G  3.3G  42% /
/dev/xvda1             99M   21M   74M  22% /boot
tmpfs                 1.0G     0  1.0G   0% /dev/shm
/dev/disknumber           SizeG  UsedM  FreeG   1% /mnt/secondhdd