  We study entropy production in nanoscale devices, which are coupled to finite
heat baths. This situation is of growing experimental relevance, but most
theoretical approaches rely on a formulation of the second law valid only for
infinite baths. We fix this problem by pointing out that already Clausius'
paper from 1865 contains an adequate formulation of the second law for finite
heat baths, which can be also rigorously derived from a microscopic quantum
description. This Clausius' inequality shows that nonequilibrium processes are
less irreversible than previously thought. We use it to correctly extend
Landauer's principle to finite baths and we demonstrate that any heat engine in
contact with finite baths has a higher efficiency than previously thought.
Importantly, our results are easy to study, requiring only the knowledge of the
average bath energy.
