How to determine the most reactive hydroxyl group of α-ᴅ-glucopyranose? In the following reaction, only one of the hydroxyl groups in D reacts under the given conditions:


I was wondering which OH group reacts and why? Also I have been trying to determine the structure of E based on which hydroxyl group reacts.
My thoughts are that OH in the side group can react via SN2 with the reactants, but the OH right adjacent to the ether O can react leaving a carbocation that can be stabilised by lone pair from O. This would mean SN1 and a completely different product.
Can someone please explain the correct mechanism?
$\ce{EtOH}$ is a rather bad nucleophile and we have the assistance of a lone pair of the neighboring oxygen atom (the positive charge can hence be delocalized over the carbon and oxygen) which greatly speeds up $\ce{S_{N}1}$ in comparison to $\ce{S_{N}2}$. So what will probably happen is protonation by $\ce{HCl}$ of the alcohol next to the ether oxygen followed by nucleophilic ($\ce{S_{N}1}$) attack of $\ce{EtOH}$ on the formed (delocalized) secondary carbocation. In comparison to the possible reactions at the other secondary centers (having the formulation of the question in mind) this primary reaction will be fast enough to justify the ignoring of them.