We first showed in a GCMC simulation that, from a thermodynamic point of view, a Mg nanoparticle (here 978 atoms) is first oxidized at surface oct-sites. The structure obtained at the end of the simulation is mostly amorphous with individual domains showing rocksalt ordering, separated by grain boundaries. For complete transformation to the rocksalt structure, the particle must be heated to 2000 K in an MD simulation for at least 75 fs. If the thermal annealing is performed at too low temperatures or the system is cooled down too quickly, grain boundaries remain visible.