On 21/11/17 19:22, Per Jessen wrote:
Lew Wolfgang wrote:
On 11/21/2017 09:19 AM, Per Jessen wrote:
Sorry, I don't think I made myself clear. If the old disk was swapped out and copied, then the old disk is "clean". If this disk gets back into the same machine as the raid array, and the machine is rebooted, mdadm IS GOING TO GET CONFUSED. Yes, but Andrei is using an HP Smart Array Controller, not software raid.
I've also been bitten by hidden RAID metadata on individual disks. oh, me too. BTDT.
I don't know how a hardware controller usually deals with it - if a disk isn't actually dead, but maybe kicked out due to timeouts or smart warnings, removing all trace of its RAID "membership" sounds like a sound thing to do when it is failed.
I didn't know this (it should have been obvious, really), but when mdadm kicks a drive out, it updates the superblock to indicate that the drive has failed. Because it's a read, followed by a write, failure that gets a drive kicked, this is pretty safe. If the drive is "iffy", the superblock write will probably succeed. If the superblock write fails, there's a good chance the drive is dead. If you then (re)add this drive back into the array, mdadm checks for a bitmap (or now recently) a journal. If it finds one, it knows which writes have occurred since the drive failure, and just replays the failed writes. (This, if you have a bitmap, is the cause of the "raid 5 write hole", where mdadm can corrupt your array for you :-( If it can't find a bitmap/journal, it just assumes the drive is random data, and rebuilds it from scratch. That's why it's quite dangerous to remove and replace a drive without failing it first - that drive is then a loose cannon that can corrupt your array if it ever gets put back by accident. Which, although I didn't realise it when I wrote it, is a VERY good reason for following the wiki's advice and always using the --replace option to replace a working drive - it safely gets rid of the old drive while copying the data across so you don't lose redundancy while you do so. Cheers, Wol -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org