The present invention is directed to methods and compositions for typing of Lactobacillus buchneri bacterial strains, detecting the presence of a L. buchneri in a sample, identifying a strain of L. buchneri having resistance to an invasive foreign genetic element, modifying the resistance of bacteria and archeae to an invasive foreign genetic element, and introducing nicks into or cleaving double stranded DNA for genome editing.