Looks like there is ~10^−8 earth masses of oil and coal [1]. I can't seem to find the mass of magneisum on earth but its 2.5% of the earth's crust, which is apparently <1% of the earth's volume, lets estimate 0.1% of the total mass to be conservative, not sure how reasonable this is but seems ok for this back of the envelope calculation [2]. This gives about ~10^-5 earth masses of magnesium, still orders of magnitude more than the oil and coal and this process won't consume it, its just for hydrogen storage/transport.