We propose a way to accelerate the solution of symmetric and positive definite linear systems through the computation of some partial spectral information related to the ill-conditioned part of the given coefficient matrix. This is of particular interest in problems where we need to solve consecutively several linear systems with the same matrix but with changing right-hand sides. The idea is to extract some near-invariant subspace associated with the smallest eigenvalues. To do so, we combine the block conjugate gradient algorithm with the inverse subspace iteration to build a purely iterative algorithm, and we exploit the possibility of reducing the total amount of computational work by controlling appropriately the accuracy when solving the linear systems at each inverse iteration. We also improve on the global convergence of this technique by means of polynomial filters.