A device for obtaining a solid sample of rock from a borehole or from the ocean bottom. A core barrel is a hollow cylinder attached to a special bit, used to obtain a continuous core section from the bottom of a borehole. Cores are obtained from the bottom of a borehole with a wireline corer, the core barrel being retrievable without having to trip out of the hole. A sidewall corer obtains a sample from the borehole wall by firing a hollow cylindrical bullet from a tool suspended in the borehole. A core slicer using diamond-edged blades cuts a triangular core about 1 inch on a side and up to 3 ft-long from the side of a smooth borehole. A box corer usually penetrates less than 3 ft into the sea floor and has a spade-like device that retains a sample. A gravity corer penetrates the ocean floor solely by its own weight. The piston in a piston corer retracts as the cylinder penetrates the sediments. The jaws of a grab sampler seize a portion of the sea bottom for retrieval.