-1

I have a ~250 TB Xfs file system, distributed across several disks (PVs) via LVM.

I've moved most of the data to another server. The remaining data (~60 TB) would easily fit on just PV.

I would like to decommission all but one disk in my VG. The trouble is my LV is an Xfs, and Xfs filesystem shrinking is unsupported. So no matter how “empty” the filesystem is, I can’t use pvmove to take extents off the PV, because it’s still being “used” by free space in Xfs, and thus can’t vgreduce it.

All the tutorials on how to do this, e.g. https://yallalabs.com/linux/how-to-reduce-shrink-the-size-of-a-lvm-partition-formatted-with-xfs-filesystem/ , boil down to "back up your data, reformat, restore".

Is that truly the only option?

Daniel
  • 2,032
  • 5
  • 21
  • 27
  • I found https://github.com/cosmos72/fstransform but suspect nobody has ever tested xfs to ext4 (which is shrinkable) with a filesystem even remotely the size of mine. – Daniel Dec 21 '21 at 14:07

1 Answers1

0

I have tried this for xfs long back. Don't have commands handy, but did below:

  1. Take backup of current XFS file system
  2. Remove the LV
  3. Create new LV with required size
  4. Restore the XFS backup
Niraj Nandane
  • 1,318
  • 1
  • 13
  • 24