How To Troubleshoot the mkfs.ext4 Utility

Scenario / Goal: You are trying to add a hard drive (or new storage) to a Linux server.  You want the drive usable.  You attach the drive and use fdisk.  Now you want to use mkfs to create a file system on it.

Problem: You are trying to use mkfs.ext4 but you get this error:  "mkfs.ext4 no such file or directory while trying to determine filesystem size." 

Root cause: Wrong /dev/xxx argument.  This error message is misleading.

Use "cat /proc/partitions" to find the potential /dev/sdx options to choose from.  Then try your mkfs.ext4 command using a /dev/ item in the results of "cat /proc/partitions".  The problem should go away.

Leave a comment

Your email address will not be published. Required fields are marked *