View previous topic :: View next topic |
Author |
Message |
danielinux Apprentice
Joined: 10 Nov 2004 Posts: 202
|
Posted: Mon Feb 13, 2006 2:24 pm Post subject: [Risolto] RAID SATA + HD Esterno |
|
|
Ho un problema di questo tipo:
Ho un array in RAID1 perfettamente funzionante su 2 hd interni SATA (/dev/sda1 e /dev/sdb1)
Il problema sorge quando inserisco l'hd esterno ed il sistema assegna a questo device /dev/sda1,
prendendo il posto, di fatto , dell'hd che faceva raid con sdb1.
L'sda1 di prima ora è sdb1
L'sdb1 di prima ora è sdc1
Quindi con mdadm vedo solo (ovviamente) l'array con un solo hd funzionante x il raid.
Dovrei ogni volta cambiare i file mdadm.conf mettendo i nomi dei device corretti e riavviare, e ciò non è bello!
Il sistema dovrebbe funzionare con il raid con o senza cassettino!
Non può darmi ogni volta dei nomi diversi ai device!!
Come posso fare ad assegnare sempre lo stesso nome di device ad un hd? _________________ I've seen things you people wouldn't believe.
Attack ships on fire off the shoulder of Orion.
I watched C-beams glitter in the dark near the Tannhauser gate.
All those moments will be lost in time, like tears in rain.
Time to die.
Last edited by danielinux on Tue Feb 14, 2006 9:22 am; edited 2 times in total |
|
Back to top |
|
|
Ic3M4n Advocate
Joined: 02 Nov 2004 Posts: 3489 Location: Bergamo.
|
Posted: Mon Feb 13, 2006 2:42 pm Post subject: |
|
|
puoi impostare delle regole con udev.
se leggi la doc che ti viene installata con udev non dovresti avere problemi strani, a parte che non saprei come distinguere i due hd che teoricamente sono uguali, forse cambia il numero seriale se linux riesce a leggerlo.
un piccolo esempio della mia pendrive:
trovare i riferimenti alla pendrive-> Code: | udevinfo -a -p $(udevinfo -q path -n /dev/sdX) |
dell'output non posso prendere parti differenti, posso creare regole esclusivamente con quello che riguarda ogni singolo blocco.
esempio di mia regola:
Code: | SYSFS{manufacturer}=="ARCHOS" , SYSFS{product}=="ARCDISK USB2.0" , SYSFS{serial}=="DEF109D00903", NAME="ARCDisk" |
che crea il device /dev/ARCDisk per montare il filesystem
tu potresti farti un paio di regole che ti creano i device /dev/HDRAIDA e /dev/HDRAIDB ed utilizzare questi per configurare mdadm |
|
Back to top |
|
|
Ic3M4n Advocate
Joined: 02 Nov 2004 Posts: 3489 Location: Bergamo.
|
Posted: Mon Feb 13, 2006 2:43 pm Post subject: |
|
|
puoi impostare delle regole con udev.
se leggi la doc che ti viene installata con udev non dovresti avere problemi strani, a parte che non saprei come distinguere i due hd che teoricamente sono uguali, forse cambia il numero seriale se linux riesce a leggerlo.
un piccolo esempio della mia pendrive:
trovare i riferimenti alla pendrive-> Code: | udevinfo -a -p $(udevinfo -q path -n /dev/sdX) |
dell'output non posso prendere parti differenti, posso creare regole esclusivamente con quello che riguarda ogni singolo blocco.
esempio di mia regola:
Code: | SYSFS{manufacturer}=="ARCHOS" , SYSFS{product}=="ARCDISK USB2.0" , SYSFS{serial}=="DEF109D00903", NAME="ARCDisk" |
che crea il device /dev/ARCDisk per montare il filesystem
tu potresti farti un paio di regole che ti creano i device /dev/HDRAIDA e /dev/HDRAIDB ed utilizzare questi per configurare mdadm
[EDIT] mi scuso per il post doppio ma ho il modem che fa le bizze e si disconnette ogni 3x2, credevo non l'avesse inviato. |
|
Back to top |
|
|
danielinux Apprentice
Joined: 10 Nov 2004 Posts: 202
|
Posted: Mon Feb 13, 2006 2:55 pm Post subject: |
|
|
Se do un
Code: | udevinfo -q path -n /dev/sda |
non mi rstituisce nulla in output! _________________ I've seen things you people wouldn't believe.
Attack ships on fire off the shoulder of Orion.
I watched C-beams glitter in the dark near the Tannhauser gate.
All those moments will be lost in time, like tears in rain.
Time to die. |
|
Back to top |
|
|
Ic3M4n Advocate
Joined: 02 Nov 2004 Posts: 3489 Location: Bergamo.
|
Posted: Mon Feb 13, 2006 3:08 pm Post subject: |
|
|
ho provato a darlo sul mio hard disk e ricevo un'output. però è un normale pata, che comunque è in raid.
ho provato anche con la pendrive ed il comando funziona, non saprei cosa dirti.
ti restituisce tutto vuoto? a me esce una cosa del genere:
Code: | /block/fd0=/dev/floppy/0
/block/hda=/dev/hda
/block/hda/hda1=/dev/hda1
/block/hda/hda2=/dev/hda2
/block/hda/hda3=/dev/hda3
/block/hda/hda4=/dev/hda4
/block/hda/hda5=/dev/hda5
/block/hdb=/dev/hdb
/block/hdc=/dev/hdc
/block/hdc/hdc1=/dev/hdc1
/block/hdc/hdc2=/dev/hdc2
/block/hdc/hdc3=/dev/hdc3
/block/hdc/hdc4=/dev/hdc4
/block/hdc/hdc5=/dev/hdc5
/block/hdd=/dev/hdd
...
...
... | in ogni caso molto lunga. |
|
Back to top |
|
|
danielinux Apprentice
Joined: 10 Nov 2004 Posts: 202
|
Posted: Mon Feb 13, 2006 3:08 pm Post subject: |
|
|
Dando un
Code: | udevinfo -a -p /sys/block/sda |
Ho
Code: |
device '/sys/block/sda' has major:minor 8:0
looking at class device '/sys/block/sda':
SUBSYSTEM=="block"
SYSFS{dev}=="8:0"
SYSFS{range}=="16"
SYSFS{removable}=="0"
SYSFS{size}=="398297088"
SYSFS{stat}==" 419817 709137 144487258 2004695 7 0 56 0 2 1234357 2004697"
follow the "device"-link to the physical device:
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:01:05.0/host4/target4:0:0/4:0:0:0':
BUS=="scsi"
ID=="4:0:0:0"
DRIVER=="sd"
SYSFS{device_blocked}=="0"
SYSFS{iocounterbits}=="32"
SYSFS{iodone_cnt}=="0x667fd"
SYSFS{ioerr_cnt}=="0x0"
SYSFS{iorequest_cnt}=="0x667fe"
SYSFS{model}=="Maxtor 6B200M0 "
SYSFS{queue_depth}=="1"
SYSFS{queue_type}=="none"
SYSFS{rev}=="BANC"
SYSFS{scsi_level}=="6"
SYSFS{state}=="running"
SYSFS{timeout}=="30"
SYSFS{type}=="0"
SYSFS{vendor}=="ATA "
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:01:05.0/host4/target4:0:0':
BUS==""
ID=="target4:0:0"
DRIVER=="unknown"
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:01:05.0/host4':
BUS==""
ID=="host4"
DRIVER=="unknown"
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:01:05.0':
BUS=="pci"
ID=="0000:01:05.0"
DRIVER=="sata_sil"
SYSFS{class}=="0x010400"
SYSFS{device}=="0x3114"
SYSFS{irq}=="22"
SYSFS{local_cpus}=="00000003"
SYSFS{modalias}=="pci:v00001095d00003114sv00001043sd00008136bc01sc04i00"
SYSFS{subsystem_device}=="0x8136"
SYSFS{subsystem_vendor}=="0x1043"
SYSFS{vendor}=="0x1095"
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0':
BUS=="pci"
ID=="0000:00:1e.0"
DRIVER=="unknown"
SYSFS{class}=="0x060401"
SYSFS{device}=="0x244e"
SYSFS{irq}=="0"
SYSFS{local_cpus}=="00000003"
SYSFS{modalias}=="pci:v00008086d0000244Esv00000000sd00000000bc06sc04i01"
SYSFS{subsystem_device}=="0x0000"
SYSFS{subsystem_vendor}=="0x0000"
SYSFS{vendor}=="0x8086"
looking at the device chain at '/sys/devices/pci0000:00':
BUS==""
ID=="pci0000:00"
DRIVER=="unknown"
|
E con
Code: | udevinfo -a -p /sys/block/sdb |
Ho
Code: |
device '/sys/block/sdb' has major:minor 8:16
looking at class device '/sys/block/sdb':
SUBSYSTEM=="block"
SYSFS{dev}=="8:16"
SYSFS{range}=="16"
SYSFS{removable}=="0"
SYSFS{size}=="398297088"
SYSFS{stat}==" 5 21 96 27 141869 992635 145216776 5150672 3 1393805 5150756"
follow the "device"-link to the physical device:
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:01:05.0/host5/target5:0:0/5:0:0:0':
BUS=="scsi"
ID=="5:0:0:0"
DRIVER=="sd"
SYSFS{device_blocked}=="0"
SYSFS{iocounterbits}=="32"
SYSFS{iodone_cnt}=="0x22a3f"
SYSFS{ioerr_cnt}=="0x0"
SYSFS{iorequest_cnt}=="0x22a40"
SYSFS{model}=="Maxtor 6B200M0 "
SYSFS{queue_depth}=="1"
SYSFS{queue_type}=="none"
SYSFS{rev}=="BANC"
SYSFS{scsi_level}=="6"
SYSFS{state}=="running"
SYSFS{timeout}=="30"
SYSFS{type}=="0"
SYSFS{vendor}=="ATA "
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:01:05.0/host5/target5:0:0':
BUS==""
ID=="target5:0:0"
DRIVER=="unknown"
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:01:05.0/host5':
BUS==""
ID=="host5"
DRIVER=="unknown"
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:01:05.0':
BUS=="pci"
ID=="0000:01:05.0"
DRIVER=="sata_sil"
SYSFS{class}=="0x010400"
SYSFS{device}=="0x3114"
SYSFS{irq}=="22"
SYSFS{local_cpus}=="00000003"
SYSFS{modalias}=="pci:v00001095d00003114sv00001043sd00008136bc01sc04i00"
SYSFS{subsystem_device}=="0x8136"
SYSFS{subsystem_vendor}=="0x1043"
SYSFS{vendor}=="0x1095"
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0':
BUS=="pci"
ID=="0000:00:1e.0"
DRIVER=="unknown"
SYSFS{class}=="0x060401"
SYSFS{device}=="0x244e"
SYSFS{irq}=="0"
SYSFS{local_cpus}=="00000003"
SYSFS{modalias}=="pci:v00008086d0000244Esv00000000sd00000000bc06sc04i01"
SYSFS{subsystem_device}=="0x0000"
SYSFS{subsystem_vendor}=="0x0000"
SYSFS{vendor}=="0x8086"
looking at the device chain at '/sys/devices/pci0000:00':
BUS==""
ID=="pci0000:00"
DRIVER=="unknown"
|
_________________ I've seen things you people wouldn't believe.
Attack ships on fire off the shoulder of Orion.
I watched C-beams glitter in the dark near the Tannhauser gate.
All those moments will be lost in time, like tears in rain.
Time to die. |
|
Back to top |
|
|
Ic3M4n Advocate
Joined: 02 Nov 2004 Posts: 3489 Location: Bergamo.
|
Posted: Mon Feb 13, 2006 3:09 pm Post subject: |
|
|
beh... adesso puoi vedere di creare dei device differenti con quello che ti vedi li. |
|
Back to top |
|
|
danielinux Apprentice
Joined: 10 Nov 2004 Posts: 202
|
Posted: Mon Feb 13, 2006 3:16 pm Post subject: |
|
|
SDA Ha:
Mentre SDB:
E' sufficiente? _________________ I've seen things you people wouldn't believe.
Attack ships on fire off the shoulder of Orion.
I watched C-beams glitter in the dark near the Tannhauser gate.
All those moments will be lost in time, like tears in rain.
Time to die. |
|
Back to top |
|
|
Ic3M4n Advocate
Joined: 02 Nov 2004 Posts: 3489 Location: Bergamo.
|
Posted: Mon Feb 13, 2006 3:21 pm Post subject: |
|
|
non saprei, non l'ho mai fatto con dei device così simili, a me era uscita una cosa tipo questa con i tuoi dati:
ID=="4:0:0:0" , SYSFS{model}=="Maxtor 6B200M0 " , NAME="HDRAIDB
ID=="5:0:0:0" , SYSFS{model}=="Maxtor 6B200M0 " , NAME="HDRAIDA
la differenza sta nell'ID, inoltre con model dai delle garanzie sul fatto che l'hd debba essere un maxtor 6B200M0. però ti ripeto, sarebbe da provare a fare un tentativo. non sono sicurissimo che possa funzionare. |
|
Back to top |
|
|
danielinux Apprentice
Joined: 10 Nov 2004 Posts: 202
|
Posted: Mon Feb 13, 2006 3:29 pm Post subject: |
|
|
Bisogna vedere se l'id è statico o dinamico, altrimenti, dato che l'hd nel cassettino è un hd identico agli altri due..sono punto a capo.
Adesso inserisco la regola..
Va bene inserire la regola nel file ? _________________ I've seen things you people wouldn't believe.
Attack ships on fire off the shoulder of Orion.
I watched C-beams glitter in the dark near the Tannhauser gate.
All those moments will be lost in time, like tears in rain.
Time to die. |
|
Back to top |
|
|
Ic3M4n Advocate
Joined: 02 Nov 2004 Posts: 3489 Location: Bergamo.
|
Posted: Mon Feb 13, 2006 3:55 pm Post subject: |
|
|
di solito si utilizza un numero inferiore al 50 o cmq un nome differente, in modo che successivi aggiornamenti non sovrascrivano le tue rules.
domanda: ma sei su mandriva linux? |
|
Back to top |
|
|
danielinux Apprentice
Joined: 10 Nov 2004 Posts: 202
|
Posted: Mon Feb 13, 2006 3:55 pm Post subject: |
|
|
ho creato la regola nel file ma sembra non funzionare..
Non c'è nessun device in /dev che si chiami HDRAIDA.
Altri suggerimenti? _________________ I've seen things you people wouldn't believe.
Attack ships on fire off the shoulder of Orion.
I watched C-beams glitter in the dark near the Tannhauser gate.
All those moments will be lost in time, like tears in rain.
Time to die. |
|
Back to top |
|
|
Ic3M4n Advocate
Joined: 02 Nov 2004 Posts: 3489 Location: Bergamo.
|
Posted: Mon Feb 13, 2006 3:59 pm Post subject: |
|
|
hai dato udevstart dopo? |
|
Back to top |
|
|
danielinux Apprentice
Joined: 10 Nov 2004 Posts: 202
|
Posted: Mon Feb 13, 2006 4:04 pm Post subject: |
|
|
bhe.. ho riavviato la macchina. _________________ I've seen things you people wouldn't believe.
Attack ships on fire off the shoulder of Orion.
I watched C-beams glitter in the dark near the Tannhauser gate.
All those moments will be lost in time, like tears in rain.
Time to die. |
|
Back to top |
|
|
danielinux Apprentice
Joined: 10 Nov 2004 Posts: 202
|
Posted: Mon Feb 13, 2006 4:12 pm Post subject: |
|
|
Se non ha funzionato, da qualche parte deve esserci almeno la segnalazione di errore se la regola è errata ,no? _________________ I've seen things you people wouldn't believe.
Attack ships on fire off the shoulder of Orion.
I watched C-beams glitter in the dark near the Tannhauser gate.
All those moments will be lost in time, like tears in rain.
Time to die. |
|
Back to top |
|
|
Ic3M4n Advocate
Joined: 02 Nov 2004 Posts: 3489 Location: Bergamo.
|
Posted: Mon Feb 13, 2006 4:16 pm Post subject: |
|
|
non saprei, non ne ho mai create molte di regole, in ogni caso potrebbe essere che non accetta come regola l'ID |
|
Back to top |
|
|
danielinux Apprentice
Joined: 10 Nov 2004 Posts: 202
|
Posted: Mon Feb 13, 2006 4:47 pm Post subject: |
|
|
Ok,Sono riuscito a creare la regola:
Code: | BUS="scsi" ID=="4:0:0:0" , SYSFS{model}== "Maxtor 6B200M0 " , SYMLINK="HDRAIDA"
BUS="scsi" ID=="5:0:0:0" , SYSFS{model}== "Maxtor 6B200M0 " , SYMLINK="HDRAIDB" |
Era a quanto pare necessario la voce BUS, poi invece di NAME ho messo un link simbolico x vedere a quale device assegna
la regola.
Ma ora , quando inserisco il cassettino, non viene visto dal sys!!! _________________ I've seen things you people wouldn't believe.
Attack ships on fire off the shoulder of Orion.
I watched C-beams glitter in the dark near the Tannhauser gate.
All those moments will be lost in time, like tears in rain.
Time to die. |
|
Back to top |
|
|
danielinux Apprentice
Joined: 10 Nov 2004 Posts: 202
|
Posted: Tue Feb 14, 2006 7:58 am Post subject: |
|
|
Ora il cassettino viene visto, ho fermato l'attuale array e l'ho ricreato dando un
Code: | mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/HDRAIDA /dev/HDRAIDB | Questi 2 dischi però erano già in raid1, quindi la domanda è :
Una volta che finisce di creare l'array, devo formattare il device md0 per forza o posso fare a meno ?
PS: Ora stà ricreando l'array e se do un
Il risultato è
Code: |
Personalities : [raid1]
md0 : active raid1 sdc1[1] sdb1[0]
199141632 blocks [2/2] [UU]
[===>.................] resync = 15.9% (31700736/199141632) finish=53.0min speed=52570K/sec
unused devices: <none>
|
Dove c'è sdc1 non dovrebbe esserci HDRAIDB?, oppure, dato che è un link simbolico,anche se HDRAIDA cambia. il raid rimarrà configurato su hdc1? _________________ I've seen things you people wouldn't believe.
Attack ships on fire off the shoulder of Orion.
I watched C-beams glitter in the dark near the Tannhauser gate.
All those moments will be lost in time, like tears in rain.
Time to die. |
|
Back to top |
|
|
danielinux Apprentice
Joined: 10 Nov 2004 Posts: 202
|
Posted: Tue Feb 14, 2006 9:22 am Post subject: |
|
|
Ho formattato l'unità md0.
Ok, il metodo funziona, la regola funge a meraviglia e le unità coinvolte nel raid
vengono settate automaticamente nel modo corretto sia con che senza cassettino.
HDRAIDA è hda1 quando non c'è il cassetto
HDRAIDA è hdb1 quando c'è il cassetto.
e il raid funge. _________________ I've seen things you people wouldn't believe.
Attack ships on fire off the shoulder of Orion.
I watched C-beams glitter in the dark near the Tannhauser gate.
All those moments will be lost in time, like tears in rain.
Time to die. |
|
Back to top |
|
|
|