Version 0.8.5 release

This commit is contained in:
srs5694
2012-05-30 12:30:48 -04:00
parent bc8dedfeb6
commit 4307ef2e86
9 changed files with 43 additions and 26 deletions

9
NEWS
View File

@@ -1,6 +1,13 @@
0.8.5 (?/??/2012):
0.8.5 (5/30/2012):
------------------
- Changed code that writes the partition table so that a disk sync
operation occurs even if one or more write operations failed (but not if
they all failed). This is intended to work around a bug that a user
reported on a Windows system on which the write of the protective MBR
failed, although everything else worked. (I suspect anti-virus software
may have been blocking write access to the MBR.)
- Added type codes for Midnight BSD (0xA580 - 0xA585). I used these codes
because Midnight BSD uses the same 0xA5 type code as FreeBSD on MBR
disks, so I'm starting Midnight BSD's numbering halfway through the

View File

@@ -1,6 +1,6 @@
.\" Copyright 2011, 2012 Roderick W. Smith (rodsmith@rodsbooks.com)
.\" May be distributed under the GNU General Public License
.TH "CGDISK" "8" "0.8.4" "Roderick W. Smith" "GPT fdisk Manual"
.TH "CGDISK" "8" "0.8.5" "Roderick W. Smith" "GPT fdisk Manual"
.SH "NAME"
cgdisk \- Curses-based GUID partition table (GPT) manipulator
.SH "SYNOPSIS"
@@ -268,7 +268,7 @@ Write data. Use this command to save your changes.
.SH "BUGS"
As of March 2012 (version 0.8.4), \fBcgdisk\fR should be considered
As of May 2012 (version 0.8.5), \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:

View File

@@ -1,11 +1,11 @@
Summary: GPT partitioning and MBR repair software
Name: gptfdisk
Version: 0.8.4
Version: 0.8.5
Release: 1%{?dist}
License: GPLv2
URL: http://www.rodsbooks.com/gdisk
Group: Applications/System
Source: http://www.rodsbooks.com/gdisk/gptfdisk-0.8.4.tar.gz
Source: http://www.rodsbooks.com/gdisk/gptfdisk-0.8.5.tar.gz
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
%description
@@ -80,5 +80,5 @@ provides a few additional partition manipulation features.
%changelog
* Sun Mar 25 2012 R Smith <rodsmith@rodsbooks.com> - 0.8.4
- Created spec file for 0.8.4 release
* Wed May 30 2012 R Smith <rodsmith@rodsbooks.com> - 0.8.5
- Created spec file for 0.8.5 release

View File

@@ -254,9 +254,7 @@ int DiskIO::Read(void* buffer, int numBytes) {
return retval;
} // DiskIO::Read()
// A variant on the standard write() function. Done to work around
// limitations in FreeBSD concerning the matching of the sector
// size with the number of bytes read.
// A variant on the standard write() function.
// Returns the number of bytes written.
int DiskIO::Write(void* buffer, int numBytes) {
int blockSize = 512, i, numBlocks, retval = 0;

View File

@@ -1,6 +1,6 @@
.\" Copyright 2011, 2012 Roderick W. Smith (rodsmith@rodsbooks.com)
.\" May be distributed under the GNU General Public License
.TH "FIXPARTS" "8" "0.8.4" "Roderick W. Smith" "FixParts Manual"
.TH "FIXPARTS" "8" "0.8.5" "Roderick W. Smith" "FixParts Manual"
.SH "NAME"
fixparts \- MBR partition table repair utility
.SH "SYNOPSIS"
@@ -202,7 +202,7 @@ see a summary of available options.
.PP
.SH "BUGS"
As of March 2012 (version 0.8.4), \fBfixparts\fR
As of May 2012 (version 0.8.5), \fBfixparts\fR
should be considered beta software. Known bugs and limitations include:
.TP

View File

@@ -1,6 +1,6 @@
.\" Copyright 2011, 2012 Roderick W. Smith (rodsmith@rodsbooks.com)
.\" May be distributed under the GNU General Public License
.TH "GDISK" "8" "0.8.4" "Roderick W. Smith" "GPT fdisk Manual"
.TH "GDISK" "8" "0.8.5" "Roderick W. Smith" "GPT fdisk Manual"
.SH "NAME"
gdisk \- Interactive GUID partition table (GPT) manipulator
.SH "SYNOPSIS"
@@ -200,8 +200,8 @@ can be specified in absolute terms as sector numbers or as positions
measured in kibibytes (K), mebibytes (M), gibibytes (G), tebibytes (T), or
pebibytes (P); for instance, \fI\fB40M\fR\fR specifies a position 40MiB
from the start of the disk. You can specify locations relative to the start
or end of the specified default range by preceding the number by a '+' or
'\-' symbol, as in \fI\fB+2G\fR\fR to specify a point 2GiB after the
or end of the specified default range by preceding the number by a '+' or '\-'
symbol, as in \fI\fB+2G\fR\fR to specify a point 2GiB after the
default start sector, or \fI\fB\-200M\fR\fR to specify a point 200MiB
before the last available sector. Pressing the Enter key with no input
specifies the default value, which is the start of the largest available
@@ -561,7 +561,7 @@ entering data. When only one option is possible, \fBgdisk\fR
usually bypasses the prompt entirely.
.SH "BUGS"
As of March 2012 (version 0.8.4), \fBgdisk\fR
As of May 2012 (version 0.8.5), \fBgdisk\fR
should be considered beta software. Known bugs and limitations include:
.TP

24
gpt.cc
View File

@@ -970,10 +970,14 @@ int GPTData::CheckTable(struct GPTHeader *header) {
return allOK;
} // GPTData::CheckTable()
// Writes GPT (and protective MBR) to disk. If quiet==1,
// Writes GPT (and protective MBR) to disk. If quiet==1, moves the second
// header later on the disk without asking for permission, if necessary, and
// doesn't confirm the operation before writing. If quiet==0, asks permission
// before moving the second header and asks for final confirmation of any
// write.
// Returns 1 on successful write, 0 if there was a problem.
int GPTData::SaveGPTData(int quiet) {
int allOK = 1;
int allOK = 1, syncIt = 1;
char answer;
// First do some final sanity checks....
@@ -1042,9 +1046,11 @@ int GPTData::SaveGPTData(int quiet) {
if (myDisk.OpenForWrite()) {
// As per UEFI specs, write the secondary table and GPT first....
allOK = SavePartitionTable(myDisk, secondHeader.partitionEntriesLBA);
if (!allOK)
if (!allOK) {
cerr << "Unable to save backup partition table! Perhaps the 'e' option on the experts'\n"
<< "menu will resolve this problem.\n";
syncIt = 0;
} // if
// Now write the secondary GPT header...
allOK = allOK && SaveHeader(&secondHeader, myDisk, mainHeader.backupLBA);
@@ -1059,15 +1065,21 @@ int GPTData::SaveGPTData(int quiet) {
allOK = allOK && protectiveMBR.WriteMBRData(&myDisk);
// re-read the partition table
if (allOK) {
// Note: Done even if some write operations failed, but not if all of them failed.
// Done this way because I've received one problem report from a user one whose
// system the MBR write failed but everything else was OK (on a GPT disk under
// Windows), and the failure to sync therefore caused Windows to restore the
// original partition table from its cache. OTOH, such restoration might be
// desirable if the error occurs later; but that seems unlikely unless the initial
// write fails....
if (syncIt)
myDisk.DiskSync();
} // if
if (allOK) { // writes completed OK
cout << "The operation has completed successfully.\n";
} else {
cerr << "Warning! An error was reported when writing the partition table! This error\n"
<< "MIGHT be harmless, but you may have trashed the disk!\n";
<< "MIGHT be harmless, or the disk might be damaged! Checking it is advisable.\n";
} // if/else
myDisk.Close();

View File

@@ -1,6 +1,6 @@
.\" Copyright 2011, 2012 Roderick W. Smith (rodsmith@rodsbooks.com)
.\" May be distributed under the GNU General Public License
.TH "SGDISK" "8" "0.8.4" "Roderick W. Smith" "GPT fdisk Manual"
.TH "SGDISK" "8" "0.8.5" "Roderick W. Smith" "GPT fdisk Manual"
.SH "NAME"
sgdisk \- Command\-line GUID partition table (GPT) manipulator for Linux and Unix
.SH "SYNOPSIS"
@@ -161,7 +161,7 @@ attribute values. Omit the partition number (and even the device filename)
when using this option. The others require a partition number. The
\fIshow\fR and \fIget\fR options show the current attribute settings
(all attributes or for a particular bit, respectively). The \fIor\fR,
\fInand\fR, \fIxor\fR, \fI\=\fR, \fIset\fR, \fIclear\fR, and
\fInand\fR, \fIxor\fR, \fI=\fR, \fIset\fR, \fIclear\fR, and
\fItoggle\fR options enable you to change the attribute bit value. The
\fIset\fR, \fIclear\fR, \fItoggle\fR, and \fIget\fR options work on a
bit number; the others work on a hexadecimal bit mask. For example, type
@@ -490,7 +490,7 @@ sgdisk, but may with gdisk)
Disk replication operation (-R) failed
.SH "BUGS"
As of March 2012 (version 0.8.4), \fBsgdisk\fR
As of May 2012 (version 0.8.5), \fBsgdisk\fR
should be considered beta software. Known bugs and limitations include:
.TP

View File

@@ -8,7 +8,7 @@
#ifndef __GPTSUPPORT
#define __GPTSUPPORT
#define GPTFDISK_VERSION "0.8.4.1"
#define GPTFDISK_VERSION "0.8.5"
#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined (__APPLE__)
// Darwin (Mac OS) & FreeBSD: disk IOCTLs are different, and there is no lseek64