daemon: Always pass -F option to mkfs.ntfs.

Otherwise it moans about:

  mkfs: ntfs: /dev/sda: /dev/sda is entire device, not just one partition.
  Refusing to make a filesystem here!

This has been happening for a while, so I don't know why we didn't
notice it before.  It even happens on RHEL 6.

A simple reproducer is:

  virt-make-fs -t ntfs any-tarball.tar.gz test.img
This commit is contained in:
Richard W.M. Jones
2014-01-28 18:53:25 +00:00
parent 9015d5ac14
commit 40512c66af

View File

@@ -68,12 +68,15 @@ do_mkfs (const char *fstype, const char *device, int blocksize,
if (extfs)
ADD_ARG (argv, i, "-F");
/* mkfs.ntfs requires the -Q argument otherwise it writes zeroes
* to every block and does bad block detection, neither of which
* are useful behaviour for virtual devices.
/* mkfs.ntfs requires the -Q argument otherwise it writes zeroes to
* every block and does bad block detection, neither of which are
* useful behaviour for virtual devices. Also recent versions need
* to be forced to create filesystems on non-partitions.
*/
if (STREQ (fstype, "ntfs"))
if (STREQ (fstype, "ntfs")) {
ADD_ARG (argv, i, "-Q");
ADD_ARG (argv, i, "-F");
}
/* mkfs.reiserfs produces annoying interactive prompts unless you
* tell it to be quiet.