mkfs: failed to execute mkfs.vfat: No such file or directory

This problem occurs because there is no mkfs.vfat utility in the system:

sudo mkfs.vfat /dev/sdc1
mkfs.vfat: No such file or directory

Or we can call this utility through mkfs, passing it as a parameter:

sudo mkfs -t vfat /dev/sdc1
mkfs: failed to execute mkfs.vfat: No such file or directory

Then mkfs utility will read the parameter and transfer control to mkfs.vfat utility. So, mkfs.vfat command is a direct way to call this utility.

Install dosfstools package

To get mkfs.fat utility in the system need to install dosfstools package

sudo apt update
sudo apt install dosfstools

Then mkfs.vfat will appear in /sbin/ directory, as you can see mkfs.vfat is just a symlink to mkfs.fat on my system:

ls -l /sbin/ | grep mkfs
mkfs.vfat -> mkfs.fat
mkfs.vfat utility in dosfstools package in Debian repository
dosfstools package contents. Here is mkfs.vfat utility.

How to check all available mkfs utilities in system

This is possible by typing sudo mkfs. and then pressing <Tab> for two times:

sudo mkfs.<Press Tab><Press Tab>
mkfs.bfs     mkfs.cramfs  mkfs.ext2    mkfs.ext3    mkfs.ext4    mkfs.fat     mkfs.minix   mkfs.msdos   mkfs.vfat
Updated: May 3, 2019 — 7:20 am

Leave a Reply

Your email address will not be published.