2. Let $x=\sqrt{5}, y$ be the greatest integer not exceeding the real number $x$. Then $\frac{1}{x-y}=(\quad$.
(A) $\sqrt{5}-2$
(B) $\sqrt{5}+2$
(C) $\sqrt{5}-1$
(D) $\sqrt{5}+1$
2. B.

From the given, we know $y=2$.
Therefore, $\frac{1}{x-y}=\frac{1}{\sqrt{5}-2}=\sqrt{5}+2$.