An Etymological Dictionary of the German Language/ob
ob (1.), prep. and adv., ‘over, above,’ from MidHG. obe, ob, prep. and adv., ‘aloft, above, across,’ so too OHG. oba; comp. AS. ufe-weard, ‘upper.’ ModHG. ob has been retained chiefly in compounds such as Obacht and Obdach. Allied to oben.
ob (2.), conj., ‘whether, if,’ from MidHG. obe, ob, op, conj., ‘if, as if, although, whether,’ so too OHG. oba, with the earlier variant ibu, ‘if, whether’; corresponding to OSax. ef, of (AS. gif, E. if). Goth. ibai, iba, ‘whether then, perhaps, probably, lest perhaps,’ with the corresponding negative nidai, niba, ‘unless.’ The OHG. form is the dat. and instrum. of iba, f., ‘doubt, condition,’ OIc. ife, efe, m., and if, ef, n., ‘doubt.’ Hence the lit. meaning of the conj. is ‘in doubt, on condition.’