Re: no automatic resync after device disconnect then reconnect
From: NeilBrown <hidden>
Date: 2014-07-10 00:36:21
On Wed, 9 Jul 2014 17:57:03 -0600 Chris Murphy [off-list ref] wrote:
On Jul 9, 2014, at 4:58 PM, NeilBrown [off-list ref] wrote:quoted
On Wed, 9 Jul 2014 16:44:27 -0600 Chris Murphy [off-list ref] wrote:quoted
This is in a VM, no data at risk. Two problems: 1. I intentionally removed one of two md raid1 member devices, boot degraded succeeds, clean power off, reconnect the removed md member device, boot succeeds but an automatic resync does not occur for the previously disconnect md members. Maybe this is expected, I'm not sure, but I'd think a better user experience would be autoresync perhaps with a notification?Do you? Maybe the device was removed from the array because it is faulty. Do you *really* want a faulty device automatically added back into your array?OK maybe not.quoted
It is quite possible to set up udev rules and configure mdadm policy to do this. I just don't think it is a sensible default.Fair enough.quoted
quoted
2. For the raid set with a bitmap, this command succeeds # mdadm --manage /dev/md126 --re-add /dev/sdb3Good to know.quoted
However, for the raid set without bitmap (seems the same otherwise, same metadata version), it fails: # mdadm --manage /dev/md127 --re-add /dev/sdb2 mdadm: --re-add for /dev/sdb2 to /dev/md127 is not possibleYou need a bitmap to --re-add.OK.quoted
Without a bit map, you are just adding an unused device to an array and "--add" is the command to use. If you set up the mdadm policy (in mdadm.conf) suitably then mdadm -I /dev/sdb2 would find the add and --add it for you (I think).[root@localhost ~]# mdadm -I /dev/sdb2 mdadm: not adding /dev/sdb2 to active array (without --run) /dev/md/boot
That is why I said "set up the mdadm policy". "mdadm mdadm.conf", search for POLICY and particular "action=". NeilBrown
[root@localhost ~]# mdadm -I /dev/sdb2 --run /dev/md/boot
mdadm: --incremental can only handle one device.
[root@localhost ~]# mdadm --manage /dev/md127 --add /dev/sdb2
mdadm: added /dev/sdb2
/proc/mdstat
md127 : active raid1 sdb2[2] sda2[0]
716224 blocks super 1.2 [2/2] [UU]
Thanks,
Chris Murphy Attachments
- signature.asc [application/pgp-signature] 828 bytes