I see a lot of riders with two or even three keys on their keyring. They bought these bags on eBay, they broke the lock on the gas cap, had to replace the upper clamp, whatever. The locks used on these bikes are so easy to re-key there's just no reason to have a multi-key riding experience if it's not what you want.
The locks described here use the early 2-sided keys, found on R11, K12, R12C and later F650 models. Earlier bikes (Airheads and early K bikes) use keys which are only cut on one edge, and CAN-Bus bikes use a different (but similar) system.
These are known as wafer tumbler locks, because there are a series of flat wafers in the lock barrel which the correct key will move into a position where they no longer block the rotation of the barrel. Making a barrel work with a different key is as simple as installing the correct wafers in the barrel.
As you've probably figured out, the three main parts are the key, the barrel, and the wafers.
Keys have eight positions which are cut to one of three depths. The same cut is on the top and bottom edges, allowing the key to be used in either orientation.
The common variations on this one are the stubby keys (aka wallet keys) and the silver-handled keys on the Cruiser models.
There are two main types of barrel. The long one (like the ignition switch, or saddlebag lock) has a spring-loaded cover crimped onto the top, and either a blade (turn) or a cup (catch) at the bottom to operate whatever mechanism the key controls. Fuel cap locks have shorter bodies without a cover, and a different shape on the blade.
Barrels have eight slots for wafers, which are inserted from alternating sides. This means the even numbered wafers are pushed into position by one edge of the key, and the odd numbered ones are pushed by the opposite side. Except when used in ignition, the first six slots have wafer in them. The seventh slot is left empty and the eighth has a retention plate in it. If you put a wafer into the seventh slot, the barrel will not insert fully into the lock housing.
Ignition locks use wafers in all eight slots, and a spring-loaded pin is used in the blade for retention. This pin is stronger than the retention plate used on other locks, and using all eight slots for wafers increases the security for the ignition (which is also the steering lock on these models).
Wafers come in three sizes, to match the three cut depths on the key. Wafers are numbered 1, 2 or 3 depending on the position of the slot, and they match the three heights to which any key segment might be cut. When they match, the wafer is centered in the lock barrel and the ends do not protrude. When all six (or eight, for ignition) are centered, the barrel can turn.
Additionally, the wafers used for ignition are unique; they have hooks on the tips of the protruding ends to increase the difficulty of picking them.
Ignition and luggage locks are removed by inserting the key and turning the lock. This positions the release pin or plate at an opening where it can be pressed inward, allowing the barrel to be withdrawn. Fuel, seat and helmet locks are usually within housings which are disassembled and the retainer can be pushed inward.
If you're concerned about how secure your bike is since you can pull the locks out, note that the more important the lock is, the harder it is to get the lock out without the key. On the ignition, it's impossible without destroying the lock. Side cases, same story. Fuel cap and helmet lock, less so.
Look at the photo of the gas cap lock. See how there are ridges on the ends of the wafers? When you stick the wrong key into the lock, these ridges stick out. This is what keeps the barrel from turning. The number of ridges sticking out indicates how many numbers off you are on that wafer. Since there are only three possibilities, it's not hard to figure out. For instance if you have one ridge sticking out and the wafer is a #3, try a #2. If it's a #2, then it'll be either #1 or #3 depending on which side sticks out. Alternatively, if you're really good you could look at the key (see the first picture) and write down the pattern. Then if you just drop them in you should be OK, right? In any case, when the wafers are all flush with the surface of the barrel, you're done. Insert the retention plate or pin and reinsert the barrel into the lock. Usually you have to turn it to help push the retention plate in, but you'll have to look at that and figure it out.
New lock sets (an empty barrel with a collection of springs and wafers) are sold by BMW for about $30 each. Since most wafers can be reused elsewhere in a barrel, one kit might be enough to rekey two or three locks. They're listed as "for dealership use only" but dealerships commonly sell them:
This article isn't complete without mentioning the 'easy way' of rekeying. With the incorrect key in the barrel, some of the wafers will be protruding. A light zzzip on the grinding wheel and they're flush again. Of course, for each ridge removed from each wafer, you're increasing the number of keys that will open the lock. Doing the math, ignition locks have 38, or 6561 possibilities, while the rest of the locks have 36, or 729. When you turn those 3s into 2s or 1s, the number drops pretty quickly. Say you grind two ridges off two of the wafers and one ridge off two more. Your saddlebags now have 1:20 chance of being opened by any given key, rather than 1:729, and that's only if it's done carefully.
Grinding locks is fast, which means cheap, but these locks are so easy to reconfigure that a properly equipped shop can do the job right in just about the same time.