aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS27
-rw-r--r--basicmbr.cc2
-rw-r--r--cgdisk.89
-rw-r--r--current.spec8
-rw-r--r--diskio-unix.cc3
-rw-r--r--fixparts.87
-rw-r--r--gdisk.87
-rw-r--r--gptcl.cc4
-rw-r--r--mbr.cc3
-rw-r--r--mbr.h1
-rw-r--r--parttypes.cc10
-rw-r--r--sgdisk.823
-rw-r--r--support.cc14
-rw-r--r--support.h2
14 files changed, 87 insertions, 33 deletions
diff --git a/NEWS b/NEWS
index 96810c7..3d33cb3 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,29 @@
-0.8.11 (?/?/2014):
+1.0.0 (3/16/2015):
------------------
+- I'm now building a binary package of gdisk_x64.efi, using the UEFI GPT
+ fdisk package.
+
+- Added partition type for OpenBSD data
+ (824CC7A0-36A8-11E3-890A-952519AD3F61/0xa601). Also mapped 0xa600 to the
+ FreeBSD disklabel type code (516E7CB4-6ECF-11D6-8FF8-00022D09712B). I'm
+ not sure that's 100% correct, but since I can't find references to an
+ OpenBSD disklabel GPT type code, it seems the best choice at the moment.
+
+- Added partition type for Windows Storage Spaces
+ (E75CAF8F-F680-4CEE-AFA3-B001E56EFC2D/0x4202)
+
+- Added -O/--print-mbr option to sgdisk, enabling easier display of MBR
+ data structures without invoking gdisk.
+
+- Updated warning message: "EBR describes a logical partition" now reads
+ "EBR points to an EBR," which is more technically correct.
+
+- Altered warning displayed when run from Windows on non-GPT disk, because
+ Windows on UEFI-based systems is becoming more common.
+
+- Fixed spurious "1" return value in gdisk.
+
- Small code changes to support compilation as EFI application with the
UEFI GPT fdisk library
(http://sourceforge.net/projects/uefigptfdisk/?source=directory)
@@ -9,7 +32,7 @@
(https://github.com/ceph/ceph/blob/9bcc42a3e6b08521694b5c0228b2c6ed7b3d312e/src/ceph-disk#L76-L81):
4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D/0xf800 (Ceph OSD),
4FBD7E29-9D25-41B8-AFD0-5EC00CEFF05D/0xf801 (Ceph dm-crypt OSD),
- BFBFAFE7-A34F-448A-9A5B-6213EB736C22/0xf802 (Ceph journal),
+ 45B0969E-9B03-4F30-B4C6-B4B80CEFF106/0xf802 (Ceph journal),
45B0969E-9B03-4F30-B4C6-5EC00CEFF106/0xf803 (Ceph dm-crypt journal),
89C57F98-2FE5-4DC0-89C1-F3AD0CEFF2BE/0xf804 (Ceph disk in creation), and
89C57F98-2FE5-4DC0-89C1-5EC00CEFF2BE/0xf805 (Ceph dm-crypt disk in
diff --git a/basicmbr.cc b/basicmbr.cc
index f7e1f6d..5661487 100644
--- a/basicmbr.cc
+++ b/basicmbr.cc
@@ -296,7 +296,7 @@ int BasicMBRData::ReadLogicalParts(uint64_t extendedStart, int partNum) {
// the logical partition when this is the case....
ebrType = ebr.partitions[0].partitionType;
if ((ebrType == 0x05) || (ebrType == 0x0f) || (ebrType == 0x85)) {
- cout << "EBR describes a logical partition!\n";
+ cout << "EBR points to an EBR!\n";
offset = extendedStart + ebr.partitions[0].firstLBA;
} else {
// Copy over the basic data....
diff --git a/cgdisk.8 b/cgdisk.8
index 53e0d4d..8f7dc9b 100644
--- a/cgdisk.8
+++ b/cgdisk.8
@@ -1,6 +1,6 @@
.\" Copyright 2011-2013 Roderick W. Smith (rodsmith@rodsbooks.com)
.\" May be distributed under the GNU General Public License
-.TH "CGDISK" "8" "0.8.10" "Roderick W. Smith" "GPT fdisk Manual"
+.TH "CGDISK" "8" "1.0.0" "Roderick W. Smith" "GPT fdisk Manual"
.SH "NAME"
cgdisk \- Curses-based GUID partition table (GPT) manipulator
.SH "SYNOPSIS"
@@ -276,10 +276,7 @@ Write data. Use this command to save your changes.
.SH "BUGS"
-As of March 2014 (version 0.8.10), \fBcgdisk\fR should be considered
-beta software. Although the underlying partition manipulation code is much
-older, the \fBcgdisk\fR ncurses user interface is brand new with GPT fdisk
-version 0.8.0. Known bugs and limitations include:
+Known bugs and limitations include:
.TP
.B *
@@ -367,7 +364,7 @@ Contributors:
* Justin Maggard (justin.maggard@netgear.com)
-* Dwight Schauer (dschauer@ti.com)
+* Dwight Schauer (dschauer@gmail.com)
* Florian Zumbiehl (florz@florz.de)
diff --git a/current.spec b/current.spec
index af26193..42f1d80 100644
--- a/current.spec
+++ b/current.spec
@@ -1,12 +1,12 @@
Summary: GPT partitioning and MBR repair software
Name: gptfdisk
-Version: 0.8.10
+Version: 1.0.0
Release: 1%{?dist}
License: GPLv2
URL: http://www.rodsbooks.com/gdisk
Group: Applications/System
-Source: http://www.rodsbooks.com/gdisk/gptfdisk-0.8.10.tar.gz
+Source: http://www.rodsbooks.com/gdisk/gptfdisk-1.0.0.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
%description
@@ -81,5 +81,5 @@ provides a few additional partition manipulation features.
%changelog
-* Sun Mar 2 2014 R Smith <rodsmith@rodsbooks.com> - 0.8.10
-- Created spec file for 0.8.10 release
+* Sun Mar 2 2014 R Smith <rodsmith@rodsbooks.com> - 1.0.0
+- Created spec file for 1.0.0 release
diff --git a/diskio-unix.cc b/diskio-unix.cc
index 388a04d..7be0bbe 100644
--- a/diskio-unix.cc
+++ b/diskio-unix.cc
@@ -253,7 +253,8 @@ int DiskIO::DiskSync(void) {
i = ioctl(fd, BLKRRPART);
if (i) {
cout << "Warning: The kernel is still using the old partition table.\n"
- << "The new table will be used at the next reboot.\n";
+ << "The new table will be used at the next reboot or after you\n"
+ << "run partprobe(8) or kpartx(8)\n";
} else {
retval = 1;
} // if/else
diff --git a/fixparts.8 b/fixparts.8
index d840df2..157bd78 100644
--- a/fixparts.8
+++ b/fixparts.8
@@ -1,6 +1,6 @@
.\" Copyright 2011-2013 Roderick W. Smith (rodsmith@rodsbooks.com)
.\" May be distributed under the GNU General Public License
-.TH "FIXPARTS" "8" "0.8.10" "Roderick W. Smith" "FixParts Manual"
+.TH "FIXPARTS" "8" "1.0.0" "Roderick W. Smith" "FixParts Manual"
.SH "NAME"
fixparts \- MBR partition table repair utility
.SH "SYNOPSIS"
@@ -202,8 +202,7 @@ see a summary of available options.
.PP
.SH "BUGS"
-As of March 2014 (version 0.8.10), \fBfixparts\fR
-should be considered beta software. Known bugs and limitations include:
+Known bugs and limitations include:
.TP
.B *
@@ -259,7 +258,7 @@ Contributors:
* Justin Maggard (justin.maggard@netgear.com)
-* Dwight Schauer (dschauer@ti.com)
+* Dwight Schauer (dschauer@gmail.com)
* Florian Zumbiehl (florz@florz.de)
diff --git a/gdisk.8 b/gdisk.8
index 5cbaef5..c5d44f3 100644
--- a/gdisk.8
+++ b/gdisk.8
@@ -1,6 +1,6 @@
.\" Copyright 2011-2013 Roderick W. Smith (rodsmith@rodsbooks.com)
.\" May be distributed under the GNU General Public License
-.TH "GDISK" "8" "0.8.10" "Roderick W. Smith" "GPT fdisk Manual"
+.TH "GDISK" "8" "1.0.0" "Roderick W. Smith" "GPT fdisk Manual"
.SH "NAME"
gdisk \- Interactive GUID partition table (GPT) manipulator
.SH "SYNOPSIS"
@@ -561,8 +561,7 @@ entering data. When only one option is possible, \fBgdisk\fR
usually bypasses the prompt entirely.
.SH "BUGS"
-As of March 2014 (version 0.8.10), \fBgdisk\fR
-should be considered beta software. Known bugs and limitations include:
+Known bugs and limitations include:
.TP
.B *
@@ -660,7 +659,7 @@ Contributors:
* Justin Maggard (justin.maggard@netgear.com)
-* Dwight Schauer (dschauer@ti.com)
+* Dwight Schauer (dschauer@gmail.com)
* Florian Zumbiehl (florz@florz.de)
diff --git a/gptcl.cc b/gptcl.cc
index ce1766c..ef99d02 100644
--- a/gptcl.cc
+++ b/gptcl.cc
@@ -93,6 +93,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
{"new", 'n', POPT_ARG_STRING, &newPartInfo, 'n', "create new partition", "partnum:start:end"},
{"largest-new", 'N', POPT_ARG_INT, &largestPartNum, 'N', "create largest possible new partition", "partnum"},
{"clear", 'o', POPT_ARG_NONE, NULL, 'o', "clear partition table", ""},
+ {"print-mbr", 'O', POPT_ARG_NONE, NULL, 'O', "print MBR partition table", ""},
{"print", 'p', POPT_ARG_NONE, NULL, 'p', "print partition table", ""},
{"pretend", 'P', POPT_ARG_NONE, NULL, 'P', "make changes in memory, but don't write them", ""},
{"transpose", 'r', POPT_ARG_STRING, &twoParts, 'r', "transpose two partitions", "partnum:partnum"},
@@ -320,6 +321,9 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
ClearGPTData();
saveData = 1;
break;
+ case 'O':
+ DisplayMBRData();
+ break;
case 'p':
DisplayGPTData();
break;
diff --git a/mbr.cc b/mbr.cc
index 5dbc95e..08c61be 100644
--- a/mbr.cc
+++ b/mbr.cc
@@ -28,6 +28,9 @@ using namespace std;
* *
****************************************/
+MBRData::~MBRData(void) {
+} // MBRData destructor
+
/* // Assignment operator -- copy entire set of MBR data.
MBRData & MBRData::operator=(const MBRData & orig) {
BasicMBRData::operator=(orig);
diff --git a/mbr.h b/mbr.h
index 3cacf61..bbb84ef 100644
--- a/mbr.h
+++ b/mbr.h
@@ -28,6 +28,7 @@ public:
MBRData(void) {}
MBRData(string deviceFilename) : BasicMBRData(deviceFilename) {}
MBRData & operator=(const BasicMBRData & orig);
+ ~MBRData(void);
// Functions to create, delete, or change partitions
// Pass EmptyMBR 1 to clear the boot loader code, 0 to leave it intact
diff --git a/parttypes.cc b/parttypes.cc
index fef8629..18fcbd0 100644
--- a/parttypes.cc
+++ b/parttypes.cc
@@ -103,6 +103,7 @@ void PartType::AddAllTypes(void) {
// Windows LDM ("dynamic disk") types
AddType(0x4200, "AF9B60A0-1431-4F62-BC68-3311714A69AD", "Windows LDM data"); // Logical disk manager
AddType(0x4201, "5808C8AA-7E8F-42E0-85D2-E1E90434CFB3", "Windows LDM metadata"); // Logical disk manager
+ AddType(0x4202, "E75CAF8F-F680-4CEE-AFA3-B001E56EFC2D", "Windows Storage Spaces"); // A newer LDM-type setup
// An oddball IBM filesystem....
AddType(0x7501, "37AFFC90-EF7D-4E96-91C3-2D7AE055B174", "IBM GPFS"); // General Parallel File System (GPFS)
@@ -153,6 +154,13 @@ void PartType::AddAllTypes(void) {
AddType(0xa584, "85D5E45D-237C-11E1-B4B3-E89A8F7FC3A7", "Midnight BSD ZFS");
AddType(0xa585, "85D5E45C-237C-11E1-B4B3-E89A8F7FC3A7", "Midnight BSD Vinum");
+ // OpenBSD partition type....
+ // Note: MBR type 0xa6 is normally subdivided with a BSD disklabel. It's unclear
+ // if that has a GPT equivalent, so I've mapped it to the same GUID as the
+ // FreeBSD diskalbel.
+ AddType(0xa600, "516E7CB4-6ECF-11D6-8FF8-00022D09712B", "OpenBSD disklabel", 0);
+ AddType(0xa601, "824CC7A0-36A8-11E3-890A-952519AD3F61", "OpenBSD data");
+
// A MacOS partition type, separated from others by NetBSD partition types...
AddType(0xa800, "55465300-0000-11AA-AA11-00306543ECAC", "Apple UFS"); // Mac OS X
@@ -213,7 +221,7 @@ void PartType::AddAllTypes(void) {
// Ceph type codes; see https://github.com/ceph/ceph/blob/9bcc42a3e6b08521694b5c0228b2c6ed7b3d312e/src/ceph-disk#L76-L81
AddType(0xf800, "4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D", "Ceph OSD"); // Ceph Object Storage Daemon
AddType(0xf801, "4FBD7E29-9D25-41B8-AFD0-5EC00CEFF05D", "Ceph dm-crypt OSD"); // Ceph Object Storage Daemon (encrypted)
- AddType(0xf802, "BFBFAFE7-A34F-448A-9A5B-6213EB736C22", "Ceph journal");
+ AddType(0xf802, "45B0969E-9B03-4F30-B4C6-B4B80CEFF106", "Ceph journal");
AddType(0xf803, "45B0969E-9B03-4F30-B4C6-5EC00CEFF106", "Ceph dm-crypt journal");
AddType(0xf804, "89C57F98-2FE5-4DC0-89C1-F3AD0CEFF2BE", "Ceph disk in creation");
AddType(0xf805, "89C57F98-2FE5-4DC0-89C1-5EC00CEFF2BE", "Ceph dm-crypt disk in creation");
diff --git a/sgdisk.8 b/sgdisk.8
index 8bca538..62a24e5 100644
--- a/sgdisk.8
+++ b/sgdisk.8
@@ -1,6 +1,6 @@
.\" Copyright 2011-2013 Roderick W. Smith (rodsmith@rodsbooks.com)
.\" May be distributed under the GNU General Public License
-.TH "SGDISK" "8" "0.8.10" "Roderick W. Smith" "GPT fdisk Manual"
+.TH "SGDISK" "8" "1.0.0" "Roderick W. Smith" "GPT fdisk Manual"
.SH "NAME"
sgdisk \- Command\-line GUID partition table (GPT) manipulator for Linux and Unix
.SH "SYNOPSIS"
@@ -353,11 +353,19 @@ disk's original partition table is bad; however, most other options on the
same command line will be ignored.
.TP
+.B \-O, \-\-print\-mbr
+Display basic \fIMBR\fR partition summary data. This includes partition
+numbers, starting and ending sector numbers, partition sizes, MBR partition
+types codes, and partition names. This option is useful mainly for
+diagnosing partition table problems, particularly on disks with hybrid
+MBRs.
+
+.TP
.B \-p, \-\-print
-Display basic partition summary data. This includes partition
-numbers, starting and ending sector numbers, partition sizes,
-\fBsgdisk\fR's partition types codes, and partition names. For
-additional information, use the \fI\-i\fR (\fI\-\-info\fR) option.
+Display basic GPT partition summary data. This includes partition numbers,
+starting and ending sector numbers, partition sizes, \fBsgdisk\fR's
+partition types codes, and partition names. For additional information, use
+the \fI\-i\fR (\fI\-\-info\fR) option.
.TP
.B \-P, \-\-pretend
@@ -491,8 +499,7 @@ sgdisk, but may with gdisk)
Disk replication operation (-R) failed
.SH "BUGS"
-As of March 2014 (version 0.8.10), \fBsgdisk\fR
-should be considered beta software. Known bugs and limitations include:
+Known bugs and limitations include:
.TP
.B *
@@ -578,7 +585,7 @@ Contributors:
* Justin Maggard (justin.maggard@netgear.com)
-* Dwight Schauer (dschauer@ti.com)
+* Dwight Schauer (dschauer@gmail.com)
* Florian Zumbiehl (florz@florz.de)
diff --git a/support.cc b/support.cc
index 8c56c91..0833a3e 100644
--- a/support.cc
+++ b/support.cc
@@ -34,6 +34,17 @@ using namespace std;
// Reads a string from stdin, returning it as a C++-style string.
// Note that the returned string will NOT include the carriage return
// entered by the user.
+#ifdef EFI
+extern int __sscanf( const char * str , const char * format , ... ) ;
+string ReadString(void) {
+ string inString;
+ char efiString[256];
+
+ fgets(efiString, 255, stdin);
+ inString = efiString;
+ return inString;
+} // ReadString()
+#else
string ReadString(void) {
string inString;
@@ -42,6 +53,7 @@ string ReadString(void) {
exit(5);
return inString;
} // ReadString()
+#endif
// Get a numeric value from the user, between low and high (inclusive).
// Keeps looping until the user enters a value within that range.
@@ -225,7 +237,7 @@ string BytesToIeee(uint64_t size, uint32_t sectorSize) {
uint64_t sizeInIeee;
uint64_t previousIeee;
float decimalIeee;
- uint index = 0;
+ uint64_t index = 0;
string units, prefixes = " KMGTPEZ";
ostringstream theValue;
diff --git a/support.h b/support.h
index 3e6fe08..cb67b6b 100644
--- a/support.h
+++ b/support.h
@@ -8,7 +8,7 @@
#ifndef __GPTSUPPORT
#define __GPTSUPPORT
-#define GPTFDISK_VERSION "0.8.10.2"
+#define GPTFDISK_VERSION "1.0.0"
#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined (__APPLE__)
// Darwin (Mac OS) & FreeBSD: disk IOCTLs are different, and there is no lseek64