Linux – xfs_growfs error: maximum is 18350080

debianlinuxxfs

I have a 70 GB filesystem mounted from a loopback file that needed more space. I increased the size of the file from 75161928000 to 75200000000 (starting conservative) via

sudo truncate -s 75170000000 preproduction-7.1.1.xfs

But attempting to grow the xfs filesystem with just "xfs_growfs /mnt/doc.neu/" had no effect, with the "-d" flag it returned "data size unchanged, skipping", and using the -D flag just adding one block to it, it says it's too large

$ sudo xfs_growfs -D 18350081 /mnt/doc.neu/
meta-data=/dev/loop0             isize=256    agcount=5, agsize=3932160 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=18350080, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal               bsize=4096   blocks=7680, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data size 18350081 too large, maximum is 18350080

Am I missing something?

Best Answer

If you are using losetup you need to use

losetup -c /dev/loopX

to have the block device's size updated to the size of the file backing it. From the manpage:

-c, --set-capacity loopdev
force loop driver to reread size of the file associated with the specified loop device