Changes

From SME Server
Jump to navigationJump to search
240 bytes added ,  19:57, 10 August 2010
Wikification, add numbers to the instruction and a minor typo
Line 162: Line 162:     
====Convert Software RAID1 to RAID5====
 
====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)
+
{{Note box|msg=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)}}
 
+
{{Warning box|msg=Please make a full backup before proceeding}}
* CAUTION MAKE A FULL BACKUP!
+
<ol></li><li>Login as root
 
+
</li><li>Move to /boot (we must create a new initrd image to load raid5 driver).
Login as root
  −
Move to /boot (we must create a new initrd image to load raid5 driver).
   
  cd /boot
 
  cd /boot
Make a backup copy  
+
</li><li>Make a backup copy  
 
  mv initrd-`uname -r`.img initrd-`uname -r`.img.old
 
  mv initrd-`uname -r`.img initrd-`uname -r`.img.old
Create the new image
+
</li><li>Create the new image
 
  mkinitrd --preload raid5 initrd-`uname -r`.img `uname -r`
 
  mkinitrd --preload raid5 initrd-`uname -r`.img `uname -r`
   −
Shut down and install new drive(s) in system.  
+
</li><li>Shut down and install new drive(s) in system.  
   −
Boot up with SME cd and enter the rescue mode.
+
</li><li>Boot up with SME cd and enter the rescue mode.
 
  sme rescue
 
  sme rescue
Skip network setup.
+
</li><li>Skip network setup.
Skip mounting the current SME installation.
+
</li><li>Skip mounting the current SME installation.
Now, create on the new drive(s) the correct partition table.
+
</li><li>Now, create on the new drive(s) the correct partition table.
 
  sfdisk -d /dev/sda > tmp.out
 
  sfdisk -d /dev/sda > tmp.out
 
  sfdisk /dev/sdc < tmp.out
 
  sfdisk /dev/sdc < tmp.out
   −
Repeat the last step for each new hd (sdd, sde ecc.).
+
</li><li>Repeat the last step for each new hd (sdd, sde ecc.).
Create the new array
+
</li><li>Create the new array
 
  mdadm --create /dev/md2 -c 256 --level=5 --raid-devices=2 /dev/sda2 /dev/sdb2
 
  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:
 
  mdadm: /dev/sda2 appears to be part of a raid array:
Line 194: Line 192:  
  mdadm: array /dev/md2 started.
 
  mdadm: array /dev/md2 started.
   −
Wait for resync; monitor the status with
+
</li><li>Wait for resync; monitor the status with
 
  cat /proc/mdstat
 
  cat /proc/mdstat
 
   
 
   
Line 202: Line 200:  
  1048512 blocks level 5, 256k chunk, algorithm 2 [2/1] [U_]
 
  1048512 blocks level 5, 256k chunk, algorithm 2 [2/1] [U_]
 
  [==>..................]  recovery = 12.5% (132096/1048512) finish=0.8min speed=18870K/sec
 
  [==>..................]  recovery = 12.5% (132096/1048512) finish=0.8min speed=18870K/sec
Reboot  
+
</li><li>Reboot  
 
  exit
 
  exit
Login as root
+
</li><li>Login as root
Add the new drives to the array
+
</li><li>Add the new drives to the array
 
  mdadm --add /dev/md2 /dev/sdc2
 
  mdadm --add /dev/md2 /dev/sdc2
   −
Repeat the last step for each new hd (sdd2, sde2 ecc.)
+
</li><li>Repeat the last step for each new hd (sdd2, sde2 ecc.)
   −
Grow the array
+
</li><li>Grow the array
 
  mdadm --grow /dev/md2 --raid-devices=N
 
  mdadm --grow /dev/md2 --raid-devices=N
   −
N is the total number of drives: minimun is 3
+
</li><li>N is the total number of drives: minimum is 3
   −
Wait for array reshaping. This part can take a substantial amount of time; monitor it with
+
</li><li>Wait for array reshaping. This part can take a substantial amount of time; monitor it with
 
  cat /proc/mdstat
 
  cat /proc/mdstat
 
   
 
   
Line 224: Line 222:  
  [==>..................]  reshape = 12.5% (131520/1048512) finish=2.5min speed=5978K/sec
 
  [==>..................]  reshape = 12.5% (131520/1048512) finish=2.5min speed=5978K/sec
   −
 
+
</li><li>Issue the following commands:
Issue the following commands:
   
  pvresize /dev/md2
 
  pvresize /dev/md2
 
  lvresize -l +100%FREE main/root
 
  lvresize -l +100%FREE main/root
 
  resize2fs /dev/main/root   
 
  resize2fs /dev/main/root   
 
+
</li></ol>
 
Notes :   
 
Notes :   
 
* If you have disabled lvm   
 
* If you have disabled lvm   
Line 236: Line 233:  
# More info: http://www.arkf.net/blog/?p=47
 
# More info: http://www.arkf.net/blog/?p=47
    +
----
 
<noinclude>[[Category:Howto]][[Category:Administration:Storage]]</noinclude>
 
<noinclude>[[Category:Howto]][[Category:Administration:Storage]]</noinclude>

Navigation menu