LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   raid 1 badly detected as raid 0 when one drive is missing (https://www.linuxquestions.org/questions/linux-general-1/raid-1-badly-detected-as-raid-0-when-one-drive-is-missing-4175648117/)

alfonz19@gmail.com 02-12-2019 01:17 AM

raid 1 badly detected as raid 0 when one drive is missing
 
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


l0f4r0 02-12-2019 02:52 AM

I can't help you regarding that matter but I suggest you use another username because:
  • here at LQ we don't answer questions by email so anybody can read answers for similar issues (s)he can have,
  • any spammer could grab your email address as it's a public forum.

alfonz19@gmail.com 02-12-2019 03:23 AM

I don't understand. I created this account some time ago and I have this account&username now. Definitely nothing blocked me from doing so, so I supposed it's OK. Can someone who know answer reply to me, or it's againts house rules?

l0f4r0 02-12-2019 03:58 AM

Quote:

Originally Posted by <OP_username_redacted> (Post 5960906)
I don't understand. I created this account some time ago and I have this account&username now. Definitely nothing blocked me from doing so, so I supposed it's OK.

Actually, it was just an advice for you just in case. If you want your email address to be public and possibly grabbed, you can.

syg00 02-12-2019 05:02 AM

I would suggest you spend some time reading Linux_Raid.
That wiki has an article that explains that (in-kernel) auto-detect was removed quite a while ago. If you are using x'FD' on your partitions you may be confusing the initrd.
I'd boot a liveCD and check the degraded array - see if it is detected properly.

alfonz19@gmail.com 02-12-2019 06:07 AM

I'm (raid) newbie, so I can just follow tutorials/documentation which is mostly out of date. Do you have up-to-date tutorial/how to?

also I don't follow that advice with autodetect: in mdmadm.conf is explicitly said: level=raid1 so where does autodetection come from?
and please, what is x'FD'?? no idea.


All times are GMT -5. The time now is 09:01 AM.