The question I am asking comes from Ravi Vakil's notes, specifically Exercise 22.4.S.
Let $S$ be a surface over a field $k$ and let $p\in S$ be a smooth point $k$-point. Let $B$ be the blow-up of $S$ at $p$ and let $\pi:B\to S$ be the blow-up morphism. Let $E$ be the exceptional divisor. Let $K_S,K_B$ denote the canonical line bundles on $S$ and $B$ respectively.
I would like to show that $\pi^* K_S=K_B(E)$. I am having trouble proving this. If $S=\mathbb{A}^2$, this is straightforward, I have a feeling the general case should not be so different, but I can't seem to do it.
I am rather stuck on even a first step in the general case. Any hints would be greatly appreciated.