On Sun, Feb 22, 2009 at 5:01 PM, Curtis Gedak <ged...@gmail.com> wrote: >>>> I can already create partitions aligned to 128KiB boundaries. >>>> This creates a first partition of just less than 1GiB, >>>> and the second taking up the remainder of the space >>>> and also using a size that's a multiple of 128KiB: >>>> >>>> dev=file; : > $file >>>> k=1024 m=$(($k*$k)) g=$(($k*$k*$k)) >>>> dd if=/dev/null of=$dev bs=1 seek=32GiB >>>> parted -s $dev mklabel gpt >>>> parted -s $dev u B mkpart primary $((128*$k)) $(($g-1)) >>>> parted -s $dev u B mkpart primary $g $((32*$g - $m - 1)) >>>> parted -s $dev u B p >>>> >>>> Model: (file) >>>> Disk /t/file: 34359738368B >>>> Sector size (logical/physical): 512B/512B >>>> Partition Table: gpt >>>> >>>> Number Start End Size File system Name >>>> Flags >>>> 1 131072B 1073741823B 1073610752B primary >>>> 2 1073741824B 34358689791B 33284947968B primary >>>> >>>> >>>> Now, I think that this functionality >>>> (snap-to-user-specified-or-system-derived-alignment) belongs in gparted, >>>> and not in parted. >>>> >>> >>> Yes, if we propose to add an option to say "tick, I know I have an >>> SSD", but this adds more unnecessary user complexity, when the cost to >>> non-SSDs is so low. >>> >>> What's (at worst) 128KB slack in partition layouts, when we already >>> skip the first 63 sectors anyway? >>> >> >> If that were the only cost, we'd switch right away. >> However, parted's code is very fragile, and changing how it handles >> constraints/alignment seems like it'd be very risky. Why go there >> if it's not absolutely necessary? Besides, the functionality I think >> you want (to make the process convenient or mandatory) belongs in a >> higher-level tool. >> >> If the programmers and tools invoking parted cannot be bothered to >> do a little modulo arithmetic and be aware of alignment, then they >> shouldn't be choosing partition boundaries in the first place. > > Changing GParted to align to boundaries different that the old cylinder > alignment scheme is definitely possible, and probably desirable. This would > provide the alignment performance benefits to a large group of people, and > still allow experts to use tools such as fdisk, or parted to hand craft > their own partition boundaries. > > Since Vista appears to be going to a 1MB boundary, it may be beneficial to > adopt this as the new boundary standard. And since 1 MB is evenly divisible > by 4kB and by 128kB, this should satisfy > current and some potential future performance requirements. I believe this > solution should work well on current hard drives, and solid state drives > too. > > My assumption is that a 1MB boundary would be used for all partition tables, > including MSDOS and GPT. Hence MSDOS would reserve 1MB at the start of the > disk for the boot record, and GPT would do the same. MSDOS would also > reserve 1MB at the front of each logical partition.
The attached and tested patch (against gparted 0.4.3) replaces the 'Round to cylinders' checkbox with 'Round to megabytes' (the 1990s is finally over), though it doesn't indicate why one may select it. Let me know if 'Performance (megabyte) alignment' or such is preferred. I have corrected the incorrect rounding logic, which was passing potentially overlapping partition data to libparted. However, all is not done since libparted's default constraints defeat the alignment, but it does what is needed for the GParted component; I'll look at getting a patch together for libparted. The translations need updating, but this is clear with the updated English strings. Thanks, Daniel commit info: Replace option to perform cylinder-alignment by megabyte-alignment, useful for avoiding performance and longevity loss on storage arrays and SSD disks. Signed-off-by: Daniel J Blueman <daniel.blue...@gmail.com> -- Daniel J Blueman
diff -r c8b47366574d include/Dialog_Base_Partition.h --- a/include/Dialog_Base_Partition.h Mon Feb 23 22:06:31 2009 +0000 +++ b/include/Dialog_Base_Partition.h Mon Feb 23 22:10:08 2009 +0000 @@ -68,7 +68,7 @@ Gtk::HBox hbox_main ; Gtk::SpinButton spinbutton_before, spinbutton_size, spinbutton_after; - Gtk::CheckButton checkbutton_round_to_cylinders ; + Gtk::CheckButton checkbutton_round_to_megabytes ; //used to enable/disable OKbutton... int ORIG_BEFORE, ORIG_SIZE, ORIG_AFTER ; diff -r c8b47366574d include/GParted_Core.h --- a/include/GParted_Core.h Mon Feb 23 22:06:31 2009 +0000 +++ b/include/GParted_Core.h Mon Feb 23 22:10:08 2009 +0000 @@ -38,7 +38,7 @@ void set_user_devices( const std::vector<Glib::ustring> & user_devices ) ; void set_devices( std::vector<Device> & devices ) ; - bool snap_to_cylinder( const Device & device, Partition & partition, Glib::ustring & error ) ; + bool snap_to_alignment( const Device & device, Partition & partition, Glib::ustring & error ) ; bool apply_operation_to_disk( Operation * operation ); bool set_disklabel( const Glib::ustring & device_path, const Glib::ustring & disklabel ) ; diff -r c8b47366574d po/ar.po --- a/po/ar.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/ar.po Mon Feb 23 22:10:08 2009 +0000 @@ -47,7 +47,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "تقريب لمناطق القرص" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/bg.po --- a/po/bg.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/bg.po Mon Feb 23 22:10:08 2009 +0000 @@ -224,7 +224,7 @@ #. checkbutton.. #: ../src/Dialog_Partition_New.cc:34 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Закръгляне към цилиндри" #. TO TRANSLATORS: used as label for a list of choices. Create as: <optionmenu with choices> diff -r c8b47366574d po/ca.po --- a/po/ca.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/ca.po Mon Feb 23 22:10:08 2009 +0000 @@ -44,7 +44,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Arrodoneix a cilindres" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/cs.po --- a/po/cs.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/cs.po Mon Feb 23 22:10:08 2009 +0000 @@ -45,7 +45,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Zaokrouhlit na cylindry" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/de.po --- a/po/de.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/de.po Mon Feb 23 22:10:08 2009 +0000 @@ -42,7 +42,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Auf Zylinder ab-/aufrunden" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/dz.po --- a/po/dz.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/dz.po Mon Feb 23 22:10:08 2009 +0000 @@ -195,7 +195,7 @@ #. checkbutton.. #: ../src/Dialog_Partition_New.cc:34 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "སི་ལིན་ཌརསི་ལུ་སྐོར་ཐེངས།" #. TO TRANSLATORS: used as label for a list of choices. Create as: <optionmenu with choices> diff -r c8b47366574d po/el.po --- a/po/el.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/el.po Mon Feb 23 22:10:08 2009 +0000 @@ -42,7 +42,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Στρογγυλοποίηση σε κυλίνδρους" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/en_CA.po --- a/po/en_CA.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/en_CA.po Mon Feb 23 22:10:08 2009 +0000 @@ -221,8 +221,8 @@ #. checkbutton.. #: ../src/Dialog_Partition_New.cc:34 -msgid "Round to cylinders" -msgstr "Round to cylinders" +msgid "Round to megabytes" +msgstr "Round to megabytes" #. TO TRANSLATORS: used as label for a list of choices. Create as: <optionmenu with choices> #: ../src/Dialog_Partition_New.cc:61 diff -r c8b47366574d po/en_GB.po --- a/po/en_GB.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/en_GB.po Mon Feb 23 22:10:08 2009 +0000 @@ -191,8 +191,8 @@ #. checkbutton.. #: ../src/Dialog_Partition_New.cc:34 -msgid "Round to cylinders" -msgstr "Round to cylinders" +msgid "Round to megabytes" +msgstr "Round to megabytes" #. TO TRANSLATORS: used as label for a list of choices. Create as: <optionmenu with choices> #: ../src/Dialog_Partition_New.cc:66 diff -r c8b47366574d po/es.po --- a/po/es.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/es.po Mon Feb 23 22:10:08 2009 +0000 @@ -47,7 +47,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Redondear al cilindro" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/eu.po --- a/po/eu.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/eu.po Mon Feb 23 22:10:08 2009 +0000 @@ -42,7 +42,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Biribildu zilindroetara" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/fi.po --- a/po/fi.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/fi.po Mon Feb 23 22:10:08 2009 +0000 @@ -41,7 +41,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Pyöristä sylintereihin" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/fr.po --- a/po/fr.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/fr.po Mon Feb 23 22:10:08 2009 +0000 @@ -47,7 +47,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Arrondir aux cylindres" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/gl.po --- a/po/gl.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/gl.po Mon Feb 23 22:10:08 2009 +0000 @@ -44,7 +44,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Redondear ao cilindro" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/gu.po --- a/po/gu.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/gu.po Mon Feb 23 22:10:08 2009 +0000 @@ -46,7 +46,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "સિલિન્ડરોનું ગોળ" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/he.po --- a/po/he.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/he.po Mon Feb 23 22:10:08 2009 +0000 @@ -187,7 +187,7 @@ #. checkbutton.. #: ../src/Dialog_Partition_New.cc:34 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "" #. TO TRANSLATORS: used as label for a list of choices. Create as: <optionmenu with choices> diff -r c8b47366574d po/hu.po --- a/po/hu.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/hu.po Mon Feb 23 22:10:08 2009 +0000 @@ -41,7 +41,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Kerekítés cilinderekre" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/it.po --- a/po/it.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/it.po Mon Feb 23 22:10:08 2009 +0000 @@ -44,7 +44,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Arrotondare ai cilindri" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/ja.po --- a/po/ja.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/ja.po Mon Feb 23 22:10:08 2009 +0000 @@ -191,7 +191,7 @@ #. checkbutton.. #: ../src/Dialog_Partition_New.cc:34 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "シリンダ単位に丸める" #. TO TRANSLATORS: used as label for a list of choices. Create as: <optionmenu with choices> diff -r c8b47366574d po/ko.po --- a/po/ko.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/ko.po Mon Feb 23 22:10:08 2009 +0000 @@ -187,7 +187,7 @@ #. checkbutton.. #: ../src/Dialog_Partition_New.cc:34 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "실린더 단위로 반올림" #. TO TRANSLATORS: used as label for a list of choices. Create as: <optionmenu with choices> diff -r c8b47366574d po/lt.po --- a/po/lt.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/lt.po Mon Feb 23 22:10:08 2009 +0000 @@ -46,7 +46,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Apvalinti iki cilindro" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/lv.po --- a/po/lv.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/lv.po Mon Feb 23 22:10:08 2009 +0000 @@ -198,7 +198,7 @@ #. checkbutton.. #: ../src/Dialog_Partition_New.cc:34 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Noapaļot līdz cilindriem" #. TO TRANSLATORS: used as label for a list of choices. Create as: <optionmenu with choices> diff -r c8b47366574d po/mk.po --- a/po/mk.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/mk.po Mon Feb 23 22:10:08 2009 +0000 @@ -192,7 +192,7 @@ #. checkbutton.. #: ../src/Dialog_Partition_New.cc:34 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Кружи до цилиндрите" #. TO TRANSLATORS: used as label for a list of choices. Create as: <optionmenu with choices> diff -r c8b47366574d po/nb.po --- a/po/nb.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/nb.po Mon Feb 23 22:10:08 2009 +0000 @@ -183,7 +183,7 @@ #. checkbutton.. #: ../src/Dialog_Partition_New.cc:34 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "" #. TO TRANSLATORS: used as label for a list of choices. Create as: <optionmenu with choices> diff -r c8b47366574d po/ne.po --- a/po/ne.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/ne.po Mon Feb 23 22:10:08 2009 +0000 @@ -191,7 +191,7 @@ #. checkbutton.. #: ../src/Dialog_Partition_New.cc:34 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "बेलनाकारको वरिपरि" #. TO TRANSLATORS: used as label for a list of choices. Create as: <optionmenu with choices> diff -r c8b47366574d po/nl.po --- a/po/nl.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/nl.po Mon Feb 23 22:10:08 2009 +0000 @@ -233,7 +233,7 @@ # afronden op cylinders/afronden op de cylinder #. checkbutton.. #: ../src/Dialog_Partition_New.cc:34 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Afronden op cylinders" #. TO TRANSLATORS: used as label for a list of choices. Create as: <optionmenu with choices> diff -r c8b47366574d po/oc.po --- a/po/oc.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/oc.po Mon Feb 23 22:10:08 2009 +0000 @@ -185,7 +185,7 @@ #. checkbutton.. #: ../src/Dialog_Partition_New.cc:34 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "" #. TO TRANSLATORS: used as label for a list of choices. Create as: <optionmenu with choices> diff -r c8b47366574d po/pa.po --- a/po/pa.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/pa.po Mon Feb 23 22:10:08 2009 +0000 @@ -191,7 +191,7 @@ #. checkbutton.. #: ../src/Dialog_Partition_New.cc:34 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "ਸਿਲੰਡਰਾਂ ਲਈ ਪੂਰਾ ਕਰੋ" #. TO TRANSLATORS: used as label for a list of choices. Create as: <optionmenu with choices> diff -r c8b47366574d po/pl.po --- a/po/pl.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/pl.po Mon Feb 23 22:10:08 2009 +0000 @@ -48,7 +48,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Zaokrąglenie do cylindrów" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/pt_BR.po --- a/po/pt_BR.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/pt_BR.po Mon Feb 23 22:10:08 2009 +0000 @@ -45,7 +45,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Arredondar para cilindros" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/ru.po --- a/po/ru.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/ru.po Mon Feb 23 22:10:08 2009 +0000 @@ -186,7 +186,7 @@ #. checkbutton.. #: ../src/Dialog_Partition_New.cc:34 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Округлить до цилиндров" #. TO TRANSLATORS: used as label for a list of choices. Create as: <optionmenu with choices> diff -r c8b47366574d po/si.po --- a/po/si.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/si.po Mon Feb 23 22:10:08 2009 +0000 @@ -188,7 +188,7 @@ #. checkbutton.. #: ../src/Dialog_Partition_New.cc:34 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "" #. TO TRANSLATORS: used as label for a list of choices. Create as: <optionmenu with choices> diff -r c8b47366574d po/sk.po --- a/po/sk.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/sk.po Mon Feb 23 22:10:08 2009 +0000 @@ -41,7 +41,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Zaokrúhliť na cylindre" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/sl.po --- a/po/sl.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/sl.po Mon Feb 23 22:10:08 2009 +0000 @@ -194,7 +194,7 @@ #. checkbutton.. #: ../src/Dialog_Partition_New.cc:34 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Zaokroži na cilindre" #. TO TRANSLATORS: used as label for a list of choices. Create as: <optionmenu with choices> diff -r c8b47366574d po/sv.po --- a/po/sv.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/sv.po Mon Feb 23 22:10:08 2009 +0000 @@ -42,7 +42,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Avrunda till cylindrar" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/th.po --- a/po/th.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/th.po Mon Feb 23 22:10:08 2009 +0000 @@ -43,7 +43,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "ปัดเศษให้เป็นไซลินเดอร์เต็ม" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/tr.po --- a/po/tr.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/tr.po Mon Feb 23 22:10:08 2009 +0000 @@ -221,7 +221,7 @@ #. checkbutton.. #: ../src/Dialog_Partition_New.cc:34 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Silindirlere yuvarla" #. TO TRANSLATORS: used as label for a list of choices. Create as: <optionmenu with choices> diff -r c8b47366574d po/uk.po --- a/po/uk.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/uk.po Mon Feb 23 22:10:08 2009 +0000 @@ -43,7 +43,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Округлити до цилідрів" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/vi.po --- a/po/vi.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/vi.po Mon Feb 23 22:10:08 2009 +0000 @@ -199,7 +199,7 @@ #.checkbutton.. #: ../src/Dialog_Partition_New.cc:34 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "Tròn thành hình trụ" #.TO TRANSLATORS: used as label for a list of choices. Create as: <optionmenu with choices> diff -r c8b47366574d po/zh_HK.po --- a/po/zh_HK.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/zh_HK.po Mon Feb 23 22:10:08 2009 +0000 @@ -40,7 +40,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "最接近的磁柱" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d po/zh_TW.po --- a/po/zh_TW.po Mon Feb 23 22:06:31 2009 +0000 +++ b/po/zh_TW.po Mon Feb 23 22:10:08 2009 +0000 @@ -40,7 +40,7 @@ #. add checkbutton #: ../src/Dialog_Base_Partition.cc:82 -msgid "Round to cylinders" +msgid "Round to megabytes" msgstr "最接近的磁柱" #: ../src/Dialog_Base_Partition.cc:169 diff -r c8b47366574d src/Dialog_Base_Partition.cc --- a/src/Dialog_Base_Partition.cc Mon Feb 23 22:06:31 2009 +0000 +++ b/src/Dialog_Base_Partition.cc Mon Feb 23 22:10:08 2009 +0000 @@ -79,9 +79,9 @@ before_value = spinbutton_before .get_value() ; //add checkbutton - checkbutton_round_to_cylinders .set_label( _("Round to cylinders") ) ; - checkbutton_round_to_cylinders .set_active( true ) ; - table_resize.attach( checkbutton_round_to_cylinders, 0, 1, 3, 4 ) ; + checkbutton_round_to_megabytes .set_label( _("Round to megabytes") ) ; + checkbutton_round_to_megabytes .set_active( true ) ; + table_resize.attach( checkbutton_round_to_megabytes, 0, 1, 3, 4 ) ; //connect signalhandlers of the spinbuttons if ( ! fixed_start ) @@ -149,8 +149,8 @@ if ( selected_partition .sectors_used != -1 ) selected_partition .sectors_unused = selected_partition .get_length() - selected_partition .sectors_used ; - //set indicator of whether to use strict sector values, or to round to cylinders - selected_partition .strict = ! checkbutton_round_to_cylinders .get_active() ; + //set indicator of whether to use strict sector values, or to round to megabytes + selected_partition .strict = ! checkbutton_round_to_megabytes .get_active() ; return selected_partition ; } diff -r c8b47366574d src/Dialog_Partition_New.cc --- a/src/Dialog_Partition_New.cc Mon Feb 23 22:06:31 2009 +0000 +++ b/src/Dialog_Partition_New.cc Mon Feb 23 22:10:08 2009 +0000 @@ -205,8 +205,8 @@ part_temp .logicals .push_back( UNALLOCATED ) ; } - //set indicator of whether to use strict sector values, or to round to cylinders - part_temp .strict = ! checkbutton_round_to_cylinders .get_active() ; + //set indicator of whether to use strict sector values, or to round to megabytes + part_temp .strict = ! checkbutton_round_to_megabytes .get_active() ; return part_temp; } @@ -238,12 +238,7 @@ { fs = FILESYSTEMS[ optionmenu_filesystem .get_history() ] ; - if ( checkbutton_round_to_cylinders .get_active() ) - { - if ( fs .MIN < cylinder_size ) - fs .MIN = cylinder_size ; - } - else if ( fs .MIN < MEBIBYTE ) + if ( fs .MIN < MEBIBYTE ) fs .MIN = MEBIBYTE ; if ( selected_partition .get_length() < fs .MIN ) diff -r c8b47366574d src/GParted_Core.cc --- a/src/GParted_Core.cc Mon Feb 23 22:06:31 2009 +0000 +++ b/src/GParted_Core.cc Mon Feb 23 22:10:08 2009 +0000 @@ -293,7 +293,7 @@ return thread_status_message ; } -bool GParted_Core::snap_to_cylinder( const Device & device, Partition & partition, Glib::ustring & error ) +bool GParted_Core::snap_to_alignment( const Device & device, Partition & partition, Glib::ustring & error ) { if ( ! partition .strict ) { @@ -306,30 +306,20 @@ // logical partition (usually 63 sectors), and // (B) the Master Boot Record sector and the next track of the first // primary partition - diff = (partition .sector_start - device .sectors) % device .cylsize ; + diff = (partition .sector_start - device .sectors) % MEBIBYTE ; } else if ( partition.sector_start == 34 ) { // (C) the GUID Partition Table (GPT) and the start of the data // partition at sector 34 - diff = (partition .sector_start - 34 ) % device .cylsize ; + diff = (partition .sector_start - 34 ) % MEBIBYTE ; } else { - diff = partition .sector_start % device .cylsize ; + diff = partition .sector_start % MEBIBYTE ; } if ( diff ) - { - if ( diff < ( device .cylsize / 2 ) ) - partition .sector_start -= diff ; - else - partition .sector_start += (device .cylsize - diff ) ; - } + partition .sector_start += MEBIBYTE - diff ; - diff = (partition .sector_end +1) % device .cylsize ; + diff = partition .sector_end % MEBIBYTE ; if ( diff ) - { - if ( diff < ( device .cylsize / 2 ) ) - partition .sector_end -= diff ; - else - partition .sector_end += (device .cylsize - diff ) ; - } + partition .sector_end -= diff ; if ( partition .sector_start < 0 ) partition .sector_start = 0 ; diff -r c8b47366574d src/Win_GParted.cc --- a/src/Win_GParted.cc Mon Feb 23 22:06:31 2009 +0000 +++ b/src/Win_GParted.cc Mon Feb 23 22:10:08 2009 +0000 @@ -653,7 +653,7 @@ if ( operation ->type == OPERATION_DELETE || operation ->type == OPERATION_FORMAT || operation ->type == OPERATION_CHECK || - gparted_core .snap_to_cylinder( operation ->device, operation ->partition_new, error ) ) + gparted_core .snap_to_alignment( operation ->device, operation ->partition_new, error ) ) { operation ->create_description() ;
_______________________________________________ parted-devel mailing list parted-devel@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/parted-devel