[LugBS] RAID1: c'è (almeno) una cosa che non capisco
Claudio Moretti
flyingstar16 a gmail.com
Dom 17 Apr 2016 16:33:26 UTC
Ciao Luca,
prova cat /proc/mdstat, che ti da altri dettagli sullo stato del RAID :)
Il mio, ad esempio:
claudio a box:~$ cat /proc/mdstat
Personalities : [raid1]
md2 : active raid1 sda3[0] sdb3[1]
385989504 blocks [2/2] [UU]
md1 : active raid1 sda2[0] sdb2[1]
524224 blocks [2/2] [UU]
md0 : active raid1 sda1[0] sdb1[1]
4194240 blocks [2/2] [UU]
unused devices: <none>
Ciao,
Claudio
2016-04-16 14:50 GMT+01:00 Luca Coianiz <luca a coianiz.it>:
> Allora... ho ricostruito il povero pinguino, acciaccato da una caduta di
> tensione mentre non avevo l'UPS.
> Siccome uso sempre RAID1, almeno uno dei due HD conteneva i dati che mi
> interessava ripristinare... e siccome il box che sto usando in questo
> momento ha
> due soli canali SATA, ho dovuto iniziare con un HD ed il CD-ROM da cui
> stavo
> facendo la netinstall, aggiungendo il secondo HD al RAID1 in seguito, dopo
> aver
> staccato il CD-ROM.
>
> Ora, stiamo parlando di un sistema "legacy" con due dischi da 1 TB Hitachi
> identici, per cui MBR e niente "scherzi da EFI".
> L'installazione sul singolo HD, visto come RAID1 degraded, ha funzionato
> perfettamente.
> Al che ho "aggiunto" l'altro:
> 1) MBR: sda -> file -> sdb via dd
> 2) mdadm: add di sdb all'md0,
> che ha fatto il suo sync ed ora la situazione è la seguente:
>
> root a home:/usr/local/sbin# mdadm --detail /dev/md0
> /dev/md0:
> Version : 1.2
> Creation Time : Thu Apr 7 19:00:19 2016
> Raid Level : raid1
> Array Size : 974555136 (929.41 GiB 997.94 GB)
> Used Dev Size : 974555136 (929.41 GiB 997.94 GB)
> Raid Devices : 2
> Total Devices : 2
> Persistence : Superblock is persistent
>
> Intent Bitmap : Internal
>
> Update Time : Sat Apr 16 14:52:59 2016
> State : clean
> Active Devices : 2
> Working Devices : 2
> Failed Devices : 0
> Spare Devices : 0
>
> Name : home:0 (local to host home)
> UUID : 7f4567ba:f11083ad:f56eb5aa:f8d20bd8
> Events : 54216
>
> Number Major Minor RaidDevice State
> 0 8 1 0 active sync /dev/sda1
> 2 8 16 1 active sync /dev/sdb
>
> Dovrei esser felice, in quanto il RAID sembra a posto... ma allora come
> mai i
> due device (identici e visti uguali da fdisk) compaiono in modo diverso?
> cioè,
> come mai ha incluso 8:1 sda1 ed 8:16 sdb invece che 8:17 sdb1? (v. sotto
> per
> /proc/partitions)
>
> Questo l'output di fdisk:
>
> root a home:~# fdisk -l
>
> Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disklabel type: dos
> Disk identifier: 0x000b4347
>
> Device Boot Start End Sectors Size Id Type
> /dev/sdb1 * 2048 1949374463 1949372416 929.5G fd Linux raid
> autodetect
> /dev/sdb2 1949376510 1953523711 4147202 2G 5 Extended
> /dev/sdb5 1949376512 1953523711 4147200 2G 82 Linux swap /
> Solaris
>
> Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disklabel type: dos
> Disk identifier: 0x11659914
>
> Device Boot Start End Sectors Size Id Type
> /dev/sda1 * 2048 1949374463 1949372416 929.5G fd Linux raid
> autodetect
> /dev/sda2 1949376510 1953523711 4147202 2G 5 Extended
> /dev/sda5 1949376512 1953523711 4147200 2G 82 Linux swap /
> Solaris
>
> Disk /dev/md0: 929.4 GiB, 997944459264 bytes, 1949110272 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disklabel type: dos
> Disk identifier: 0xadbe7f4b
>
> Device Boot Start End Sectors Size Id Type
> /dev/md0p1 2048 1944961023 1944958976 927.4G 83 Linux
> /dev/md0p2 1944963070 1949108223 4145154 2G 5 Extended
> /dev/md0p5 1944963072 1949108223 4145152 2G 82 Linux swap /
> Solaris
>
> E questo è proc/partitions:
>
> root a home:~# cat /proc/partitions
> major minor #blocks name
>
> 8 16 976762584 sdb
> 8 17 974686208 sdb1
> 8 18 1 sdb2
> 8 21 2073600 sdb5
> 8 0 976762584 sda
> 8 1 974686208 sda1
> 8 2 1 sda2
> 8 5 2073600 sda5
> 9 0 974555136 md0
> 259 0 972479488 md0p1
> 259 1 1 md0p2
> 259 2 2072576 md0p5
>
> Sono "ragionevolmente convinto" che il RAID, inteso come sda1+sdb1 stia
> funzionando normalmente, ho solo il dubbio che stia usando solo sda5 e non
> sdb5
> come swap.
> Purtroppo non ho idea di come chiedere ad mdadm (ammesso che lo possa
> chiedere
> a lui) di farmi vedere il (vero) dettaglio dei dischi *E* partizioni che
> sta
> usando, in un display tipo albero. Swapon riporta, ovviamente, che sta
> usando
> /dev/md0p5 come swap, ma md0p5 com'è costruito? sda5+sdb5 o solo il primo?
> Last but not least, come faccio a dirgli di prendersi sda1+sdb1 per la / e
> sda5+sdb5 per la swap? in mdadm.conf l'indicazione dei DEVICES è
> commentata,
> quindi mdadm s'è letto la /proc/partitions... s'è sbagliato
> nell'assemblare il
> RAID?
>
> LC
>
> --
> Info/Lamentele/Segnalazioni: andrea.gelmini a gmail.com
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://lugbs.linux.it/pipermail/lug/attachments/20160417/95776908/attachment.html>
Maggiori informazioni sulla lista
Lug
|