As I understand it, it's best practice to set the drive flags as "raid" before adding them to a mdadm raid array. Okay fine, but I also heard people say that they didn't do this and mdadm worked fine. Does mdadm auto-add the raid flag once you add the drives to the array and begin building? Is there any benefit to using the raid flag since it appears mdadm seems to work with or without it?
Linux software RAID doesn't care about this flag, as far as I know. It identifies the volumes by scanning them for the appropriate metadata on specific locations (superblocks).
You can check this yourself manually by this command:
mdadm --examine /dev/sda1 # part of an array /dev/sda1: Magic : a92b4efc Version : 0.90.00 UUID : a20e36c2:a217b925:f3fd9ffa:59263103 # Array identifier [...] mdadm --examine /dev/sdc2 # not part of an array mdadm: No md superblock detected on /dev/sdc2.
With mdadm it's also possible to create an array on a volume without any form of partitioning, so, that also indicates me it will just work without.
Does mdadm auto-add the raid flag once you add the drives to the array and begin building?
It doesn't touch partitions or partition tables. It's not the responsibility of this layer in the Linux device mapper.
Is there any benefit to using the raid flag since it appears mdadm seems to work with or without it?
It's just nice for your own convenience in system administration! I fail to find any other benefit.