[LugBS] RAID1: c'è (almeno) una cosa che non capisco
Luca Coianiz
luca a coianiz.it
Sab 16 Apr 2016 13:50:11 UTC
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
Maggiori informazioni sulla lista
Lug
|