SD.begin fails after the mircoSd is written & arduino resetted

  1. I don't cancel the files

Do you mean that you don't close the file?

If you aren't closing the file, why not? Not closing the file is a bad idea.