The exit code returned by mkfs is 0 on success and 1 on failure.
In actuality, mkfs is simply a front-end for the various file system builders (mkfs. fstype) available under Linux. The file system-specific builder is searched for in /etc/fs first, then in /etc and finally in the directories listed in the PATH enviroment variable. Please see the file system-specific builder manual pages for further details.