mkfs.xfs on Debian

Software

FreeBSD has newfs for baking UFS volumes, with a handy newfs_msdos shortcut for formatting FAT. mkfs has equivalent shortcuts on Linux for the file systems it supports, as shown by the following tab completion on Debian Stretch:

# mkfs<TAB>  
==> mkfs      mkfs.cramfs  mkfs.ext3  mkfs.minix
==> mkfs.bfs  mkfs.ext2    mkfs.ext4

Minix, that’s so cool! But what if we want xfs?

# apt-get install xfsprogs

Or for those who really know what they’re doing:

- name: "Install xfs tooling"
  apt:
    name: xfsprogs
    state: latest
    update_cache: yes

And now we can bake a new xfs volume:

# whereis mkfs.xfs
==> /sbin/mkfs.xfs

Author bio and support

Me!

Ruben Schade is a technical writer and IaaS engineer in Sydney, Australia who refers to himself in the third person in bios. Wait, not BIOS… my brain should be EFI by now.

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite cloud infrastructure provider.

You can leave me a comment by contacting me, and I might publish your thoughts. Please read the FAQs first though.

If you found this post helpful or entertaining, you can shout me a coffee or buy some silly merch. Thanks!