Skip to content

thin_shrink doesn't update nr_data_blocks in the output xml #322

@3niol4

Description

@3niol4

I am attempting to shrink an LVM thin pool using thin_shrink and following this tutorial: https://web.archive.org/web/20250123064253/https://pascalroeleven.nl/2022/08/09/how-to-shrink-your-lvm2-thin-pool-manually-if-you-are-adventurious/

It almost worked; however, when trying to reactive volumes, I would get an error. Reading in dmesg, I would see:

pool target (1000) too small: expected 2000

where 1000 and 2000 are the new and old pool size, respectively. It threw me for a while, as I couldn't understand where the 2000, the old pool size, could come from. After a while, I realized that the input and output of thin_shrink were exactly the same; that is, after

pdata_tools thin_shrink --input metadata --output metadata_shrinked --data /dev/mapper/vg-tpool0_tdata --nr-blocks 1000

metadata_shrinked had the exact same content as metadata, including the same nr_data_blocks value in the first line. Editing that file manually and continuing with the process seems to have worked though.

Since the thin_shrink command returned immediately, I assume it could be because no data needed to be moved. But to be completely honest, I'm a bit out of my depth and I don't know enough about LVM to be sure my assumptions make sense. I also can't read Rust, so I can't verify my assumption in the code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions