In the Prose Edda, dwarves fit with the 'legendary smith' characterisation in that they make some of the best gear. Along with the elves (and possibly they're the same, though not...I think...in the edda, at least), they make most of the really interesting bits of kit that the gods have. Rather than having a smith god like Vulcan or Hephaestus, when the gods get something interesting it's often from a dwarf.
Take the story about Thor's hammer, for example. Loki and a dwarf compete to see who can make the best three treasures for the gods. Loki gets his treasures from a dark elf, the dwarf makes the treasures himself.
The dwarf makes three things: Thor's hammer (really light, infinitely strong, can fit under a jacket, all kinds of good stuff), Freyr's boar (it provides light, drives his chariot, again, really useful) and Draupnir (it's a ring that drips several gold rings now and then).
Meanwhile Loki's crew (the people at svartalfheim, the dark world, the dark elves, in other tellings of the story also dwarves) make three other things: Odin's spear (always thrusts cleanly), Sif's hair (literally gold, but also a stylin' wig that grows) and Skidblanir (it's a big ship, and it folds up into a piece of cloth you can put in your bag).
So what we get is an archetype of a master craftsman, someone well versed in making obviously magical items that even the gods can't or won't create for themselves. And that's dwarves! No obvious association with mountains in the edda, but it's a starting point for your archetype.
Source: Prose Edda, Jesse Bycock's translation.
I think Tolkien is a good guess for how the trope comes to pass into modern fiction. Tolkien wanted to draw on norse mythology, among other things, to create a modern mythology for England. Quite a few of his names can be found in the Edda, dwarven and not-dwarven (Gandalf, for example, is a name in there), but his dwarves aren't totally based on norse dwarves: their language, for example, is based on Hebrew, and many people think they are partially based on medieval jews: not necessarily in a disparaging way but in the sense of being a wandering people, cast out from their homeland and plying their trades elsewhere. Tolkien's dwarves are tremendously influential: dwarfs, for example, was the more common plural before he wrote his work, and his seem to form the first complete example of the modern archetype you've mentioned (bearded, mountain dwelling, smithing, capable warriors, and so on).