aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoderick W. Smith <rodsmith@rodsbooks.com>2015-04-24 21:39:20 -0400
committerRoderick W. Smith <rodsmith@rodsbooks.com>2015-04-24 21:39:20 -0400
commit8017e083aac6377e95170d520184c1834e9021a4 (patch)
tree40640b48f0dc5de0ddabe4ab370bb33aa13aa7ca
parent54f8fb17e64e09ca508d266356d9c6fd34a4fd4c (diff)
downloadgptfdisk-8017e083aac6377e95170d520184c1834e9021a4.tar.gz
Changed -z and -Z behavior in sgdisk so that subsequent changes are
written even if -g is not included. Also some man page updates.
-rw-r--r--NEWS15
-rw-r--r--cgdisk.813
-rw-r--r--gdisk.816
-rw-r--r--gptcl.cc11
-rw-r--r--sgdisk.815
5 files changed, 45 insertions, 25 deletions
diff --git a/NEWS b/NEWS
index 3d33cb3..cd7b904 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,18 @@
+1.0.1 (?/??/2015):
+------------------
+
+- Edited man pages to clarify that default alignment is to 1MiB boundaries;
+ this translates to 2048 sectors on disks with 512-byte sectors, but it
+ will be something else on disks with other sector sizes.
+
+- Changed behavior of -z/--zap and -Z/--zap-all options to sgdisk so that
+ if a subsequent command causes changes, they'll be written to disk.
+ Previously, doing something like "sgdisk --zap-all --clear /dev/sdd"
+ would wipe the disk but not create a partition table; to create a blank
+ table you'd need to do "sgdisk --zap-all --clear --mbrtogpt /dev/sdd",
+ which is a bit odd and counter-intuitive, to the point of arguably being
+ a bug.
+
1.0.0 (3/16/2015):
------------------
diff --git a/cgdisk.8 b/cgdisk.8
index 8f7dc9b..5a18bcb 100644
--- a/cgdisk.8
+++ b/cgdisk.8
@@ -181,12 +181,13 @@ Change the sector alignment value. Disks with more logical sectors than
physical sectors (such as modern Advanced Format drives), some RAID
configurations, and many SSD devices, can suffer performance problems if
partitions are not aligned properly for their internal data structures. On
-new disks, GPT fdisk attempts to align partitions on 2048\-sector (1MiB)
-boundaries by default, which optimizes performance for all of these disk
-types. On pre\-partitioned disks, GPT fdisk attempts to identify the
-alignment value used on that disk, but will set 8-sector alignment on disks
-larger than 300 GB even if lesser alignment values are detected. In either
-case, it can be changed by using this option.
+new disks, GPT fdisk attempts to align partitions on 1MiB boundaries
+(2048\-sectors on disks with 512-byte sectors) by default, which optimizes
+performance for all of these disk types. On pre\-partitioned disks, GPT
+fdisk attempts to identify the alignment value used on that disk, but will
+set 8-sector alignment on disks larger than 300 GB even if lesser alignment
+values are detected. In either case, it can be changed by using this
+option.
.TP
.B Backup
diff --git a/gdisk.8 b/gdisk.8
index c5d44f3..b9dd330 100644
--- a/gdisk.8
+++ b/gdisk.8
@@ -212,7 +212,8 @@ sector.
.B o
Clear out all partition data. This includes GPT header data,
all partition definitions, and the protective MBR. The sector alignment
-is reset to the default (2048 sectors, or 1MB).
+is reset to the default (1MB, or 2048 sectors on a disk with 512-byte
+sectors).
.TP
.B p
@@ -470,12 +471,13 @@ Change the sector alignment value. Disks with more logical sectors per
physical sectors (such as modern Advanced Format drives), some RAID
configurations, and many SSD devices, can suffer performance problems if
partitions are not aligned properly for their internal data structures. On
-new disks, GPT fdisk attempts to align partitions on 2048\-sector (1MiB)
-boundaries by default, which optimizes performance for all of these disk
-types. On pre\-partitioned disks, GPT fdisk attempts to identify the
-alignment value used on that disk, but will set 8-sector alignment on disks
-larger than 300 GB even if lesser alignment values are detected. In either
-case, it can be changed by using this option.
+new disks, GPT fdisk attempts to align partitions on 1MiB boundaries
+(2048\-sectors on disks with 512-byte sectors) by default, which optimizes
+performance for all of these disk types. On pre\-partitioned disks, GPT
+fdisk attempts to identify the alignment value used on that disk, but will
+set 8-sector alignment on disks larger than 300 GB even if lesser alignment
+values are detected. In either case, it can be changed by using this
+option.
.TP
.B m
diff --git a/gptcl.cc b/gptcl.cc
index ef99d02..94709ec 100644
--- a/gptcl.cc
+++ b/gptcl.cc
@@ -72,7 +72,8 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
struct poptOption theOptions[] =
{
- {"attributes", 'A', POPT_ARG_STRING, &attributeOperation, 'A', "operate on partition attributes", "list|[partnum:show|or|nand|xor|=|set|clear|toggle|get[:bitnum|hexbitmask]]"},
+ {"attributes", 'A', POPT_ARG_STRING, &attributeOperation, 'A', "operate on partition attributes",
+ "list|[partnum:show|or|nand|xor|=|set|clear|toggle|get[:bitnum|hexbitmask]]"},
{"set-alignment", 'a', POPT_ARG_INT, &alignment, 'a', "set sector alignment", "value"},
{"backup", 'b', POPT_ARG_STRING, &backupFile, 'b', "backup GPT to file", "file"},
{"change-name", 'c', POPT_ARG_STRING, &partName, 'c', "change partition's name", "partnum:name"},
@@ -404,7 +405,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
if (!pretend) {
DestroyGPT();
} // if
- saveNonGPT = 0;
+ saveNonGPT = 1;
saveData = 0;
break;
case 'Z':
@@ -412,7 +413,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
DestroyGPT();
DestroyMBR();
} // if
- saveNonGPT = 0;
+ saveNonGPT = 1;
saveData = 0;
break;
default:
@@ -446,7 +447,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
if (!pretend) {
DestroyGPT();
} // if
- saveNonGPT = 0;
+ saveNonGPT = 1;
saveData = 0;
break;
case 'Z':
@@ -454,7 +455,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
DestroyGPT();
DestroyMBR();
} // if
- saveNonGPT = 0;
+ saveNonGPT = 1;
saveData = 0;
break;
} // switch
diff --git a/sgdisk.8 b/sgdisk.8
index 62a24e5..dc0b5fd 100644
--- a/sgdisk.8
+++ b/sgdisk.8
@@ -148,11 +148,11 @@ sibling. Options available in \fBsgdisk\fR are:
.TP
.B \-a, \-\-set\-alignment=value
Set the sector alignment multiple. GPT fdisk aligns the start of partitions
-to sectors that are multiples of this value, which defaults to 2048 on
-freshly formatted disks. This alignment value is necessary to obtain optimum
-performance with Western Digital Advanced Format and similar drives with larger
-physical than logical sector sizes, with some types of RAID arrays, and
-with SSD devices.
+to sectors that are multiples of this value, which defaults to 1MiB (2048
+on disks with 512-byte sectors) on freshly formatted disks. This alignment
+value is necessary to obtain optimum performance with Western Digital
+Advanced Format and similar drives with larger physical than logical sector
+sizes, with some types of RAID arrays, and with SSD devices.
.TP
.B \-A, \-\-attributes=list|[partnum:show|or|nand|xor|=|set|clear|toggle|get[:bitnum|hexbitmask]]
@@ -337,7 +337,7 @@ to use the first available partition number. Subsequent uses of the
Create a new partition that fills the largest available block of space on
the disk. Note that if used on a completely blank disk, this is likely to
result in a sector-moved warning, since the first available sector
-(normally 34) doesn't fall on a 2048-sector boundary (the default for
+(normally 34) doesn't fall on a 1MiB boundary (the default for
alignment). You can use the \fI\-a\fR (\fI\-\-set\-alignment\fR) option to
adjust the alignment, if desired. A num value of 0 causes the program to
use the first available partition number.
@@ -483,7 +483,8 @@ An error occurred while reading the partition table
.TP
.B 3
-Non\-GPT disk detected and no \fI\-g\fR option
+Non\-GPT disk detected and no \fI\-g\fR option, but operation requires a
+write action
.TP
.B 4