We have investigated experimentally the influence of magnetic interactions between the grains (i) on the packing fraction and (ii) on the compaction dynamics of a granular pile. The granular material used to perform these studies is made of ferromagnetic grains submitted to an external magnetic field B⃗. The evolution of the packing fraction as a function of the Bond number Bo witch is the ratio between the cohesive force Fc and the grain weight mg has been measured. Moreover, we present an experimental protocol that allows one to tune the packing fraction η of a random pile of ferromagnetic spheres from a value close to the lower limit of random loose packing ηRLP≃0.56 to the upper limit of random close packing ηRCP≃0.64. This broad range of packing fraction values are obtained under normal gravity in air, by using a magnetic cohesion between the grains during the initialization of the pile. Concerning the compaction dynamics, the influence of the magnetic interaction on the compaction characteristic time τ has been measured.