Skip to contentSkip to conversation

Good drive got kicked out - does mdadm assemble across suspend/resume like it does across reboots?

DISCUSSION Ram Ramesh 2 participants 2 messages Oct 12, 2014 – Dec 4, 2014 MD RAID

lore
Share & tools
lore

Ram Ramesh

author
#0 lore raw

I did a minor booboo with my mdadm raid6. I suspended (not shutdown, but suspend-to-ram) the machine to install a *new* disk in a hotswap bay for a thorough test before usage. This machine also housed a mdadm raid6 array with 4 disks /dev/sd[cdeg]1 (not /dev/sdf1). When I inserted the new disk, I also rearranged the disks in the hotswap cage. I think that is a stupid mistake because /dev/sdg1 was also in the cage and now became /dev/sdf1 and the new disk got the name /dev/sdg1. I did not think much about it, since I thought mdadm would assemble after a resume and will find the right disks. I did not bother to check if anything happened to /dev/md0.

After checking the new disk (now /dev/sdg1) I added /dev/sdg1 to md0 (as spare) without checking /proc/mdstat. I noticed rebuild started to my surprise. I was trying to figure out what happened. It looks like resume after suspend does not assemble md0 as it does for reboot. So, it looked at the new /dev/sdg1 and found to be not part of md0 and degraded the array. So when I added it, it thought I am adding a new drive and proceeded to rebuild to fix the degraded state. A quick check of /dev/sdf1 (which was /dev/sdg1 before my swap) contains everything right, but got kicked out of array due to suspend-swap disk-resume issue.

While this is not a disaster, I wonder if my understanding is correct? Does this mean mdadm does not scan to assemble as part of resume? More importantly, how should I rectify the situation like this? Reboot or simply stop md0 and scan in a live system? Further, how do I use /dev/sdf1 (that was /dev/sdg1 before this problem)? zero-superblock and add back to md0?

Sorry, if this was already discussed. If so, just let me know and I will search the archive manually as Google did not find it.

Thanks for your help
Ramesh

#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 6 lines · Ram Ramesh

While this is not a disaster, I wonder if my understanding is correct? Does this mean mdadm does not scan to assemble as part of resume? More importantly, how should I rectify the situation like this? Reboot or simply stop md0 and scan in a live system? Further, how do I use /dev/sdf1 (that was /dev/sdg1 before this problem)? zero-superblock and add back to md0?

Of course it does not reassemble the array after a suspend -- the point of suspend/resume is that the system picks up exactly where it left off. Since the array is never torn down, it is not built back up. In other words, yanking out drives while suspended isn't really any different than doing it while running -- not a good idea.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)

iQEcBAEBAgAGBQJUgLGMAAoJENRVrw2cjl5RLOkH/iZVwQ6FC664CN4y2hGiIOYD FX4VLtRdEDy517sdqm15nv4LTqfGucZjfiEDtwRs5rQZsIyCOelah8RvxYUOTNrJ xbURswZTaNhvaEG1/gwIlJoQ5cawVetZKeL6PnMWHpSLHQuoIaqe/wDO3pevcTDD 7vggJvYMr8S4aVKnt8/Ksk/E6DVCsGvCuySvHOr3eGecJuLF4CPZYFZy5G0qqRuo piI918gushh6CgriFOCdBWice3HwK6V1Nb12kjkVY89l0bQlrIRUo6e6aG1c1M9P eVmQJOzedtQB8qgsAhc2oXEwtuR/VNWNwxNTPTHCND3nk8FcaTDgzE3MMFmi1OY= =EXWL
-----END PGP SIGNATURE-----