TITLE: Why the total space of $\mathcal{O}(K)$ has trivial canonical bundle?
QUESTION [5 upvotes]: Let $X$ be a smooth variety, and $K$ be the canonical divisor on $X$. Let $\mathcal{O}(K)$ be the corresponding canonical sheaf. Then why the total space $Spec\mathcal{O}(K)$ has trivial canonical bundle?

REPLY [3 votes]: Let $Y$ be a total space of $\omega_X$
$$
Y=\operatorname{Spec} \oplus_{i \geq 0} \omega_X^{-i}.
$$
and $\pi: Y \to X$ is projection of this vector bundle. I fix some nowhere vanishing section $s$ of $\omega_X$ over an affine chart $Spec(A)=U \subset X$ and use canonical identification
$$
T_{vert}^* \cong \omega_X^{-1},
$$
to conclude that $s \wedge s^{-1}$ is a section of $\omega_Y$ over $\pi^{-1}(U) \cong Spec(A[s])$. Other choice of section will differ by nowhere vanishing function and this differences does not affect $s \wedge s^{-1}$, i.e. $s \wedge s^{-1}$ is a trivializing section of $\omega_Y$.