I'm learning raids, so maybe this is some basic question, but it's not covered anywhere...
When I create raid 1, update /etc/mdadm/mdadm.conf as[1], run update-initramfs -u, I can reboot and mount it. Everything is fine. Now I remove one drive, and reboot, to simulate critical failure. raid will be wrongly detected as raid 0 (WHY?), inactive (WHY? because we "just have half of raid0?) and as such cannot be used. What I expected to see was active, degraded drive, not this fatal. What's wrong? See [2] for error state description.
Related question: why mdadm.conf [1] contains devices=/dev/sdb1,/dev/sdc1 if allegedly all partitions (resp. ones defined in DEVICE variable) should be scanned for raid UUID? So why is this part generated? What is its use and why isn't there partition UUID used instead? Could it even be used here?
[1] mdadm.conf
Code:
cat /etc/mdadm/mdadm.conf
# mdadm.conf
#
# !NB! Run update-initramfs -u after updating this file.
# !NB! This will ensure that initramfs has an uptodate copy.
#
# Please refer to mdadm.conf(5) for information about this file.
#
# by default (built-in), scan all partitions (/proc/partitions) and all
# containers for MD superblocks. alternatively, specify devices to scan, using
# wildcards if desired.
#DEVICE partitions containers
# automatically tag new arrays as belonging to the local system
HOMEHOST <system>
# instruct the monitoring daemon where to send mail alerts
MAILADDR alfonz19gmail.com
MAILFROM vboxSystem
# definitions of existing MD arrays
# This configuration was auto-generated on Sun, 10 Feb 2019 09:57:56 +0100 by mkconf
ARRAY /dev/md0 level=raid1 num-devices=2 metadata=1.2 name=mmucha-VirtualBox1:0 UUID=16624299:11ed3af5:3a8acd02:cd24d4d0
devices=/dev/sdb1,/dev/sdc1
root@mmucha-VirtualBox1:~# cat /etc/mdadm/mdadm.conf
[2] errorneous state:
Code:
root@mmucha-VirtualBox1:~# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : inactive sdb1[0](S)
5236719 blocks super 1.2
unused devices: <none>
root@mmucha-VirtualBox1:~# mdadm --detail /dev/md0
/dev/md0:
Version : 1.2
Raid Level : raid0
Total Devices : 1
Persistence : Superblock is persistent
State : inactive
Working Devices : 1
Name : mmucha-VirtualBox1:0 (local to host mmucha-VirtualBox1)
UUID : 16624299:11ed3af5:3a8acd02:cd24d4d0
Events : 19
Number Major Minor RaidDevice
- 8 17 - /dev/sdb1