A
A
Alex Pebody2021-11-18 09:06:19
linux
Alex Pebody, 2021-11-18 09:06:19

LVM shrink size?

Good day to all. Please help.

In short: I have a 140GB lv, but I only use 10Mb there, how can I reduce the free space on this lv? I tried the command: lvextend -l -100%FREE /dev/volgroup/logvol but it didn't work, it only moves a couple of blocks but doesn't make the lv smaller.

Secondly, I have /dev/sda2 - LVM2_member and it has 199GB, after shrinking lv, how can I reduce and compress the partition to a minimum and throw away the free space so that I can delete it later (might need to move partitions with gparted)?

p.s. I can't shrink the lv or partition via resize2fs because I can't shrink the XFS file system.

Thank you!

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexey Dmitriev, 2021-11-18
@alexpebody

clonezilla\rescuezilla

A
Adamos, 2021-11-18
@Adamos

In short: I have lv 140GB, but I only use 10Mb there

Quite briefly: there is an unsuccessful solution containing only 10 megs of useful information.
High and short: merge these 10 megs somewhere, remove the bad markup and redo it as it should.

A
Alexey Cheremisin, 2021-11-18
@leahch

xfs? BUT! Yes, it cannot be reduced, only expanded, unlike ext3/4.
There is only one option:
- copy the data
- unmount the partition
- demolish the logical volume
- create a new one of the required size
- format
it - copy the data back
And yes, for the future, XFS is certainly good (especially with automatic defragmentation), but EXT4 is no worse than they say half a petabyte of data in our working storages!

A
Alex Pebody, 2021-11-18
@alexpebody

I tried to create a livecd using UCK-GUI or whatever to get system-config-lvm but I can't create a livecd because UCK is a dead project. And I can't find any GUI tools for LVM.
There is also an option to make a data backup and delete the old lv and create a new one, like here: https://yallalabs.com/linux/how-to-reduce-shrink-t...
But then how to reduce the LVM2_member - /dev/sda2 partition?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question