[gparted] Force creation of ext2/3/4 and ntfs on whole disk devices (#683643)
- From: Curtis Gedak <gedakc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gparted] Force creation of ext2/3/4 and ntfs on whole disk devices (#683643)
- Date: Mon, 9 Mar 2015 17:11:16 +0000 (UTC)
commit 70e17e938860702fd929a4ff2ad93ef89f8a086b
Author: Phillip Susi <psusi ubuntu com>
Date: Fri Jan 3 22:34:46 2014 -0500
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.
src/ext2.cc | 6 ++----
src/ntfs.cc | 6 ++----
2 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/src/ext2.cc b/src/ext2.cc
index f4147aa..591d04c 100644
--- a/src/ext2.cc
+++ b/src/ext2.cc
@@ -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 )
diff --git a/src/ntfs.cc b/src/ntfs.cc
index e25e0a3..5628b43 100644
--- a/src/ntfs.cc
+++ b/src/ntfs.cc
@@ -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 )
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]