5

I have a 7.9 TB logical volume formatted with XFS filesystem. I have 8 1 TB RAID devices as physical volumes, and 1 volume group that contains all of these devices. I have 2.5 TB free space on my logical volume. I'd like to remove 2 of the 1 TB devices from the volume group since I don't "need" them anymore. Reading the man page of pvmove, it seems like I would need to create at least 5.5 TB of space and pvmove everything from the current 1 TB volumes onto the new volumes, and then remove all 8 of the original volumes from the logical volume. This seems onerous. Any suggestions?

5

There's no problem on the LVM side. Use lvreduce to shrink a volume group; obviously, if there's a filesystem on it, you mustn't shrink it below the size of the filesystem. Then use pvmove to shuffle extents around: pvmove /dev/sdz42 removes extents from the physical volume /dev/sdz42 to other physical volumes in the same volume group, after which you can decommission the physical volume with vgreduce.

However this is moot since you have an XFS filesystem, and XFS does not support shrinking. I'm afraid you'll have to move the data off and remake the filesystem (and thus you can be completely unsubtle with LVM).

1
  • Gilles, excellent, I just did not get the correct workflow! lvreduce does exactly what is required... and now I see that I have really hurt myself with XFS. – Steve Jul 7 '11 at 7:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.