Holographic bound from second law of thermodynamics