2. Given weights of $7 \mathrm{~g}$ and $m \mathrm{~g}(m$ being a positive integer) are available, and to weigh an object of $1 \mathrm{~g}$ on a balance, 7 of these weights are needed. Then the number of possible values for $m$ is ( ).
(A) 3
(B) 4
(C) 5
(D) 6
2. C.

Let the number of $7 \mathrm{~g}$ weights be $n$. Then the number of $m \mathrm{~g}$ weights is $7-n$. According to the problem,
$(7-n) m-7 n=1$ or $7 n-(7-n) m=1$.
If $(7-n) m-7 n=1$, then
$$
m=\frac{7 n+1}{7-n}=\frac{7 n-49+50}{7-n}=\frac{50}{7-n}-7 .
$$

Since $0<7-n<7$, we have $7-n=1,2,5$.
Accordingly, $m=43,18,3$.
Upon checking, when $m=3$, $7 \times 1-3 \times 2=1$, which means 1 gram can be measured with 3 weights, which does not meet the problem's requirement; when $m=43,18$, the conditions are satisfied.

Similarly, if $7 n-(7-n) m=1$, we get $m=41,17,9$ that satisfy the conditions, and $m=5,1$ do not meet the requirements.
In summary, there are 5 values of $m$ that satisfy the conditions.