"long pole on a ship, secured as the lower end to the keel, to support the yards, sails, and rigging in general," Old English mæst, from Proto-Germanic *mastaz (source also of Old Norse mastr, Middle Dutch maste, Dutch, Danish mast, German Mast), from PIE *mazdo- "a pole, rod" (source also of Latin malus "mast," Old Irish matan "club," Irish maide "a stick," Old Church Slavonic mostu "bridge").
The single mast of an old ship was the boundary between the quarters of the officers and those of the crew, hence before the mast "serving as an ordinary seaman" in the title of Dana's book, etc.
In all large vessels the masts are composed of several lengths, called lower mast, topmast, and topgallantmast. The royalmast is now made in one piece with the topgallantmast. A mast consisting of a single length is called a pole-mast. In a full-rigged ship with three masts, each of three pieces, the masts are distinguished as the foremast, the mainmast, and the mizzenmast; and the pieces as the foremast (proper), foretopmast, foretopgallantmast, etc. In vessels with two masts, they are called the foremast and mainmast; in vessels with four masts, the aftermast is called the spanker-mast or jigger-mast. [Century Dictionary, 1895]
"fallen nuts or acorns serving as food for animals." Old English mæst, the collective name for the fruit of the beech, oak, chestnut, and other forest trees, especially serving as food for swine, from Proto-Germanic *masto (source also of Dutch, Old High German, German mast "mast;" Old English verb mæsten "to fatten, feed"), perhaps from PIE *mad-sta-, from root *mad- "moist, wet," also used of various qualities of food (source also of Sanskrit madati "it bubbles, gladdens," medah "fat, marrow;" Latin madere "be sodden, be drunk;" Middle Persian mast "drunk;" Old English mete "food," Old High German muos "meal, mush-like food," Gothic mats "food").