Reversible/Irreversible Fundamental Equation I do have some problems in understanding how the fundamental equation may be written correctly.
For a closed system without chemical reactions (and compression work being the only form of work done), the fundamental equation may be written as:
$ dU = TdS - pdV$.
Now, since S and V are state variables, the above equation should hold for any path between $S_1, V_1$ and $S_2, V_2$. In particular, it should hold for reversible and irreversible processes, right?
However, in, e.g. Reichl, L. 2016, Modern Course in Statistical Physics, the following form is presented:
$ dU \le TdS - pdV $
Reichl says that "The equality holds for reversible changes, and the inequality holds for changes which are spontaneous."
What am I missing here? Is the equal sign always correct or only for the reversible case?
 A: The fundamental equations of thermodynamics, such as $dU = T dS - p dV$ etc., should be understood as mathematical relationships among thermodynamic properties. If we go to the team tables for example and look at two entries close to each other, we should be able to confirm the above differential.
The integration of thermodynamic differentials requires an integration path,which is a line on the thermodynamic plane, for example, the $(S,V)$ plane, in the case of the above differential. A line (any line) on the thermodynamic plane can be associated with a reversible process that could be conducted experimentally. Conversely, only reversible processes can be associated with a line on the thermodynamic plane.
Real processes are irreversible (reversibility is an idealized limit) and reversibility is usually expressed in the form of some inequality. All of these inequalities derive from the second law, which says that the total entropy change in a closed system is positive, $S_\text{gen}\geq 0$.
The same is true for the inequality $dU < T dS - p dV$, but one must be extra careful on how to read this equation. It means the following: If we partition a system with fixed total $S$ and $V$ into two parts and transfer an arbitrary amount $dS$ and $dV$ from one side to the other, then:

*

*If the total $U$ decreases ($dU<0$) the two parts are moving closer to equilibrium


*If the total $U$ increases ($dU>0$) as a result of the exchange, the two parts are moving further away from equilibrium


*If the total $U$ remains unchanged ($dU=0$), the parts are in equilibrium with each other.
Case 1 is a feasible exchange, i.e., one that could be observed to occur spontaneously; case 2 represents a process that is not physically possible. Case 3 restores the equality of the fundamental differential.

Derivation
I added this derivation in response to the comment by @hyportnex.
Consider a system in contact with a bath at temperature $T'$, pressure $p'$ and chemical potentials $\mu_i'$. Processes in the system can be reversible or irreversible, but in the bath they are always reversible because they take places under constant $T'$, $p'$ and $\mu'_i$. For any such process,
$$
   dS' + dS \geq 0,
$$
where primes refer to the bath and unprimed variables to the system. We conduct a process that changes the system by $(dU,dV,dn_i)$ and the bath by $(dU',dV',dn'_i)=-(dU,dV,dn_i)$.  The entropy change of the bath is calculated by the equilibrium condition
$$
   dS' 
   = \frac{dU'}{T'} + \frac{p' dV'}{T'} - \sum_i \mu'_i dn'_i
   = -\frac{dU}{T'} - \frac{p' dV}{T'} + \sum_i \mu'_i dn_i
$$
Substitute into the second law and rearrange:
$$
 dU - T' dS + p' dV - \sum_i \mu'_i dn_i \leq 0
$$
For a process at constant $S$ and $V$ in a closed system this gives
$$
  dU \leq 0
$$
which we can write as
$$dU \leq T' dS - p' dV$$
where we now have the temperature and pressure of the bath. I agree that this is a confusing and misleading way to express this inequality, which nonetheless is found in many textbooks. The proper way to write it is
$$ dU \leq 0 \quad
\text{for any process at constant $S$,$V$,$n_i$}
$$
