Pagina 1 di 1

Problemi ad aggiungere dischi ad un RAID software mirror

Inviato: sabato 5 febbraio 2011, 18:32
da pak
Ciao a tutti

ho un problema con la gestione di un mirror software


Scenario che ho trovato configurato e dal quale sono partito:

2 dischi da un TB

/dev/sda1 -> boot
/dev/sda2 -> swap
/dev/sda3 -> root

/dev/sdb3 -> backup
(le altre partizioni non esistevano...)


gli step che ho seguito sono questi:
- cambio del tipo di filesystem delle partizioni sda in FD (raid software)
- copia tabella delle partizioni su sdb
- creazione device /dev/md0 e /dev/md1 su /dev/sdb1 e /dev/sdb3
- formattazione degli md
- copia di tutti i dati da sda a md
- modifica di fstab per fare il boot da md1
- installazione grub su entrambi gli hd
- reboot del server su md

ora sembra tutto funzionante su md1 (anche se ancora presente /dev/sda1 ho eliminato la partizione di boot md0 che mi creava problemi e ho integrato tutto in md1)

Codice: Seleziona tutto

root@server:~# fdisk  -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0007ac71

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          12       96358+  fd  Linux raid autodetect
/dev/sda2              13         134      979965   82  Linux swap / Solaris
/dev/sda3             135      121601   975683677+  fd  Linux raid autodetect

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          12       96358+  fd  Linux raid autodetect
/dev/sdb2              13         134      979965   82  Linux swap / Solaris
/dev/sdb3             135      121601   975683677+  fd  Linux raid autodetect

Disk /dev/md1: 999.0 GB, 999099990016 bytes
2 heads, 4 sectors/track, 243920896 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0x00000000

Disk /dev/md1 doesn't contain a valid partition table

Codice: Seleziona tutto

root@server:~# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md1 : active raid1 sdb3[1]
      975683584 blocks [2/1] [_U]

unused devices: <none>

Codice: Seleziona tutto

root@server:~# mdadm --detail /dev/md1
/dev/md1:
        Version : 00.90.03
  Creation Time : Sat Feb  5 11:53:07 2011
     Raid Level : raid1
     Array Size : 975683584 (930.48 GiB 999.10 GB)
  Used Dev Size : 975683584 (930.48 GiB 999.10 GB)
   Raid Devices : 2
  Total Devices : 1
Preferred Minor : 1
    Persistence : Superblock is persistent

    Update Time : Sat Feb  5 16:57:35 2011
          State : clean, degraded
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0

           UUID : 92c15c42:11eca75c:eeaa09ac:40010efe
         Events : 0.16

    Number   Major   Minor   RaidDevice State
       0       0        0        0      removed
       1       8       19        1      active sync   /dev/sdb3

ma se provo ad aggiungere il disco sda3 mi da errore

Codice: Seleziona tutto

root@server:~# mdadm /dev/md1 --add /dev/sda3
mdadm: Cannot open /dev/sda3: Device or resource busy
ho provato a resettare i superblock senza successo

Codice: Seleziona tutto

root@server:~#  mdadm --zero-superblock /dev/sda3
mdadm: Couldn't open /dev/sda3 for write - not zeroing
perche' non riesco ad aggiungere il disco originale? cosa mi sfugge?
a disposizione per chiarimenti (io non so piu' dove sbattere la testa)

ciao
Paolo

Re: Problemi ad aggiungere dischi ad un RAID software mirror

Inviato: sabato 5 febbraio 2011, 18:42
da pak
forse ho trovato cosa blocca sda3

Codice: Seleziona tutto

root@server:~# fuser -vm /dev/sda3
                     USER        PID ACCESS COMMAND
/dev/sda3:           root          1 .rce. init
                     root          2 .rc.. kthreadd
                     root          3 .rc.. migration/0
                     root          4 .rc.. ksoftirqd/0
                     root          5 .rc.. watchdog/0
                     root          6 .rc.. migration/1
                     root          7 .rc.. ksoftirqd/1
...
                     postfix   12411 Frce. smtpd
                     root      12441 Frce. sshd
                     root      12444 .rce. bash
ma come sistemare?...

Re: Problemi ad aggiungere dischi ad un RAID software mirror

Inviato: domenica 6 febbraio 2011, 12:58
da pak
Ulteriore complicazione: è possibile che sda e sdb si siano invertiti in qualche modo?

da qui

Codice: Seleziona tutto

root@server:~# mdadm --detail /dev/md1
/dev/md1:
        Version : 00.90.03
[...omissis...]
    Number   Major   Minor   RaidDevice State
       0       0        0        0      removed
       1       8       19        1      active sync   /dev/sdb3
si vede chiaramente che in md1 c'e' sdb3

La logica suggerisce che sda3 deve essere rimasto fermo a ieri, invece se lo monto e controllo /var/log mi fa vedere log aggiornati.

Re: Problemi ad aggiungere dischi ad un RAID software mirror

Inviato: domenica 6 febbraio 2011, 13:06
da pak
...e poi...
come è possibile che md1 e sdb3 abbiano lo stesso UUID?

root@server:~# mdadm --examine /dev/sdb3
/dev/sdb3:
          Magic : a92b4efc
        Version : 00.90.00
          UUID : 92c15c42:11eca75c:eeaa09ac:40010efe
  Creation Time : Sat Feb  5 11:53:07 2011
    Raid Level : raid1
[...omissis...]
  0    0      0        0        0      removed
  1    1      8      19        1      active sync  /dev/sdb3

root@server:~# mdadm --detail /dev/md1
/dev/md1:
        Version : 00.90.03
  Creation Time : Sat Feb  5 11:53:07 2011
    Raid Level : raid1
    Array Size : 975683584 (930.48 GiB 999.10 GB)
[...omissis...]

          UUID : 92c15c42:11eca75c:eeaa09ac:40010efe
        Events : 0.16

    Number  Major  Minor  RaidDevice State
      0      0        0        0      removed
      1      8      19        1      active sync  /dev/sdb3

Re: Problemi ad aggiungere dischi ad un RAID software mirror

Inviato: lunedì 7 febbraio 2011, 10:21
da pak
qualche idea?