tlicht
The most important thing you should do FIRST is make a full system backup. At least now you have a working intact system with data, albeit in single drive degraded mode.
You can add a larger disk to the degraded array (& just sacrifice it's extra space) but not add a smaller disk.
Are you saying your working disk is larger than the spare (120Gb) disk you want to add in ?
There was a RAID recovery Howto by Darrell May but it's not on his contribs site anymore. My copy appears to be corrupted so I will have to search through my archive backups for it.
Here is a different but very old Howto from 2001 (extracts), which should still be applicable to sme6.x
If your disks are IDE, ensure both disks are configured as the master device, one on each of the IDE buses.
Ensure both disks have the same geometry. (Ideally the exact same make and model of drive will be used.)
Be aware that there is currently no automatic failure detection.
2. Detecting a RAID array failure
2.1. Failure Modes
There are two types of failure that may occur with respect to Software RAID. The first is a single disk failure, in which the array is "degraded", and the second is multiple disk failure, in which both drives have failed. This HOWTO will not get into detail about multiple disk failure, but will detail how to repair the more common failure, a degraded array.
2.2. Detection of RAID array failure
Currently there exists no automatic detection for degraded arrays. It is up to the administrator to prepare a script to monitor the array, or perform regular checkups to verify a healthy system.
There are three ways that an administrator can detect a degraded array. One is by reviewing the system log /var/log/messages for kernel warnings, and another is by viewing the "kernel ring buffer" with /bin/dmesg. The best way to query the status of the array is by examing the file /proc/mdstat.
2.2.1. /proc/mdstat
To view what the file /proc/mdstat contains, 'cat' the file:
[root@vmware-pkn2]# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
md2 : active raid1 hdd1[1] hda1[0] 264960 blocks [2/2] [UU]
md0 : active raid1 hdd5[1] hda5[0] 15936 blocks [2/2] [UU]
md1 : active raid1 hdd6[1] hda6[0] 9735232 blocks [2/2] [UU]
unused devices: <none>
The contents of /proc/mdstat as shown above indicates a healthy disk array. There are two indicators. The first is the presence of two partitions per raid partition. For example, the raid partition md2 is an active raid partition containing the two hard disk partitions, hdd1 and hda1.
The second indicator is the [UU] bit. A degraded array, or an array that is in the process of being built will contain [U_].
Compare the contents of /proc/mdstat from a machine with a degraded disk array:
[root@vmware-pkn2]# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
md2 : active raid1 hda1[0] 264960 blocks [2/1] [U_]
md0 : active raid1 hda5[0] 15936 blocks [2/1] [U_]
md1 : active raid1 hda6[0] 9735232 blocks [2/1] [U_]
unused devices: <none>
Note only hda partitions are present in the raid partitions.
2.2.2. The system log (/var/log/messages)
A scan (or grep) of the system log /var/log/messages will also provide clues that an array has failed:
[root@vmware-pkn2]# grep -e raid -e degraded /var/log/messages
May 16 13:02:59 vmware-pkn2-55b1SL kernel: raid1: device hda5 operational as mirror 0
May 16 13:02:59 vmware-pkn2-55b1SL kernel: raid1: md0, not all disks are operational -- trying to recover array
May 16 13:02:59 vmware-pkn2-55b1SL kernel: md1: no spare disk to reconstruct array! -- continuing in degraded mode
The first kernel warning indicates that disk hdd has failed, and that disk hda is still operational.
2.2.3. The kernel ring buffer (/bin/dmesg)
When the output of /bin/dmesg is examined, a degraded array is easily detectable. grep through the log for 'degraded' to detect a failing RAID array.
[root@vmware-pkn2]# /bin/dmesg | grep degraded
md2: no spare disk to reconstruct array! -- continuing in degraded mode
md0: no spare disk to reconstruct array! -- continuing in degraded mode
2.3. Simulating a degraded RAID array
To simulate a degraded array, power down your server and unplug one of the two drives. Reboot the server and examine /proc/mdstat/. Following the instructions in Section 3 "Repairing a degraded RAID array" to repair the array.
3. Repairing a degraded RAID array
If you have detected that one of your RAID disks has failed, you can refer to the following instructions in order to repair the array.
At a convenient time, shutdown your SME Server and replace the faulty disk. The new disk should have the same geometry as both the old disk and the current working disk. Boot the server.
Switch to a login prompt (press Alt+F2 if you are viewing the console) and login as root.
Partition the new disk. It should be partitioned exactly the same as the other disk. Use the following command to determine the current partition details for the working disk /dev/hdd:
fdisk -l /dev/hdd
You should see details similar to:
Disk /dev/hdd: 64 heads, 63 sectors, 1015 cylinders
Units = cylinders of 4032 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hdd1 * 1 131 264064+ fd Linux raid autodetect
/dev/hdd2 132 1015 1782144 5 Extended
/dev/hdd5 132 137 12064+ fd Linux raid autodetect
/dev/hdd6 138 1015 1770016+ fd Linux raid autodetect
Set up the identical partitions on /dev/hda using the command
fdisk /dev/hda
Use the fdisk -l command to double check to make sure the partitions are exactly the same as those on the working disk, /dev/hdd.
Determine which partitions have been mirrored. Look at the file /proc/mdstat, where you should see something like this (note that this file is from a working system and not one that has failed):
# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
md2 : active raid1 hdd1[1] hda1[0] 264000 blocks [2/2] [UU]
md0 : active raid1 hdd5[1] hda5[0] 11968 blocks [2/2] [UU]
md1 : active raid1 hdd6[2] hda6[0] 1769920 blocks [2/2] [UU]
unused devices: <none>
This file indicates that you have three "meta-devices" that are mirrored:
md0 - using hdd5 and hda5
md1 - using hdd6 and hda6
md2 - using hdd1 and hda1
Re-attach the partitions from the new disk to the RAID devices:
/sbin/raidhotadd /dev/md0 /dev/hda5
/sbin/raidhotadd /dev/md1 /dev/hda6
/sbin/raidhotadd /dev/md2 /dev/hda1
You can see the progress of the raid resyncronization by examining /proc/mdstat. The following example output shows that both /dev/md0 and /dev/md2 are fully synchronized and /dev/md1 is 58% synchronized.
# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
md2 : active raid1 hdd1[1] hda1[0] 264000 blocks [2/2] [UU]
md0 : active raid1 hdd5[1] hda5[0] 11968 blocks [2/2] [UU]
md1 : active raid1 hdd6[2] hda6[0] 1769920 blocks [2/1] [U_] recovery=58% finish=2.6min
unused devices: <none>