Experiences With a Dell Inspiron 4100
Hibernation
Summary: When set up properly, hibernation will work for Linux. Windows XP
has its own hibernation method, and its own save file, which also works. I
don't know, but I doubt, if XP can hibernate using the BIOS method.
The BIOS supports two styles of hibernation: all of memory and video RAM
in one partition, or the initial segment in a small partition, continued to
a plain file in another DOS partition. I don't know if FAT32 qualifies,
but NTFS definitely doesn't, so the split partition method is not feasible
on modern systems.
I recreated the save-to-disc partition. It is best to do this before
setting up Windows and Linux, in case you make a mistake. Correct method:
- Download d5788807.exe from
http://support.dell.com and execute it (on Windows, any version)
producing a bootable floppy. (See below for an alternative.) (Credit
to myronsussman <msussman@adelphia.net> on LDL for finding this file.)
This has the same mks2d.exe that's on the Dell resource disc (Win98)
for the Inspiron 3800.
- Compute the required size of the hibernation (s2d) partition. The
official formula is (main + video RAM)*1.01 + 2 Mb, rounded up to the
next whole cylinder. Be sure to use consistent units: RAM and cylinder
sizes both in bytes, or both in Mb defined as 2^20 bytes.
(Inconsistent units led me to have to re-do this procedure twice.)
There is an example in the readme file for mks2d.exe (on the floppy)
where they use 1.01*(main RAM + 4 Mb), but I think that one assumes a
1990 style graphics card (VGA, oooo how kewl!)
- Of course nothing can go wrong in this procedure :-) but just in case
it would be a good idea to back up everything of value on the disc. I
made total backups of my Linux partitions onto my server, 1.3 Gb of
stuff, using these command lines:
cd / ; tar clzf - . | rsh myserver "cat - > /var/upgrade/root.tgz"
cd home ; tar clzf - . | rsh myserver "cat - > /var/upgrade/home.tgz"
- Boot SuSE Linux (remember to specify disableapic). The following
method may be dumb but having the GUI interface helps you avoid errors.
Tell it you will install Linux from scratch, and you will partition the
disc. Delete hda1 (Dell "break the seal" partition) and hda2 (original
WinXP). These partition number assignments are for my system;
substitute what's right for your system.
- Create the WinXP partition as hda2 with the correct size, starting
however many cylinders from the beginning, leaving hda1 uncreated and
unallocated. Create your Linux partition(s) if not done yet. After it
writes the partition table back to disc (taking about 15 secs to do
it), abort the installation, ignoring its complaints.
- Boot your floppy. There are two choices here: use the floppy from the
first step, or use the Windows 98 rescue floppy plus the Inspiron 3800
CD. Execute ``mks2d.exe -f''. On the CD you will find it under
\win98\suspend. (-f means do not use a continuation file.) The
partition is allocated from the free space, and something is written
slowly on every block.
- You need to install Windows before testing
hibernation. Actually I think the requirement is that at least one
partition be bootable and ``active'', and WinXP qualifies. LILO
ignores the ``active'' bit. But don't test hibernation from Windows
XP, which has its own large hibernation file (which you would have to
enable; it isn't on by default). The SuSE Linux rescue system is a
convenient guinea pig.
- To actually hibernate, press Fn-A. A message will appear on the screen.
With 256 Mb of RAM it takes about 90 seconds to write to the disc
(using non-DMA I/O) and the same to read it back in. There is an
alarming period of about 15 seconds (writing and reading both) when
the screen goes blank. Don't panic; be patient; let it finish.
- To really test hibernation, unplug the power supply and remove the
battery for 15 seconds.
- To resume, remove bootable floppies and CD, and boot hda1. This
assumes that you have used LILO to give yourself a menu (see my lilo.conf file). I didn't try this, but the WinXP
multisystem booter should also work with Linux and probably will handle
de-hibernation automatically.
If mks2d.exe claims it wants a filesystem but can't find one or is not
allowed to use one due to -f, then your hibernation partition is too small.
Calculate the size correctly, delete hda2, and reallocate it leaving more space
for hda1. If you attempt to hibernate and the partition has not been set up by
mks2d.exe, the BIOS will exude a message to the effect that the hibernation
partition is incompatible with the BIOS and the BIOS needs to be upgraded
(which is a lie). It will then suspend to RAM.
Needless to say, the above procedure is a distillation of what I actually
did, in the process of which I trashed my Linux root partition twice.
Under no circumstances use DOS fdisk.exe to manipulate the partition table
of a disc with unallocated space at the beginning, because it will put
your new partition at some random location within your Linux root.
Do not fail to de-hibernate if you have hibernated! Your filesystem
will be in an active state, as if the system had crashed, and if you boot
Linux then fsck will repair the filesystem. Then you will create or add
to files. If you later de-hibernate, that instance will not be aware of the
changes made and will trash your filesystem.
If you have a hibernating image that you want to remove, the correct
procedure is to execute rms2d.exe, and then mks2d.exe again. The hibernation
partition will have been made active, and this needs to be undone, otherwise
the BIOS will refuse to use the partition.
It takes 90 seconds to hibernate. The BIOS is not too bright about
estimating the remaining charge in the battery, and one time the BIOS initiated
a ``critical suspend'' operation with 4% left (it thought), and didn't have
enough juice to finish the job.