Should you grind your own spices? Yes as much as you can. Why? Once spices are ground they rapidly begin to lose their integrity and hence their flavour, so having whole spices on hand to grind as you need them is preferable to buying a pre-ground mix. It’s also unfortunately true that unscrupulous spice merchants are not above mixing in ground rice or other flour or turmeric or anything else that will bulk out the mix and increase the profit. For similar reasons I don’t use pre-prepared curry pastes, which have the additional disadvantage that they are heavy with preservatives for shelf life and often very salty (and that’s from a Sri Lankan who loves salt). Many small South Asian grocers grind their own mix from whole spices and package it up and if you want to/have to go the pre-ground route, this is the way to go.
What to use to grind the spices? Well, if I have a small amount I will use a mortar and pestle but I am generally more likely to use a dedicated spice grinder – either a coffee grinder reserved for this, or a specialist spice grinder from a South Asian supplier. To be honest, I haven’t developed the knack of not having spice seeds fly everywhere when I attack them in a mortar no matter how deep it is. When grinding roasted spices it’s best to let them cool down before grinding.
Some Sri Lankan recipes that use vinegar will ask you to grind the spices with the vinegar into a paste. Mustard is often ground this way. Use the vinegar sparingly if doing this in an electric grinder or you and your kitchen are likely to end up like a Jackson Pollock paint dribbled canvas.
How fine to grind the spice? Generally I go for very finely ground and in specialist grinders that can be very fine indeed, certainly finer than in a mortar and pestle or on a grind stone. Sometimes, though I quite like having a medium to fine grind so some of the spice is in tiny tiny flakes that give texture and interest to the dish when my guest bites down on a sliver of a particular spice. There are also times I like going for a mix of a small amount of the whole spices as well as a fine grind.
If, like me, you grind more than you need, you can store the mix in a jar with a good seal (or one of those zoosh vacuum sealing plastic bag thingies), but use it soonish (weeks to a couple of months) post the grinding. I find a roasted ground mix will last longer than an unroasted one.