12 February 2002 - lphdisk 0.9.1 - Alex Stewart <email@example.com>
(Fixed a couple of minor bugs submitted by users)
23 August 2001 - Second release, lphdisk 0.9. "Oh yeah..."
16 July 2001 - lphdisk 0.4as1 - Alex Stewart <firstname.lastname@example.org>
There are quite a few changes in this release. First of all, it's been largely
rewritten (I didn't set out to do it, but it ended up that way, for a couple of
reasons). In the process, much of the code was made to be more modular, with
well-defined APIs and removal of most of the global variables. A good chunk of
the rewriting was needed to support some of the new features. A side effect is
that it will now also be cleaner to add partition table modification should
anyone ever get around to that.
OK, some of the changes and reasons:
= lphdisk can now handle hibernate partitions on any primary partition, not
just partition 4.
As far as I know, all versions of Phoenix NoteBIOS will handle a hibernate
partition on any of the primary partitions, and some new notebooks are even
coming with it on partition 1 now. In some cases it's also more
convenient to have it on another partition, so it seemed reasonable to
remove this limitation.
= It can now be used on drives besides /dev/hda and /dev/sda.
There are several reasons for this, one of the biggies being the unix
philosophy that, yes, the user really does know best. There is also the
point that on some strange systems, the /dev entries may be named
differently or even point to different disks (and on devfs systems they
will follow a completely different naming scheme, for example), and in
some configurations (prepping a disk for moving into another machine) it
may also be desirable to perform this on something that isn't the first
drive in the system.
That's not to say that lphdisk will just use any destination blindly. A
lot of additional checks have been built in (see below). If something
other than the first IDE disk in the system is used, a warning will still
be given to the user that the BIOS may not be able to use it there, but it
won't outright prohibit the use of it.
Oh, and you can also now use a normal file as an argument to lphdisk.
Pointing it at anything other than a block device does require the use of
the '-f' (force) switch, and it does still require that the first 512 bytes
contain a valid partition table. This, however, makes it possible to use
lphdisk on disk image files which can later be transferred to an actual
physical drive, etc.
= lphdisk will now automagically calculate and print the required partition
Detection of physical memory size (through /proc/mtrr and /proc/meminfo)
and video memory (via VESA BIOS Extensions) is now done to figure out the
right size for a hibernate partition. This information is displayed to
the user and also checked against the actual partition used to make sure
it'll be big enough (a warning is given if it doesn't appear to be).
A '-p' (--probeonly) option has also been added to tell lphdisk to just
calculate and print the reccomended size without doing any formatting.
= lphdisk now performs all of its updates using only the (raw) disk
device/file specified (i.e. just /dev/hda instead of using both
/dev/hda and /dev/hda4)
Making assumptions about relationships between different device filenames
is potentially very bad, and this prevents somebody who's done something
silly like 'mknod /dev/hda4 b 3 1' from accidentally getting something
This does require using raw unix fd IO instead of stdio streams, which for
some reason I don't quite fathom turns out to be somewhere around 10 times
slower. I'm still working on figuring out if there's a way to speed this
up, but on decent sized partitions (260MB) it still only takes a minute
and a half or so, which considering this is usually a one-time operation
isn't that bad, and the safety added by doing things this way outweighs
an extra minute of runtime, IMHO.
This also makes it possible to use regular files the same as disks for this
purpose, as mentioned above.
= A lot of error-checking has been added, as well as sanity-checking of some
of the data it's getting from the partition table.
lphdisk will now check some of the obvious things like making sure
partitions don't overlap, and checking of return values has been added to
the couple of system calls which previously didn't have it.
= Sanity-checking against /proc/partitions
For block devices, lphdisk will attempt to correlate what it's seeing in
the partition table against what the running kernel reports via
/proc/partitions. This both double-checks that it's looking at something
that should be a partitionable device, and ensures that the running system
is in sync with what's actually on the disk (i.e. the user has rebooted
since changing things with fdisk).
One exception is made if it appears that the user may have just run fdisk
to create the "A0" partition out of free space and hasn't yet rebooted, but
all other partitions check out. This avoids the need for one more reboot
in this reasonably common scenario, and should be fairly safe as long as
everything else matches up.
= Long option support added
Added support for GNU-style long options, just for completeness/linuxness.
= Added '-d' (--debug) flag
All of the debug messages previously enabled by compiling with the DEBUG
define set have been changed to be runtime-selectable using the '-d'
command line option (and a lot of additional debug messages have been
added). This is particularly useful in troubleshooting situations where
users may only have ready access to a precompiled binary (and in a
program like this there isn't a great deal of speed or size advantage to
= Added '-n' (--nowrite) flag
The '-n' flag will cause lphdisk to do everything it would normally do,
except actually writing sectors to the disk. This can be used for
testing, or in combination with '-d' to gather information about a
potentially dangerous issue.
= '-f' (--force) flag is now useful
'-f' will now cause most sanity-checking errors to be demoted to warnings
an allow execution to proceed anyway. This can be used to:
a) Use a regular file instead of a block device.
b) Ignore mismatches between the partition table and /proc/partitions
27 July 2000 - First release, lphdisk 0.4. "Spooooon!"