informatica:linux:raid
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| informatica:linux:raid [2015/04/16 06:33] – [Cambiar disco en frio (apagando server)] javi | informatica:linux:raid [2020/11/15 13:11] (current) – jose | ||
|---|---|---|---|
| Line 71: | Line 71: | ||
| For the record, here's how I do the MBR replication: | For the record, here's how I do the MBR replication: | ||
| - | # grub --no-floppy | + |  | 
| - | + | < | |
| - | device (hd0) / | + | device (hd0) /dev/sda | 
| - | root (hd0, | + | root (hd0,0) | 
| setup (hd0) | setup (hd0) | ||
| - | device (hd0) / | + | device (hd0) /dev/sdb | 
| - | root (hd0, | + | root (hd0,0) | 
| setup (hd0) | setup (hd0) | ||
| - | device (hd0) / | + | device (hd0) /dev/sdc | 
| - | root (hd0, | + | root (hd0,0) | 
| setup (hd0) | setup (hd0) | ||
| Line 93: | Line 93: | ||
| * take great care that the raid1 is in sync, to insure that all the required files are in their final position on disk | * take great care that the raid1 is in sync, to insure that all the required files are in their final position on disk | ||
| * thanks to grub's architecture, | * thanks to grub's architecture, | ||
| + | </ | ||
| ==== Cambiar un disco ==== | ==== Cambiar un disco ==== | ||
| Line 99: | Line 100: | ||
| Mostramos los discos que hay | Mostramos los discos que hay | ||
| - |  | + | cat / | 
| < | < | ||
| Personalities : [raid1] [raid6] [raid5] [raid4] | Personalities : [raid1] [raid6] [raid5] [raid4] | ||
| Line 154: | Line 155: | ||
| </ | </ | ||
| - |  | + | mdadm --detail /dev/md1 | 
| < | < | ||
| /dev/md1: | /dev/md1: | ||
| Line 249: | Line 250: | ||
| </ | </ | ||
| - |  | + | mdadm --detail /dev/md1 | 
| < | < | ||
| /dev/md1: | /dev/md1: | ||
| Line 320: | Line 321: | ||
| 9767424 blocks [3/3] [UUU] | 9767424 blocks [3/3] [UUU] | ||
| - | #mdadm --detail / | + |  | 
| - | / | + | |
| - | Version : 00.90.03 | + | < | 
| - | Creation Time : Thu Oct 25 21:15:28 2007 \\ | + | /dev/md0: | 
| - | Raid Level : raid1 \\ | + | Version : 00.90.03 | 
| - | Array Size : 9767424 (9.31 GiB 10.00 GB) \\ | + | Creation Time : Thu Oct 25 21:15:28 2007 | 
| - | Device Size : 9767424 (9.31 GiB 10.00 GB) \\ | + | Raid Level : raid1 | 
| - | Raid Devices : 3 \\ | + | Array Size : 9767424 (9.31 GiB 10.00 GB) | 
| - | Total Devices : 3 \\ | + | Device Size : 9767424 (9.31 GiB 10.00 GB) | 
| - |  | + | Raid Devices : 3 | 
| - | Persistence : Superblock is persistent | + | Total Devices : 3 | 
| + |  | ||
| + | Persistence : Superblock is persistent | ||
| - | Update Time : Sat Nov 3 15:07:36 2007 \\ | + | Update Time : Sat Nov 3 15:07:36 2007 | 
| - | State : clean \\ | + | State : clean | 
| - |  | + |  | 
| - |  | + |  | 
| - |  | + |  | 
| - | Spare Devices : 0 \\ | + | Spare Devices : 0 | 
| - | UUID : a912d356: | + | UUID : a912d356: | 
|  |  | ||
| - | Number | + | Number | 
| - |  | + |  | 
| - |  | + |  | 
|  |  | ||
| + | </ | ||
| + | Añadimos el disco: | ||
| - | Añadimos el disco: \\ | + |  | 
| - | #mdadm /dev/md0 -a / | + | mdadm: added /dev/sdb1 | 
| - | mdadm: added /dev/sdb1 | + | |
| - | Ahora el disco aparecerà en reserva: | + | Ahora el disco aparecerà en reserva: | 
| servidor:~# mdadm --detail /dev/md0 | servidor:~# mdadm --detail /dev/md0 | ||
| + | < | ||
| /dev/md0: | /dev/md0: | ||
| Version : 00.90.03 | Version : 00.90.03 | ||
| Line 381: | Line 386: | ||
|  |  | ||
| + | </ | ||
| Aumentamos el tamaño del RAID para que lo coja: | Aumentamos el tamaño del RAID para que lo coja: | ||
| #mdadm --grow /dev/md0 --raid-devices=4 | #mdadm --grow /dev/md0 --raid-devices=4 | ||
| + | < | ||
| md0 : active raid1 sdb1[4] sda1[0] sdd1[2] sdc1[1] | md0 : active raid1 sdb1[4] sda1[0] sdd1[2] sdc1[1] | ||
| 9767424 blocks [4/3] [UUU_] | 9767424 blocks [4/3] [UUU_] | ||
| Line 394: | Line 399: | ||
| [> | [> | ||
| + | </ | ||
| Para que coja todo el tamaño del disco: \\ | Para que coja todo el tamaño del disco: \\ | ||
| #mdadm --grow /dev/md1 --size=max | #mdadm --grow /dev/md1 --size=max | ||
| Line 399: | Line 405: | ||
| Todavía no ha cogido el filesystem todo el tamaño: | Todavía no ha cogido el filesystem todo el tamaño: | ||
| #pvdisplay | #pvdisplay | ||
| + | < | ||
| --- Physical volume --- | --- Physical volume --- | ||
| PV Name               / | PV Name               / | ||
| Line 409: | Line 416: | ||
| Allocated PE 233699 | Allocated PE 233699 | ||
| PV UUID | PV UUID | ||
| + | </ | ||
| Le decimos que lo coja todo:\\ | Le decimos que lo coja todo:\\ | ||
| # pvresize /dev/md1 | # pvresize /dev/md1 | ||
| Line 416: | Line 423: | ||
| servidor:~# pvdisplay\\ | servidor:~# pvdisplay\\ | ||
| + | < | ||
| --- Physical volume --- | --- Physical volume --- | ||
| PV Name               / | PV Name               / | ||
| Line 426: | Line 434: | ||
| Allocated PE 233699 | Allocated PE 233699 | ||
| PV UUID | PV UUID | ||
| + | </ | ||
| Primero hacemos un test: | Primero hacemos un test: | ||
| #lvresize -v -d -t  -L +457G / | #lvresize -v -d -t  -L +457G / | ||
| Nos la jugamos:\\ | Nos la jugamos:\\ | ||
| - | #lvresize -v -d -L +457G / | + |  | 
| + | |||
| + | < | ||
| Found volume group " | Found volume group " | ||
| Loading servidor-servidor_home table | Loading servidor-servidor_home table | ||
| Line 438: | Line 448: | ||
| Resuming servidor-servidor_home (253:3) | Resuming servidor-servidor_home (253:3) | ||
| Logical volume servidor_home successfully resized | Logical volume servidor_home successfully resized | ||
| + | </ | ||
| Una vez añadido incrementamos el tamaño online. Necesitamos el paquete ext2resize: | Una vez añadido incrementamos el tamaño online. Necesitamos el paquete ext2resize: | ||
| Line 678: | Line 688: | ||
| 3. Apagar el servidor. Ya se puede colocar el disco en cualquier posicion que arrancara | 3. Apagar el servidor. Ya se puede colocar el disco en cualquier posicion que arrancara | ||
| + | |||
| + | |||
| + | ====== Recuperar RAID ====== | ||
| + | # mdadm --detail --scan | ||
| + | |||
| + | ARRAY /dev/md/0 metadata=1.2 name=proxmox01: | ||
| + | ARRAY /dev/md/2 metadata=1.2 name=proxmox01: | ||
| + | ARRAY /dev/md/1 metadata=1.2 name=proxmox01: | ||
informatica/linux/raid.1429166019.txt.gz · Last modified:  by javi
                
                