2

I have a centos 7 machine and am trying to mount an xfs parition with a 4096 kb block size. when the xfs patition is unmounted:

 blockdev --getbsz  /dev/xvdc
4096

when mounting using

 mount -t xfs    -o   noatime /dev/xvdc /iops2

the mount operation works but I get this output afterwards:

 blockdev --getbsz  /dev/xvdc
512

I tried mounting using the following options which as I understand are supposed to explicitly state the desired blocksize (12 representing 2^12 bytes as specified in this doc http://linuxcommand.org/man_pages/mount8.html under xfs options):

mount -t xfs -o biosize=12 /dev/xvdc /iops2

and got this error:

mount: wrong fs type, bad option, bad superblock on /dev/xvdc,
       missing codepage or helper program, or other error

I went ahead and tried

mount -t xfs    -o   biosize=13 /dev/xvdc /iops2

which resulted in a succesful mounting, but still checking the blocksize resulted with wrong blocksize

 blockdev --getbsz  /dev/xvdc
512

If anyoine knows what causes this or at least how to fix it I'll be happy to see the solution.

  • What is the problem? The blocks are likely aligned, as they are by default. Note that the xfs block size is a different thing, `xfs_info` to display it. – John Mahowald Mar 21 '17 at 05:47
  • 1
    Possible duplicate of [blockdev report different blocksize if mounted](http://serverfault.com/questions/776609/blockdev-report-different-blocksize-if-mounted) – iwaseatenbyagrue Mar 21 '17 at 09:09

1 Answers1

-2

this is due to a small sector size. try this mkfs.xfs -s size=4096 -b size=4096 -f /dev/xvdc

  • 1
    OP is trying to mount an existing file system. You usually don't want to run `mkfs` on those ... – Sven Mar 21 '17 at 07:52
  • there is no way to change the sector size of an existing file system without harming data. in order to manage to mount the fs with the exisiing data he should either copy the data to a new file system with the proper sector size or make a backup of these files. – user3371266 Mar 21 '17 at 09:07