Explanation bug in mkfs xfs Filesystem mkfs from util-linux 2.26.2

Bug #1535137 reported by Stephan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

mkfs from util-linux 2.26.2

during an exercise with creating xfs partitions on a Ubuntu 15.10 64 Bit virtual machine,
I guess I found a bug.

Explanation:
When creating an xfs filesystem on a partition with a existing gpt table, the mkfs command return an error message
with the advice to force the command to run by using the -f option (lowercase f)

However, it wont work and as you can see at my bash text, the command tells me that -f (lowercase f) is an invalid option.
I read the manpages of mkfs to determine what should be the correct option. Even here, the -f (lowercase f) is mentioned.

  -f Force overwrite when an existing filesystem is detected on the device. By default, mkfs.xfs will not write to the device if it suspects that there is a filesystem or partition table on the device already.

So I tried the uppercase F (-F) to FORCE the command to overwrite everything which worked !
So there are 2 possibilities:
#1 I am to dump to use a -f properly
#2 The texts (man pages and stderr)are wrong written and should be replaced with a uppercase F.

root@ubuntu:/mnt# mkfs -t xfs /dev/sdb2
mkfs.xfs: /dev/sdb2 appears to contain a partition table (gpt).
mkfs.xfs: Use the -f option to force overwrite.
root@ubuntu:/mnt# mkfs -tf xfs /dev/sdb2
mkfs: failed to execute mkfs.f: No such file or directory
root@ubuntu:/mnt# mkfs -t -f xfs /dev/sdb2
mkfs: failed to execute mkfs.-f: No such file or directory
root@ubuntu:/mnt# mkfs -f -t xfs /dev/sdb2
mkfs.ext2: invalid option -- 'f'

root@ubuntu:/mnt# mkfs -F -t xfs /dev/sdb2
mke2fs 1.42.12 (29-Aug-2014)
Found a gpt partition table in /dev/sdb2

Your mke2fs.conf file does not define the xfs filesystem type.
Creating filesystem with 512000 1k blocks and 128016 inodes
Filesystem UUID: 216b73d3-d57e-49b4-a288-b1a0ac9a5ce6
Superblock backups stored on blocks:
    8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409

Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done

Please give a feedback if my observation is correct or wrong.

With best regards

Stephan H. Wenderlich

Revision history for this message
Phillip Susi (psusi) wrote :

Your confusion is due to the difference between mkfs and mkfs.xfs. The latter wants you to pass it the -f, but to the former, this is an invalid option. The -f must follow the -t xfs so that mkfs does not interpret it and only passes it to mkfs.xfs.

Changed in util-linux (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.