You wipe out any existing files on the partition when you create a filesystem, so it always pays to think twice about your filesystem related commands before you press that Enter key!
Even though you have your choice of many different filesystems, the commands to create them are fairly consistent. The mkfs command is a front end for these individual programs that create filesystems. The mkfs command, when used with the -t fstype option, calls the mkfs.fstype program to make the actual filesystem. Here’s an example:
mkfs –t ext4 /dev/sdb1
This command executes the mkfs program, supplying the type of ext4, which in turn executes the mkfs.ext4 program against the target partition, creating an Ext4 filesystem. ...