Question: Can one fast on 30 Sha‘bān as a precaution (so that if it was Ramadan, the fast counts as a Ramadan fast)?
Answer: One may only fast with the intention of a purely voluntary fast (nafl), without any form of doubt. One may not think that if it is Ramadan the fast will count as a Ramadan fast, and if not it will be nafl. This is disliked (makrūh). If it later turns out that Ramadan had in fact begun, the fast counts as a Ramadan fast. If not, it counts as nafl, and one will in any case have committed a sin.
(Al-Fatāwā al-Hindiyyah, Kitāb aṣ-Ṣawm, al-Bāb al-Awwal, vol. 1, p. 200).