OVH Community, your new community space.

Sostituzione Hard Disk e problema dopo riscostruzione RAID1 Software


AlexTheMaster
27.06.2013, 23.57
nessuno sa darmi qualche consiglio??

AlexTheMaster
21.06.2013, 10.27
scusate ho trovato questa scritta nelle info di mdadm

A common error when creating RAID devices is that the dmraid-driver has taken control of all the devices that are to be used in the new RAID device. Error-messages like this will occur:

mdadm: Cannot open /dev/sdb1: Device or resource busy

Typically, the solution to this problem involves adding the "nodmraid" kernel parameter to the boot loader config. Another way this error can present itself is if the device mapper has its way with the drives. Issue 'dmsetup table' see if the drive in question is listed. 'dmsetup remove ' will remove the drive from device mapper and the "Device or resource busy" error will go away as well.
da quello che mi pare di capire è il mio problema.. dovrei lanciare da ssh il comando

Codice:
dmsetup remove md1
non vorrei fare qualche danno...

AlexTheMaster
20.06.2013, 08.53
Grazie mac ho fatto come mi hai detto e sto procedendo. Adesso però non mi aggiunge il disco alla pila raid..

Codice:
alexthemaster@:~$ sudo -s
[sudo] password for alexthemaster:
sh-4.2# sfdisk -d /dev/sda | sfdisk --force /dev/sdb
Checking that no-one is using this disk right now ...
OK

Disk /dev/sdb: 91201 cylinders, 255 heads, 63 sectors/track

sfdisk: ERROR: sector 0 does not have an MSDOS signature
 /dev/sdb: unrecognised partition table type
Old situation:
No partitions found
New situation:
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
/dev/sdb1   *      4096  20975616   20971521  fd  Linux RAID autodetect
/dev/sdb2      20975617 1464092672 1443117056  fd  Linux RAID autodetect
/dev/sdb3     1464092673 1465144064    1051392  82  Linux swap / Solaris
/dev/sdb4             0         -          0   0  Empty
Warning: partition 1 does not end at a cylinder boundary
Successfully wrote the new partition table

Re-reading the partition table ...

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
sh-4.2# exit
exit
alexthemaster@:~$ fdisk -l
alexthemaster@:~$ sudo fdisk -l

Disk /dev/sda: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00044521

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1306    10485760+  fd  Linux RAID autodetect
/dev/sda2            1306       91136   721558528   fd  Linux RAID autodetect
/dev/sda3           91136       91201      525696   82  Linux swap / Solaris

Disk /dev/sdb: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1        1306    10485760+  fd  Linux RAID autodetect
/dev/sdb2            1306       91136   721558528   fd  Linux RAID autodetect
/dev/sdb3           91136       91201      525696   82  Linux swap / Solaris

Disk /dev/md2: 738.9 GB, 738875867136 bytes
2 heads, 4 sectors/track, 180389616 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

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

Disk /dev/md1: 10.7 GB, 10737352704 bytes
2 heads, 4 sectors/track, 2621424 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/md1 doesn't contain a valid partition table
alexthemaster@:~$ mdadm --misc --help
Usage: mdadm misc_option  devices...

This usage is for performing some task on one or more devices, which
may be arrays or components, depending on the task.
The --misc option is not needed (though it is allowed) and is assumed
if the first argument in a misc option.

Options that are valid with the miscellaneous mode are:
  --query       -Q   : Display general information about how a
                       device relates to the md driver
  --detail      -D   : Display details of an array
  --detail-platform  : Display hardware/firmware details
  --examine     -E   : Examine superblock on an array component
  --examine-bitmap -X: Display contents of a bitmap file
  --zero-superblock  : erase the MD superblock from a device.
  --run         -R   : start a partially built array
  --stop        -S   : deactivate array, releasing all resources
  --readonly    -o   : mark array as readonly
  --readwrite   -w   : mark array as readwrite
  --test        -t   : exit status 0 if ok, 1 if degrade, 2 if dead, 4 if missing
  --wait        -W   : wait for resync/rebuild/recovery to finish
alexthemaster@ns37697:~$ mdadm --misc --detail /dev/md1
mdadm: must be super-user to perform this action
alexthemaster@ns37697:~$ sudo mdadm --misc --detail /dev/md1
/dev/md1:
        Version : 0.90
  Creation Time : Mon Nov 21 01:03:21 2011
     Raid Level : raid1
     Array Size : 10485696 (10.00 GiB 10.74 GB)
  Used Dev Size : 10485696 (10.00 GiB 10.74 GB)
   Raid Devices : 2
  Total Devices : 1
Preferred Minor : 1
    Persistence : Superblock is persistent

    Update Time : Thu Jun 20 09:42:47 2013
          State : clean, degraded
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0

           UUID : 2d262613:49d99f7c:a4d2adc2:26fd5302
         Events : 0.4401475

    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync   /dev/sda1
       1       0        0        1      removed
alexthemaster@:~$ sudo mdadm /dev/md1 --manage --add /dev/sdb1
mdadm: Cannot open /dev/sdb1: Device or resource busy
alexthemaster@:~$ sudo mdadm /dev/md1 --manage --add /dev/sdb1
mdadm: Cannot open /dev/sdb1: Device or resource busy
alexthemaster@:~$ sudo -s
sh-4.2# mdadm /dev/md1 --manage --add /dev/sdb1
mdadm: Cannot open /dev/sdb1: Device or resource busy
poi ho visto che nella guida la riga che da me è State : clean, degraded nel manuale è State : active, degraded..

grazie mille per l'aiuto

mac
19.06.2013, 11.16
No, non hai perso pezzi, è normale quello che ottieni perché non hai i permessi sufficienti per eseguire parte di quel comando.
Codice:
sudo sfdisk -d /dev/sda | sfdisk --force /dev/sdb
per semplificare al massimo, quel "sudo" va bene per il primo comando, ma non per il secondo (dopo la pipe |)
Come risolvere? Direi così
Codice:
$ sudo -s
# sfdisk -d /dev/sda | sfdisk --force /dev/sdb
# exit
$
Ma ovviamente ci sono altre soluzioni.

ciao

AlexTheMaster
19.06.2013, 09.04
Scusate se mi aggancio qui ma io ho un problema nella parte della guida..

Codice:
alexthemaster@:~$ sudo fdisk -l

Disk /dev/sda: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00044521

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1306    10485760+  fd  Linux RAID autodetect
/dev/sda2            1306       91136   721558528   fd  Linux RAID autodetect
/dev/sda3           91136       91201      525696   82  Linux swap / Solaris

Disk /dev/sdb: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

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

Disk /dev/md2: 738.9 GB, 738875867136 bytes
2 heads, 4 sectors/track, 180389616 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

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

Disk /dev/md1: 10.7 GB, 10737352704 bytes
2 heads, 4 sectors/track, 2621424 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/md1 doesn't contain a valid partition table
poi ho lanciato il comando

Codice:
alexthemaster@:~$ sudo sfdisk -d /dev/sda | sfdisk --force /dev/sdb
/dev/sdb: Permission denied

sfdisk: cannot open /dev/sdb read-write
mi sono scordato qualche pezzo??

grazie

Luposoft
25.01.2013, 14.49
Grazie per le risposte VELENO e MAC.

mac
24.01.2013, 17.51
Confermo. È normale che fdisk ti dia quel tipo di risultato.
Nessun problema.

ciao

veleno
24.01.2013, 09.31
Si succede anche a me su CentOS 5. Ma puoi creare le partizioni sui singoli dischi, marcarle come "Autorilevamento raid di Linux" e poi aggiungerle al RAID con mdadm.

Io uso questa procedura, sostituisce X con la lettera dell'unita:

1. copiare le partizioni dal vecchio disco (CON MOLTA ATTENZIONE!!!)
# controllare lo stato delle partizioni
fdisk -l
# copiare la tabella delle partizioni
sfdisk -d /dev/sdX | sfdisk --force /dev/sdX
# controllare che tutto sia a posto con fdisk
fdisk -l
# rimuovere tutti i residui di un eventuale RAID sul disco sostituito
mdadm --zero-superblock /dev/sdX1

# aggiungi le partizioni all'array
mdadm -a /dev/mdX /dev/sdX1

# quando la sincronizzazione è finita aggiungere grub al boot sector del nuovo disco
grub-install /dev/sdX

----
# in alternativa copiare l'intero disco funzionante sul nuovo con dd (ATTENZIONE A NON SBAGLIARE SORGENTE E DESTINAZIONE)
dd if=/dev/sdX of=/dev/sdXX bs=512k &

# per verificare che la procedura continui regolarmente
kill -SIGUSR1 PID

# Aggiunta delle partizioni create al RAID
mdadm /dev/md# -a /dev/sdX#

Spero ti sia di aiuto.

Saluti
Oto Tortorella
www.TeleType.it

Luposoft
24.01.2013, 07.50
Il supporto OVH mi ha risposto dicendo che il comando FDISK non può leggere le partizioni RAID SOFTWARE.
Quindi probabilmente avevo già prima questo errore ma non l'avevo notato.
Qualcuno di voi ha il raid software sul server è può darmi conferma dell'errore?

Luposoft
23.01.2013, 19.28
Salve,
sul server è stato sostituito un disco guasto ed ho provveduto alla ricreazione del RAID1 secondo quanto indicato sulla guida OVH.

http://guida.ovh.it/RaidSoft

Alla fine della procedura e dopo il reboot, eseguendo il comando fdisk -l ottengo degli errori (che evidenzio in rosso)
Cosa devo fare? Qualcuno può aiutarmi? Grazie.

# fdisk -l

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

Device Boot Start End Blocks Id System
/dev/sda1 * 1 2612 20971520+ fd Linux raid autodetect
/dev/sda2 2612 121536 955260928 fd Linux raid autodetect
/dev/sda3 121536 121601 525536 82 Linux swap / Solaris

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

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 2612 20971520+ fd Linux raid autodetect
/dev/sdb2 2612 121536 955260928 fd Linux raid autodetect
/dev/sdb3 121536 121601 525536 82 Linux swap / Solaris

Disk /dev/md2: 978.1 GB, 978187124736 bytes
2 heads, 4 sectors/track, 238815216 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

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

Disk /dev/md1: 21.4 GB, 21474770944 bytes
2 heads, 4 sectors/track, 5242864 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

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