5- Proceso de creación de un RAID por Software

Imagen de Epe

Bueno, este proceso lo explicaré suponiendo tienes tu CentOS instalado, y tienes dos discos libres (les llamaré /dev/sdb y /dev/sdc) a los cuales les pondrás en RAID.

Quizá esto desees porque quieres tener una nueva partición con RAID por alguna razón.

Debemos tener en cuenta que para hacer un RAID por software necesitamos tener dos discos, y además necesitamos p articionarlos.

El RAID por software necesita de dos particiones (las usaré idénticas pues haré RAID-1) del tipo fd (Software RAID)

Asumiré que haré sendas particiones de RAID en los discos.

Primer disco, borraré todas las particiones y después crearé una sola partición de tipo RAID:

[root@eperez ~]# fdisk /dev/sdb

The number of cylinders for this disk is set to 19457.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): d
Partition number (1-4): 4
Warning: partition 4 has empty type

Command (m for help): d
Partition number (1-4): 3

Command (m for help): d
Partition number (1-4): 2

Command (m for help): d
Selected partition 1

Command (m for help): p

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-19457, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-19457, default 19457):
Using default value 19457

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): fd
Changed system type of partition 1 to fd (Linux raid autodetect)

Command (m for help): p

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 19457 156288321 fd Linux raid autodetect

Command (m for help): w

Bien, acabo de crear anteriormente una partición llamada sdb1 de tipo Linux RAID autodetect

Ahora hago lo mismo con el segundo disco (/dev/sdc)

[root@eperez ~]# fdisk /dev/sdc

The number of cylinders for this disk is set to 19457.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): d
Partition number (1-4): 4
Warning: partition 4 has empty type

Command (m for help): d
Partition number (1-4): 3

Command (m for help): d
Partition number (1-4): 2

Command (m for help): d
Selected partition 1

Command (m for help): p

Disk /dev/sdc: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-19457, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-19457, default 19457):
Using default value 19457

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): fd
Changed system type of partition 1 to fd (Linux raid autodetect)

Command (m for help): p

Disk /dev/sdc: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdc1 1 19457 156288321 fd Linux raid autodetect

Command (m for help): w

Correcto, ahora tenemos dos particiones (/dev/sdb1 y /dev/sdc1) ambas del mismo tamaño, ambas de tipo Linux RAID autodetect

Procederé ahora a unir ambas particiones mediante la herramienta mdadm, obtendré un nuevo dispositivo llamado md, en este caso será el primero /dev/md0


mdadm create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1

Con este comando asocio ambas particiones (sdb1 y sdc1) en un raid por software llamado /dev/md0

Ahora puedo proceder a formatearlo y usarlo:

mkfs.ext3 /dev/md0
mount /dev/md0 /mnt
ls /mnt

En fin, una vez formateado puedes darle uso a /dev/md0 como desees.

Usando otro tipo de RAID:
Sencillamente en --level=X pones el numero de RAID que desees (1, 0, 5)

Comentarios

Problema RAID1

Hola amigo, soy nuevo en esto del RAID, configuré un RAID1 pero a través de la BIOS, ya que la placa soporta RAID,creé el RAID con 2 discos iguales (mismo tamaño, misma marca modelo etc).
Al arrancar la detección de dispositivos me reconoce el raid y muestra funcional. Instalo CentO.S. 6,3 finaliza correctamente la instalción, se reinicia el sistema, muestra nuevamente la detección de dispositivos, reconoce el RAID, pero no me carga el SISTEMA OPERATIVO, se queda en negro.

Que podrá ser?? creo que puede ser un problema con el gestor de arranque, pero realicé una segunda instalación, pero ocurre lo mismo.

Mi duda también se da en que momento se debe hacer el raid, con ambos discos vacios?? o cuando el primero disco ya tiene S.O instalado y funcionando..

Agredezco desde y cualquier comentario y eventual ayuda

ok, entiendo que es un raid

Imagen de Epe

ok, entiendo que es un raid por hardware, pero no dices la versión.. quizá debas contactar al fabricante para que te indique qué sucede..

yo realmente no creo que sea el raid, el raid por hw es simplemente eso: se presentará un disco (que es el raid) y ya, sobre él se instala.. quizá esté escribiendo el grub hacia otro dispositivo.

Saludos
epe

EcuaLinux.com

+(593) 9 9924 6504

Servicios en Software Libre