User Tools

Site Tools


informatica:linux:raid

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
informatica:linux:raid [2015/01/11 10:06] – [Cambiar un disco] javiinformatica:linux:raid [2015/01/11 12:00] javi
Line 444: Line 444:
  
 http://scotgate.org/?p=107 http://scotgate.org/?p=107
 +
 +===== Cambiar disco en frio (apagando server) =====
 +
 +1. Apagar servidor
 +
 +2. Desconectar disco que creemos que falla
 +
 +3. Arrancar servidor
 +
 +4. Entrar en la BIOS
 +
 +  supr
 +
 +5. Comprobar que el unico disco conectado es master. En mi caso en la BIOS Asus:
 +
 +  SATA6G_1
 +
 +6. (Opcional) si el disco no estaba como master apagar servidor y conectar el disco como master cambiando cables y encender de nuevo
 +
 +7. Arrancar servidor
 +
 +8. Tocar flecha arriba/abajo para que muestre opciones de grub
 +
 +9. Arrancar en modo recovery
 +
 +10. Decir que se quiere arrancar el RAID degradado
 +
 +  y
 +  Enter
 +
 +11. Arrancar normal
 +
 +  TODO: provide menu label
 +  Enter
 +
 +12. Ver las pariciones del disco bueno, en mi caso /dev/sda
 +
 +  sudo fdisk /dev/sda
 +<code>
 +The device presents a logical sector size that is smaller than
 +the physical sector size. Aligning to a physical sector (or optimal
 +I/O) size boundary is recommended, or performance may be impacted.
 +
 +Command (m for help): 
 +</code>
 +
 +  p
 +<code>
 +Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
 +255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
 +Units = sectors of 1 * 512 = 512 bytes
 +Sector size (logical/physical): 512 bytes / 4096 bytes
 +I/O size (minimum/optimal): 4096 bytes / 4096 bytes
 +Disk identifier: 0x000ab48f
 +
 +   Device Boot      Start         End      Blocks   Id  System
 +/dev/sda1          2048  1953523711   976760832   fd  Linux RAID autodetect
 +
 +Command (m for help): 
 +</code>
 +
 +  q
 +
 +13. Copiar el mismo particionado:
 +
 +13.1. Crear particion
 +
 +  sudo fdisk /dev/sdb
 +<code>
 +The device presents a logical sector size that is smaller than
 +the physical sector size. Aligning to a physical sector (or optimal
 +I/O) size boundary is recommended, or performance may be impacted.
 +
 +Command (m for help):
 +</code>
 +
 +  p
 +<code>
 +Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
 +255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
 +Units = sectors of 1 * 512 = 512 bytes
 +Sector size (logical/physical): 512 bytes / 4096 bytes
 +I/O size (minimum/optimal): 4096 bytes / 4096 bytes
 +Disk identifier: 0x4d1b267d
 +
 +   Device Boot      Start         End      Blocks   Id  System
 +
 +Command (m for help):
 +</code>
 +
 +  n
 +<code>
 +Partition type:
 +     primary (0 primary, 0 extended, 4 free)
 +     extended
 +Select (default p): 
 +</code>
 +
 +  Enter
 +<code>
 +Using default response p
 +Partition number (1-4, default 1): 
 +</code>
 +
 +  Enter
 +<code>
 +Using default value 1
 +First sector (2048-1953525167, default 2048): 
 +</code>
 +
 +  Enter
 +<code>
 +Using default value 2048
 +Last sector, +sectors or +size{K,M,G} (2048-1953525167, default 1953525167): 
 +</code>
 +
 +  Enter
 +<code>
 +Using default value 1953525167
 +
 +Command (m for help):
 +</code>
 +
 +  w
 +<code>
 +The partition table has been altered!
 +
 +Calling ioctl() to re-read partition table.
 +Syncing disks.
 +</code>
 +
 +13.2. Cambiar label
 +
 +  sudo fdisk /dev/sdb
 +<code>
 +The device presents a logical sector size that is smaller than
 +the physical sector size. Aligning to a physical sector (or optimal
 +I/O) size boundary is recommended, or performance may be impacted.
 +
 +Command (m for help):
 +</code>
 +
 +  t
 +<code>
 +Selected partition 1
 +Hex code (type L to list codes):
 +</code>
 +
 +  fd
 +<code>
 +Changed system type of partition 1 to fd (Linux RAID autodetect)
 +
 +Command (m for help):
 +</code>
 +
 +  w
 +<code>
 +The partition table has been altered!
 +
 +Calling ioctl() to re-read partition table.
 +Syncing disks.
 +</code>
 +
 +14. Ver estado del raid:
 +
 +  cat /proc/mdstat
 +<code>
 +Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
 +md0 : active raid1 sda1[1]
 +      976629568 blocks super 1.2 [2/1] [_U]
 +      
 +unused devices: <none>
 +</code>
 +
 +15. Anyadir particion (en mi caso /dev/sdb1) al RAID (en mi caso md0)
 +
 +  sudo mdadm -a /dev/md0 /dev/sdb1
 +<code>
 +mdadm: added /dev/sdb1
 +</code>
 +
 +16. Ver progreso
 +
 +  cat /proc/mdstat
 +<code>
 +Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
 +md0 : active raid1 sdb1[2] sda1[1]
 +      976629568 blocks super 1.2 [2/1] [_U]
 +      [>....................]  recovery =  0.0% (19072/976629568) finish=15349.0min speed=1059K/sec
 +      
 +unused devices: <none>
 +</code>
 +
 +17. Install grub on the MBR of new hard disk
 +
 +  sudo grub-install /dev/sdb
 +<code>
 +/usr/sbin/grub-probe: warning: Couldn't find physical volume `(null)'. Some modules may be missing from core image..
 +Installation finished. No error reported.
 +</code>
 +
 +**TODO**: quiza esperar a que termine el rebuild
  
  
informatica/linux/raid.txt · Last modified: 2020/11/15 13:11 by jose