15

I have an xfs filesystem that has some free space. Can I shrink it? I know of xfs_growfs. And there is resize2fs and resize_reiserfs.

Side question: is xfs not a good filesystem choice for bulk longterm file storage?

Paul Tarjan
  • 559
  • 3
  • 8
  • 17

1 Answers1

28

You can make a backup, and then create a new smaller file system and restore.

XFS cannot be shrunk (ref).

Zoredache
  • 128,755
  • 40
  • 271
  • 413
  • 1
    +1 - there were some patches adding support for shrinking a filesystem, but they seem to have stalled now – James Dec 08 '09 at 09:23
  • 1
    For RedHat (and CentOS) users, see RedHat's [article 540013](https://access.redhat.com/solutions/540013). – Franklin Piat Sep 30 '15 at 09:19
  • 2
    Some documentation about XFS backup/dump/restore [XFS Dump and Restore](http://xfs.org/docs/xfsdocs-xml-dev/XFS_User_Guide/tmp/en-US/html/xfs-dump-and-restore.html), and [Red Hat 6 documentation](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/xfsbackuprestore.html) – Franklin Piat Sep 30 '15 at 09:28
  • 4
    @FranklinPiat, that Red Hat article requires a subscription for access. – Kevin Feb 21 '17 at 21:42