Changes between Initial Version and Version 1 of DiscosRaid


Ignore:
Timestamp:
08/19/10 20:39:00 (14 years ago)
Author:
sebas@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DiscosRaid

    v1 v1  
     1== identificar bien los discos ==
     2
     3Usar el comando
     4{{{
     5# hdparm -I /dev/sdb | less
     6/dev/sdb:
     7ATA device, with non-removable media
     8        Model Number:       Hitachi HDS721010CLA332                 
     9        Serial Number:      JP2930HQ0WGG0H
     10        Firmware Revision:  JP4OA39C
     11        Transport:          Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5; Revision: ATA8-AST T13 Project D1697 Revision 0b
     12.....
     13}}}
     14
     15== Agregar Nuevo Disco ==
     16
     17 * Copiar tabla de particiones un disco al nuevo
     18{{{
     19# sfdisk -d /dev/sda | sfdisk --no-reread /dev/sdb --force
     20}}}
     21
     22
     23 * Agregar al raid1 el nuevo disco (sdb)
     24
     25{{{
     26# mdadm --add /dev/md0 /dev/sdb2
     27# mdadm --add /dev/md1 /dev/sdb5
     28# mdadm --add /dev/md2 /dev/sdb6
     29}}}
     30
     31
     32
     33 * Quitar particion al raid1
     34
     35{{{
     36# mdadm --fail /dev/md0 /dev/sdb2
     37# mdadm -r /dev/md0 /dev/sdb2
     38}}}
     39
     40 *  más info:
     41
     42http://www.ducea.com/2009/03/08/mdadm-cheat-sheet/
     43
     44http://svn.debian.org/wsvn/pkg-mdadm/mdadm/trunk/debian/README.recipes?op=file&rev=0&sc=0
     45
     46https://wiki.koumbit.net/RaidRecovery
     47
     48 * Si los discos se salen del array
     49
     50Puede ser que los cause el smartd con el kernel. http://kerneltrap.org/mailarchive/linux-scsi/2009/9/14/6409773
     51
     52 * Grub al disco (para que varios puedan bootear sin que se rompan)
     53{{{
     54# grub
     55Probing devices to guess BIOS drives. This may take a long time.
     56[...]
     57grub> device (hd0) /dev/sdb
     58device (hd0) /dev/sdb
     59grub> root (hd0,0)
     60root (hd0,0)
     61 Filesystem type is ext2fs, partition type 0xfd
     62grub> setup (hd0)
     63setup (hd0)
     64 Checking if "/boot/grub/stage1" exists... yes
     65 Checking if "/boot/grub/stage2" exists... yes
     66 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
     67 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  16 sectors are embedded.
     68succeeded
     69 Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,1)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded
     70Done.
     71}}}
     72
     73 * Cambiar de posición el disco ( slot number )
     74{{{
     75mdadm --detail /dev/md1
     76Number Major Minor RaidDevice State
     770 0 0 0 removed
     781 8 17 1 active sync /dev/sdb1
     79What I wanted to do is to move the device /dev/sdb1 to slot 0 from slot 1. And I found I could do that by running mdadm in grow mode with the degraded Raid 1 array:
     80mdadm --grow --force -n 1 /dev/md1
     81mdadm --detail /dev/md1
     82Number Major Minor RaidDevice State
     830 8 22 0 active sync /dev/sdb1
     84mdadm --grow -n 2 /dev/md1
     85mdadm --detail /dev/md1
     86Number Major Minor RaidDevice State
     870 8 17 0 active sync /dev/sdb1
     881 0 0 1 removed
     89
     90Then add a new device into md1
     91mdadm /dev/md1 -a /dev/sda1
     92mdadm: hot added /dev/sda1
     93}}}
     94
     95http://piiis.blogspot.com/2009/03/change-slot-number-of-raid-1-device-by.html