Atmospheric erosion of CO2-rich Earth-size exoplanets due to coronal mass ejection (CME)-induced ion pick up within close-in habitable zones of active M-type dwarf stars is investigated. Since M stars are active at the X-ray and extreme ultraviolet radiation (XUV) wave-lengths over long periods of time, we have applied a thermal balance model at various XUV flux input values for simulating the thermospheric heating by photodissociation and ionization processes due to exothermic chemical reactions and cooling by the CO2 infrared radiation in the 15 microm band. Our study shows that intense XUV radiation of active M stars results in atmospheric expansion and extended exospheres. Using thermospheric neutral and ion densities calculated for various XUV fluxes, we applied a numerical test particle model for simulation of atmospheric ion pick up loss from an extended exosphere arising from its interaction with expected minimum and maximum CME plasma flows. Our results indicate that the Earth-like exoplanets that have no, or weak, magnetic moments may lose tens to hundreds of bars of atmospheric pressure, or even their whole atmospheres due to the CME-induced O ion pick up at orbital distances <or=0.2 astronomical units. We have found that, when exposed to intense XUV fluxes, atmospheres with CO2/N2 mixing ratios lower than 96% will show an increase in exospheric temperatures and expanded thermosphere-exosphere environments. Hence, they suffer stronger atmospheric erosion, which can result in the total loss of several hundred bars even if an exoplanet is protected by a "magnetic shield" with its boundary located at 1 Earth radius above the surface. Furthermore, our study indicates that magnetic moments of tidally locked Earth-like exoplanets are essential for protecting their expanded upper atmospheres because of intense XUV radiation against CME plasma erosion. Therefore, we suggest that larger and more massive terrestrial-type exoplanets may better protect their atmospheres against CMEs, because the larger cores of such exoplanets would generate stronger magnetic moments and their higher gravitational acceleration would constrain the expansion of their thermosphere-exosphere regions and reduce atmospheric escape.