0

I am trying to setup a new xfs filesystem in Debian 9/stretch. My kernel version is 4.9.0-3-amd64.

For that I installed the package xfsprogs, and initialised the new partition with:

mkfs.xfs /dev/sdb1

I also defined the /etc/fstab line to mount it as:

/dev/sdb1   /srv      xfs   defaults    0   2

However, when trying to mount it, either with mount -a or mount /srv, it does not mount, and gives back the following error:

mount: unknown filesystem type 'xfs'

As I noticed the post-install scripts of xfsprogs had regenerated the initrd file, I took the shortcut of rebooting the server, with pretty much the same results.

What can I do?

2

Add to /etc/modules the xfs module, so in the next boot it will be loaded as in:

xfs

Also, to load it in runtime do:

sudo modprobe xfs

After that, mount -a worked and mounted the /srv partition successfully.

To double-check it is mounted:

$ mount -t xfs
/dev/sdb1 on /srv type xfs (rw,relatime,attr2,inode64,noquota)

The partition was also mounted automatically after a reboot, and it can be check the xfs module was loaded:

$lsmod | grep xfs
xfs                  1208320  1
libcrc32c              16384  1 xfs
  • This shouldn't be necessary. The kernel is capable of loading filesystem driver modules automatically. – Gilles Sep 1 '17 at 22:13
  • @Gilles I suspected so. Will have to have a look at that initrd, I think – Rui F Ribeiro Sep 2 '17 at 1:02
  • 2
    The initrd shouldn't matter. Having xfs.ko in the initrd is only necessary if the root filesystem is xfs. This is the general process for automatic module loading. In your case one of the steps fails. Check /lib/modules/$(uname -r)/modules.alias and the system logs. – Gilles Sep 2 '17 at 8:52
  • @Gilles That dawned me later on, thanks. Will have to do some testing in my standard VM. – Rui F Ribeiro Sep 2 '17 at 8:59

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.