0

I have seen an experimental linux box where

lvreduce -rL -10G /dev/main/repository  

worked without unmounting (i.e. even on root,home dir etc), but it does not on my server install

  • debian squeeze
  • LVM version: 2.02.111(2) (2014-09-01)
  • Library version: 1.02.90 (2014-09-01)
  • Driver version: 4.27.0
  • Linux kernel: 3.16.0-4-amd64
  • filesystem: ext3

what it the version combination which allows it?

PS: I tried to browse release notes of lvm but to no avail.

0

2 Answers 2

0

The command you issued will not reduce your LV, rather it will grow the LV by 10GB, concurrently expanding its filesystem.

Shrink/reduce a LV is a much more delicate operation, as you need to be absolutely sure that the filesystem inside the to-be-shrink volume does not overflow the new volume limit. For filesystems which do not support shrinking (eg: xfs), you can not resize the LV at all.

Anyway, what exact error/log do you have when executing your command?

EDIT

ok, you are really speaking about growing the LV. On-line filesystem resize is a long-time supported features in pretty much any kernels. Can you post the log of your command? Please also add the output of pvs, vgs and lvs

2
  • Yes it is a mistake in the question, sorry. I made the correction. I also added information about filesystem used (ext3). Thanks.
    – gorn
    Feb 22, 2016 at 15:41
  • It is asking whether it should umnount the system and when I say now it refuses to continue. If the exact workding is needed I can paste it here.
    – gorn
    Feb 22, 2016 at 15:43
0

Versions you have should allow that.

I suspect the problem that you've done lvextend which extended the lvm volume but you have not extended your filesystem. So that there's a limited size filesystem lives on larger device now.

You should be able to resize your filesystem via resize2fs /dev/main/repository ( resize4fs /dev/main/repository, xfsgrow /dev/main/repository or something like that for other filesystems).

3
  • I am aware of the fact, that it can be done in two steps - resizind the fs first and than reducing the logical volume. But the question holds - can it be done on mounted drive. (I know it can, but under which versions).
    – gorn
    Feb 22, 2016 at 15:44
  • As I said - your versions are definitely fine. It's been there for years and your system is relatively fresh.
    – rvs
    Feb 22, 2016 at 17:22
  • I did not use lvextend, I am using lvreduce - it was mistake in the question, but I corrected that already. So it is mystery, because lvreduce just asks to unmount the disk giving no chance to go around it. I will update the question with the complete communication on terminal.
    – gorn
    Feb 24, 2016 at 10:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .