We study the stability of the different quark substructures in a quark cluster approach to pentaquark states considering the color-magnetic spin-spin interactions between quarks. The most likely configuration is found to be a triquark-diquark one where the two quarks of the diquark are coupled to spin zero and anti-triplet representations of flavor and color, and the triquark has spin one-half and belongs to the triplet representation of color and to anti-sextet of flavor. To ensure total antisymmetry under the interchange of identical particles, triquark and diquark are in relative p-wave. Using this configuration we estimate the masses and magnetic moments of pentaquarks. Finally the calculation of the masses has been extended to some charmed pentaquarks.