Line 29: |
Line 29: |
| smartctl -i /dev/hda | | smartctl -i /dev/hda |
| | | |
− | ====Adding another Hard Drive Later (Raid 1 array only)==== | + | ====Adding another Hard Drive Later (Raid1 array only)==== |
| | | |
| ENSURE THAT THE NEW DRIVE IS THE SAME SIZE OR LARGER AS THE CURRENT DRIVE(S) | | ENSURE THAT THE NEW DRIVE IS THE SAME SIZE OR LARGER AS THE CURRENT DRIVE(S) |
| * Shut down the machine | | * Shut down the machine |
− | * Install drive as master on the second IDE channel (hdc) | + | * Install drive as master on the second IDE channel (hdc) or the second SATA channel (sda) |
| * Boot up | | * Boot up |
− | * Log on as admin to get to the admin console | + | * At the login prompt log on as admin with the root password to get to the admin console |
| * Go to #5 Manage disk redundancy | | * Go to #5 Manage disk redundancy |
| | | |
− | It should tell you there if the drives are syncing up. Don't turn off the server until the sync is complete or it will start from the beginning again. When it is done syncing it will show a good working raid1. | + | It will show the status and progress if the drives are syncing up. Don't turn off the server until the sync is complete or it will start syncing again from the beginning. When it is done syncing, it will show a good working Raid1. |
| | | |
− | If the Manage disk redundancy page gives the message "The free disk count must equal one" and "Manual intervention may be required", then you likely will have additional hard drives that need to be disconnected while the RAID is set up. An external USB drive will have this effect, and should be unplugged. | + | If the Manage disk redundancy page displays the message "The free disk count must equal one" and "Manual intervention may be required", then you probably have additional hard drives that need to be disconnected while the RAID is set up. An external USB drive will have this effect, and should be unplugged. |
| + | |
| + | {{Note box| the addition of another drive is restricted to a Raid1 that is degraded, i.e. when the system has been installed with a single drive (/dev/hda and /dev/hdc or their SATA equivalent). The addition of a third drive to a Raid1 '''(i.e. a spare)''' is not recognized by the system. To add a spare you need to use the management tool '''mdadm''' at the command line}} |
| + | |
| + | {{Note box|I will assume the system is installed with a Raid1 array functioning with two disks sda and sdb and you want to add another disk sdc as a spare (for adding to the array automatically if one disk of the array fails). This HowTo can be adapted to other types of RAID as long as you want to add a spare disk.}} |
| + | |
| + | First we need write the partition table from sda (or sdb) to sdc : |
| + | |
| + | sfdisk -d /dev/sda > sfdisk_sda.output |
| + | sfdisk /dev/sdc < sfdisk_sda.output |
| + | |
| + | Then we need to add the new partitions to the existings arrays : |
| + | |
| + | mdadm --add /dev/md1 /dev/sdc1 |
| + | mdadm --add /dev/md2 /dev/sdc2 |
| + | |
| + | Verify this with : |
| + | |
| + | mdadm --detail /dev/md1 |
| + | mdadm --detail /dev/md2 |
| + | |
| + | /dev/md1: |
| + | Version : 0.90 |
| + | Creation Time : Sat Feb 2 22:24:38 2013 |
| + | Raid Level : raid1 |
| + | Array Size : 104320 (101.89 MiB 106.82 MB) |
| + | Used Dev Size : 104320 (101.89 MiB 106.82 MB) |
| + | Raid Devices : 2 |
| + | Total Devices : 3 |
| + | Preferred Minor : 1 |
| + | Persistence : Superblock is persistent |
| + | |
| + | Update Time : Mon Feb 4 13:28:43 2013 |
| + | State : clean |
| + | Active Devices : 2 |
| + | Working Devices : 3 |
| + | Failed Devices : 0 |
| + | Spare Devices : 1 |
| + | |
| + | UUID : f97a86c5:8bb46daa:6854855e:558a3e16 |
| + | Events : 0.6 |
| + | |
| + | Number Major Minor RaidDevice State |
| + | 0 8 1 0 active sync /dev/sda1 |
| + | 1 8 17 1 active sync /dev/sdb1 |
| + | |
| + | 2 8 33 - spare /dev/sdc1 |
| + | |
| + | Alternatively you can try this. |
| + | |
| + | cat /proc/mdstat |
| + | |
| + | cat /proc/mdstat |
| + | Personalities : [raid1] |
| + | md1 : active raid1 sdc1[2](S) sdb1[1] sda1[0] |
| + | 104320 blocks [2/2] [UU] |
| + | |
| + | md2 : active raid1 sdc2[2](S) sdb2[1] sda2[0] |
| + | 52323584 blocks [2/2] [UU] |
| + | |
| + | (S)= Spare |
| + | (F)= Fail |
| + | [0]= number of the disk |
| + | |
| + | You should ensure that grub has been written correctly to the spare disk to ensure that it will boot correctly. |
| + | |
| + | {{Warning box|Grub is unable to install itself on an empty disk or empty partitions; to have the spare fully working and booting after a sync the boot partition on the spare drive needs to be duplicated:}} |
| + | |
| + | to copy boot partition (sda=disk of the array sdc=the spare) |
| + | |
| + | dd if=/dev/sda1 of=/dev/sdc1 |
| + | |
| + | From within a terminal with administrator privileges : |
| + | |
| + | grub |
| + | device (hd2) /dev/sdc |
| + | root (hd2,0) |
| + | setup (hd2) |
| + | |
| + | Last of all, try forcing a failure of one of the original two drives and ensure that the server boots, and the RAID rebuilds corectly. You may then have to repeat this exercise to get the drives in the correct order (i.e sda/sdb in the array with sdc as the spare) |
| | | |
− | {{Note box| the addition of another drive is restricted to a RAID 1 degraded scenario, i.e. Raid1 with one hard drives only (/dev/hda and /dev/hdc or their SATA equivalent). The addition of a third drive to a RAID 1 '''(i.e. a spare)''' is not recognized by the system}}
| |
| | | |
| ====Reusing Hard Drives==== | | ====Reusing Hard Drives==== |