Force creation of ext2/3/4 and ntfs on whole disk devices (#683643)

Creation of ext2/3/4 and ntfs file systems fails in GParted on whole
disk devices with these errors.

    # mkfs.ext4 -L "" /dev/sdb < /dev/null
    mke2fs 1.42.9 (4-Feb-2014)
    /dev/sdb is entire device, not just one partition!
    Proceed anyway? (y,n)
    # echo $?
    1

    # mkntfs -Q -v -L "" /dev/sdc
    /dev/sdc is entire device, not just one partition.
    Refusing to make a filesystem here!
    # echo $?
    1

Add force flag, -F, to both mkfs commands to make them work.

Bug 683643 - Doesn't properly support partitionless drives.
This commit is contained in:
Phillip Susi 2014-01-03 22:34:46 -05:00 committed by Curtis Gedak
parent db8d964fba
commit 70e17e9388
2 changed files with 4 additions and 8 deletions

View File

@ -218,11 +218,9 @@ bool ext2::write_uuid( const Partition & partition, OperationDetail & operationd
bool ext2::create( const Partition & new_partition, OperationDetail & operationdetail )
{
return ! execute_command( mkfs_cmd + " -L \"" + new_partition.get_filesystem_label() + "\" " +
return ! execute_command( mkfs_cmd + " -F -L \"" + new_partition.get_filesystem_label() + "\" " +
new_partition.get_path(),
operationdetail,
false,
true );
operationdetail, false, true );
}
bool ext2::resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition )

View File

@ -194,11 +194,9 @@ bool ntfs::write_uuid( const Partition & partition, OperationDetail & operationd
bool ntfs::create( const Partition & new_partition, OperationDetail & operationdetail )
{
return ! execute_command( "mkntfs -Q -v -L \"" + new_partition.get_filesystem_label() + "\" " +
return ! execute_command( "mkntfs -Q -v -F -L \"" + new_partition.get_filesystem_label() + "\" " +
new_partition.get_path(),
operationdetail,
false,
true );
operationdetail, false, true );
}
bool ntfs::resize( const Partition & partition_new, OperationDetail & operationdetail, bool fill_partition )