So I have been posting a lot about a RAID build with MDADM and Ubuntu (sorry about that). Im just not understanding whats going on with my setup.
I have a RAID-5 setup, and followed this guide exactly to do so: http://zackreed.me/articles/38-software-raid-5-in-debian-with-mdadm
Anwyay, Im running into this consistent problem. I turn off the RAID at times when I dont need it up, and when I turn it back on I get stuck at a purple screen. I can get out of this screen by simply typing in exit, and it will tell me my raid is Degraded, asking if I wish to boot it or not. After that, its the normal login screen. Then, this is what I see via SSH: (typing it out)
mdadm-D /dev/md127
Then it returns to me that one of the drives is "removed"
Then I will:
mdadm --manage /dev/md127 --add /dev/sd** (** standing for the drive)
This is what I always get back
mdadm: /dev/sd** reports being an active member for /dev/md127, but a --re-add fails.
mdadm: not performing --add as that would convert /dev/sdb1 in to a spare.
mdadm: To make this a spare, use "mdadm --zero-superblock /dev/sd**" first.
So, I will follow those instructions and then once again re-add the drive, and then the RAID will rebuild fine.
What I am frustrated with is this happens so often, and I have no idea why. Can anyone help me out? Sometimes it works fine, and sometimes it doesn't. All that I am doing is turning it off, or on. Any help is greatly appreciated, I dont understand why my RAID wont just work normally or what I am doing wrong.
/var/log/syslog
or possibly/var/log/syslog.1
and see what messages there were prior to the last shutdown/restart. You should be able to just dosudo less /var/log/syslog
and then search for 6 zeros (/000000
). This will find the startup messages and you can just move backwards (PgUp) for the shutdown messages.000000
is just a quick way to find the startup messages in/var/log/syslog
. If you then look at the lines preceeding the startup, you will see the messages from the last shutdown where you might find an error messages about the disks.sudo smartctl -i /dev/sdb
(may needsudo apt-get install smartmontools
).smartctl -H /dev/sdb
will report overall health of the drive;smartctl -a /dev/sdb
will report errors (plus the above 2). If smartctl doesn't report the drive (e.g. some USB) you need to use something else (or look at the startup log in/var/log/syslog
).