[parted-devel] [Resend][PATCH] Prefer DOS partition table over MAC

Phillip Susi phill at thesusis.net
Wed Apr 24 21:05:29 BST 2019


Most live cds these days use a hybrid DOS/ISO/MAC image.  When written
to a USB stick it then causes parted to complain that the sector size
is supposed to be 2k according to the MAC table, but is 512 bytes.
Fix this by probing the DOS partition table first and using that.
---
 NEWS                  | 3 +++
 libparted/libparted.c | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 45ea91c5..30a8d772 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,9 @@ GNU parted NEWS                                    -*- outline -*-
 
 ** Bug Fixes
 
+  Recognize DOS partition tables before MAC to avoid confusion with
+  hybrid ISO/DOS/MAC images that most live cds use.
+
   Fix atari disklabel false positives by probing other labels first.
 
   Fix resizepart to adjust the end to be -1 sector when using iec
diff --git a/libparted/libparted.c b/libparted/libparted.c
index e5178751..645ccd27 100644
--- a/libparted/libparted.c
+++ b/libparted/libparted.c
@@ -91,8 +91,8 @@ init_disk_types ()
 #ifdef ENABLE_PC98
 	ped_disk_pc98_init ();
 #endif
-	ped_disk_msdos_init ();
 	ped_disk_mac_init ();
+	ped_disk_msdos_init (); /* probe before mac since mac has some false positives */
 	ped_disk_gpt_init ();
 	ped_disk_dvh_init ();
 	ped_disk_bsd_init ();
-- 
2.17.1




More information about the parted-devel mailing list