Reaction of Diols with HX hydrohalic acids, Competing SN2 Reactions Suppose 1,5-pentanediol were exposed to something like hydroiodic acid. Would the alkoxonium end of the diol be exposed to a nucleophilic attack by the remaining hydroxide at the other end for a ring formation? Or would the newly-free iodide ion be more competitive for substitution? Thanks!

edit: It was pointed out to me "newly-free iodide" was quite confusing. I meant it as though HI dissociated, the Hydrogen ion attacked one end of the diol, and the iodide from the HI being "newly-free". Now that one end of the diol has a good leaving group (H2O), is it more susceptible to be attacked by the iodide, or by the other end (OH) of the diol.
Bob:
Here is the likely process. The alcohol 1 is protonated to provide intermediate 2 which undergoes SN2 displacement. The closure of 3 to  tetrahydropyran 6 is unlikely under the reaction conditions. Rather a second displacement via 4 would lead to diiodide 5. If the tetrahydropyran did form, ethers are cleaved by HI. The conversion of 3 to 6 is normally accomplished in the presence of base (NaH/THF).