Changes

Jump to navigation Jump to search
2,716 bytes added ,  16:49, 7 December 2008
Adding instructions to add another RAID array
Line 1: Line 1:  
{{Languages|AddExtraHardDisk}}
 
{{Languages|AddExtraHardDisk}}
 +
{{Level|Advanced}}
 +
 
This HowTo are based on [http://mirror.contribs.org/smeserver/contribs/mblotwijk/HowToGuides/AddExtraHardDisk.htm Michiel Blotwijk original].
 
This HowTo are based on [http://mirror.contribs.org/smeserver/contribs/mblotwijk/HowToGuides/AddExtraHardDisk.htm Michiel Blotwijk original].
   Line 5: Line 7:  
How to add an extra hard disk to an existing (running) SME server 7.x.
 
How to add an extra hard disk to an existing (running) SME server 7.x.
   −
'''Caution'''
+
{{Warning box|Adding a Single Disk )or non-raid disks):If you are adding only a single or non-raid disk then please note that the added harddrive will NOT take part of a RAID-array and hence get no redundancy. Consider also that if this disk fails the whole system goes down.
   −
Please note that the added harddrive will NOT take part of an RAID-array and hence get no redundancy.
+
It's intended for special purposes only where you can benefit from mounting a dedicated harddrive to an ibay.}}
Consider also that if this disk fails the whole system goes down.
+
 
 +
{{Warning box|If you do a complete re-install at a later time, please recall that all available disks will be used at that time including these new additions. If you do a re-install and wish to preserve this data then ensure you remove these hard drives at that time.}}
   −
It's intended for special purpouses only where you can benefit of mounting a dedicated harddrive to an ibay.
      
== Assumptions ==
 
== Assumptions ==
Line 26: Line 28:  
*When you add a drive to a running system, it will not take part of anything unless you do something about it. This is the case in this HowTo. Note that it will NOT take part in any RAID array and hence, get no redundancy.
 
*When you add a drive to a running system, it will not take part of anything unless you do something about it. This is the case in this HowTo. Note that it will NOT take part in any RAID array and hence, get no redundancy.
   −
*If you want the new drive to be part of an RAID array instead, get shell access, login as admin and select "5. Manage disk redundancy" and follow the instructions. The new disk should be empty and contain no partitions before doing this.
+
*If you want the new drive to be part of the SME RAID array instead, get shell access, login as admin and select "5. Manage disk redundancy" and follow the instructions. The new disk should be empty and contain no partitions before doing this.
    
*For more info about RAID and disk management, take a look in the [[SME_Server:Documentation]].
 
*For more info about RAID and disk management, take a look in the [[SME_Server:Documentation]].
Line 37: Line 39:  
1.1 Get direct shell access and login as root.
 
1.1 Get direct shell access and login as root.
   −
1.2 Tell init to go to single-user mode.
+
1.2 Tell init to go to single-user mode. (Optional, if the drives are complete clean, this is not necessary)
    
  telinit 1
 
  telinit 1
Line 44: Line 46:     
=== 2 Partition ===
 
=== 2 Partition ===
2.0 Now you need to identify the device name of the new disk.  
+
2.0 Identifying the disks
 +
 
 +
Now you need to identify the device name of the new disk.  
 +
 
 +
As a safety measure, identify and mark your disks. The following smartctl command will identify various parameters including the serial number which can be matched to the serial number on the physical package.
 +
smartctl -i /dev/hdc
    
The following command will show you all the drives on your server (including any USB drives you might have).
 
The following command will show you all the drives on your server (including any USB drives you might have).
Line 74: Line 81:  
|}
 
|}
    +
{{Note box|If you are setting up a raid array, it is a really good idea to eliminate single points of failure. For example try to avoid putting to disks of the same raid array on the same ribbon cable. }}
   −
2.1 Let's assume you installed the disk as master on the second IDE controller.
+
2.1 Paritioning the disk
 +
Let's assume you installed the disk as master on the second IDE controller.
 
<br>This means you have to partition /dev/hdc
 
<br>This means you have to partition /dev/hdc
   Line 85: Line 94:  
  p (to make a primary partion)
 
  p (to make a primary partion)
 
  1 (that's the number one, the number you want to assign to the partition)
 
  1 (that's the number one, the number you want to assign to the partition)
 +
 +
Only if you will be adding this disk to to a RAID set, then you will also need to change the partition type.
 +
t (to change partion type)
 +
L (within t's prompt to list available parition type)
 +
fd (normally the parition type is fd but verify from the L command and look for "Linux raid autodetect"
    
Accept the suggested first & last cylinder values
 
Accept the suggested first & last cylinder values
Line 92: Line 106:  
This will create the primary partition /dev/hdc1, using the entire disk space.
 
This will create the primary partition /dev/hdc1, using the entire disk space.
   −
2.2 Format the new partition to ext3:
+
You will need to do this for each new disk you added.
 +
 
 +
2.2 Formating for a non-raid disk
 +
For a non-raid disk, Format the new partition to ext3:
 
  mkfs.ext3 /dev/hdc1
 
  mkfs.ext3 /dev/hdc1
 +
 +
 +
2.3 Additional steps to create a raid array from multiple disks
 +
 +
When you create an array, the various disks you added will be combined and be represented as a single entity typically identified as /dev/mdxx where xx is a number. For example, the SME Raids are typically on md1, md2, and in some cased md0.
 +
 +
For your purposes, you will choose an available one. In this example we will use md11 in an attempt to not get in the way of future changes to SME and make it easy to identify your new set.
 +
 +
First we need to add the newly (and identically) partitioned disks to the raid device:
 +
mdadm --create --verbose /dev/md11 --level=1 --raid-devices=1 /dev/hdc1 /dev/hdd1
 +
 +
At this point the Raid will begin building.
 +
 +
Next you will need to format the new array:
 +
mkfs.ext3 /dev/md11
 +
 +
You can verify that all is good with the following commands:
 +
cat /proc/mdstat
 +
mdadm --detail --scan --verbose
 +
 +
next you will need to edit the /etc/mdadm.conf file to add your array with the following after the other ARRAY entries:
 +
# added by <your name here> -- so you can identify later you did this.
 +
ARRAY /dev/md11
 +
 +
Alternatively you could add the output of
 +
mdadm --detail --scan --verbose
 +
 +
to this file instead to be more specific. I have not tried this.
    
=== 3 Mount ===
 
=== 3 Mount ===
Line 102: Line 147:  
<br>In step 4 you will see a much better method to link your /home directory to the second disk.
 
<br>In step 4 you will see a much better method to link your /home directory to the second disk.
   −
3.0 Create a directory underneath /mnt
+
3.1 Create a directory underneath /mnt
 
  mkdir /mnt/newdisk
 
  mkdir /mnt/newdisk
   −
3.1 Automount at boot time
+
3.2 Automount at boot time
 
<br>To automatically mount the partition at boot time, you need to add the following line to the file /etc/fstab  
 
<br>To automatically mount the partition at boot time, you need to add the following line to the file /etc/fstab  
 
<br>It can be done in the text editor Pico
 
<br>It can be done in the text editor Pico
    
  pico /etc/fstab
 
  pico /etc/fstab
Add the following data to the file (separate columns with a hit on the space-bar):
+
Add the following data to the file for a SINGLE disk (separate columns with a hit on the space-bar):
 
  /dev/hdc1 /mnt/newdisk ext3 usrquota,grpquota 1 2  
 
  /dev/hdc1 /mnt/newdisk ext3 usrquota,grpquota 1 2  
 +
 +
or for a RAID array:
 +
/dev/md11 /mnt/newdisk ext3 usrquota,grpquota 1 2
 +
 
Make sure you end this line with a newline (with enter).
 
Make sure you end this line with a newline (with enter).
 
<br>Hit <ctrl-x> to exit the editor, y and enter to save.
 
<br>Hit <ctrl-x> to exit the editor, y and enter to save.
   −
3.2 Mount manually (this time) all filesystems listed in /etc/fstab
+
3.3 Mount manually (this time) all filesystems listed in /etc/fstab
    
  mount -a
 
  mount -a
   −
3.3 Report the amount of free disk space available on all mounted filesystems + the type of each filesystem, check if it looks OK.
+
3.4 Report the amount of free disk space available on all mounted filesystems + the type of each filesystem, check if it looks OK.
 
  df -T
 
  df -T
   Line 127: Line 176:  
  /dev/hdc1  ext3 38474956  27948    38447008  0%  /mnt/newdisk
 
  /dev/hdc1  ext3 38474956  27948    38447008  0%  /mnt/newdisk
   −
If you don't see a line for /dev/hdc1, something went wrong.
+
If you don't see a line for /dev/hdc1 (or /dev/md11 if it is raid), something went wrong.
 
<br>Go back to step 2 and check if you followed all instructions correctly.
 
<br>Go back to step 2 and check if you followed all instructions correctly.
  
147

edits

Navigation menu