Changes

From SME Server
Jump to navigationJump to search
2,483 bytes added ,  11:01, 10 August 2010
no edit summary
Line 160: Line 160:     
Also check your driver cards, since a faulty card can destroy the data on a full RAID set as easily as it can a single disk.
 
Also check your driver cards, since a faulty card can destroy the data on a full RAID set as easily as it can a single disk.
 +
 +
====Convert Software RAID1 to RAID5====
 +
Note: these instructions are only applicable if you have SME8 and a RAID1 system with 2 hd in sync; new drive(s) must be of the same size or larger as the current drive(s)
 +
 +
* CAUTION MAKE A FULL BACKUP!
 +
 +
Login as root
 +
Move to /boot (we must create a new initrd image to load raid5 driver).
 +
cd /boot
 +
Make a backup copy
 +
mv initrd-`uname -r`.img initrd-`uname -r`.img.old
 +
Create the new image
 +
mkinitrd --preload raid5 initrd-`uname -r`.img `uname -r`
 +
 +
Shut down and install new drive(s) in system.
 +
 +
Boot up with SME cd and enter the rescue mode.
 +
sme rescue
 +
Skip network setup.
 +
Skip mounting the current SME installation.
 +
Now, create on the new drive(s) the correct partition table.
 +
sfdisk -d /dev/sda > tmp.out
 +
sfdisk /dev/sdc < tmp.out
 +
 +
Repeat the last step for each new hd (sdd, sde ecc.).
 +
Create the new array
 +
mdadm --create /dev/md2 -c 256 --level=5 --raid-devices=2 /dev/sda2 /dev/sdb2
 +
mdadm: /dev/sda2 appears to be part of a raid array:
 +
level=raid1 devices=2 ctime=Fri Dec 18 13:17:49 2009
 +
mdadm: /dev/sdb2 appears to be part of a raid array:
 +
level=raid1 devices=2 ctime=Fri Dec 18 13:17:49 2009
 +
Continue creating array? y
 +
mdadm: array /dev/md2 started.
 +
 +
Wait for resync; monitor the status with
 +
cat /proc/mdstat
 +
 +
root# cat /proc/mdstat
 +
Personalities : [raid0] [raid1] [raid5]
 +
md2 : active raid5 sdb1[2] sda1[0]
 +
1048512 blocks level 5, 256k chunk, algorithm 2 [2/1] [U_]
 +
[==>..................]  recovery = 12.5% (132096/1048512) finish=0.8min speed=18870K/sec
 +
Reboot
 +
exit
 +
Login as root
 +
Add the new drives to the array
 +
mdadm --add /dev/md2 /dev/sdc2
 +
 +
Repeat the last step for each new hd (sdd2, sde2 ecc.)
 +
 +
Grow the array
 +
mdadm --grow /dev/md2 --raid-devices=N
 +
 +
N is the total number of drives: minimun is 3
 +
 +
Wait for array reshaping. This part can take a substantial amount of time; monitor it with
 +
cat /proc/mdstat
 +
 +
root# cat /proc/mdstat
 +
Personalities : [raid0] [raid1] [raid5]
 +
md2 : active raid5 sdc1[2] sdb1[1] sda1[0]
 +
1048512 blocks super 0.91 level 5, 256k chunk, algorithm 2 [3/3] [UUU]
 +
[==>..................]  reshape = 12.5% (131520/1048512) finish=2.5min speed=5978K/sec
 +
 +
 +
Issue the following commands:
 +
pvresize /dev/md2
 +
lvresize -l +100%FREE main/root
 +
resize2fs /dev/main/root 
 +
 +
Notes : 
 +
* If you have disabled lvm 
 +
# you don't need the pvresize or lvresize command
 +
# the final line becomes resize2fs /dev/md2 (or whatever / is mounted to)
 +
# More info: http://www.arkf.net/blog/?p=47
    
<noinclude>[[Category:Howto]][[Category:Administration:Storage]]</noinclude>
 
<noinclude>[[Category:Howto]][[Category:Administration:Storage]]</noinclude>
67

edits

Navigation menu