2

I set up a new server last week, did some testing with different mkfs.xfs options on mdadm raid5, i finally found some statisfying mkfs options.
Now i am about to set up a new server having exactly the same disk setup
Unfortunately i did not write down the mkfs.xfs options i was using the last time, so here is my question:

Is there a way to get the mkfs.xfs options used from a running (and currently mounted) xfs filesystem?

5

The command xfs_info will give you something close to that. It'll dump the XFS attributes for a given file-system, which you can then map to mkfs.xfs command-options. It doesn't give you the exact flags used, but with enough parsing of the man-page you can recreate the options used for a pre-existing file-system.

meta-data=/dev/mapper/LVMStuff-Wibble isize=256    agcount=6, agsize=2621440 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=15728640, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal               bsize=4096   blocks=5120, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

A lot of these are defaults, though the value of some defaults changes with kernel and mkfs versions.

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.