How To Repair LVM Thinpool Print

  • lvm, linux, storage
  • 0

Sometimes there can be error like the following:

Thin's thin-pool needs inspection.

It can appear for many reason, usually the reason of metadata or the data has overflown for the main pool. Here are the steps to repair the thin pool:

First, deactivate all the volumes under thin pool. For example, if you have a logical volume vpsextra under thin pool tp0 and volume group vg0, you would require to run the following:

lvchange -an /dev/vg0/vpsextra

Once your all the logical volumes are deactivated, you may run the lvconvert repair on the thin pool itself, not the logical volume:

lvconvert --repair vg0/tp0

Once the repair is done, you may reactivate the logical volumes:

lvchange -ay /dev/vg0/vpsextra

You may also need to extend the pool, if you do not have the auto extension working on your thin pool:

lvextend -L+15G /dev/vg0/tp0

Once all done, if you see a superblock error or a file system error while mounting the logical volume, run e2fsck:

e2fsck -yf /dev/mapper/vg0-vpsextra

If everything goes alright, you should be able to bring the lv back online. 

Note: If the thin pool is overflown, do not run lvextend without unmounting the partition. This can sometimes cause file system error.

Was this answer helpful?

« Back