From: pfau@coffee.enet.dec.com (Thomas Pfau) Subject: Sharing swap space - Linux & Dos/Windows Date: Thu, 25 Mar 1993 19:26:14 GMT
This is how my home system is set up to share a swap partition between
DOS/Windows and Linux.
The disk is divided into three partition. The first is for DOS/Windows
(FAT16), the second for Linux (Minix) and the third is a shared swap
partition (FAT12).
Once the disk is partitioned and software is loaded, do the following:
Format the D: drive (swap partition) from DOS. Start Windows. Start
Control Panel and select 386enh/Virtual Memory/Change. Select drive D
and a permanent swap file. For size, enter the number listed in 'maximum
size'. (If this partition is real big, you may want to specify a smaller
number and use the remaining space on the drive for your TEMP directory).
Ignore warnings that Windows won't use more than the suggested size. Let
Control Panel restart Windows and make sure it all works. Then, exit
windows and reboot into Linux.
Log in as root. Enter the following command:
dd if=/dev/hda3 of=/etc/dosswap bs=1024 count=32
Replace /dev/hda3 with the proper drive specification. The 'count=32'
works on my system with a 4MB partition. You might need to specify more
or less depending on how large the partition is. Essentially, it must be
large enough to get the boot sector, any reserved sectors, the FAT
(possibly multiple copies) and the root directory.
In your /etc/rc or /etc/rc.local, enter the following commands:
mkswap /dev/hda3 nnnn
swapon /dev/hda3
Replace /dev/hda3 with the actual drive name and 'nnnn' with the size of
the partition as reported by fdisk.
Create a script for shutting down the system. I called mine 'dos'. The
script should shut down swapping on this partition and copy /etc/dosswap
back to it before shutting down the system. For example:
swapoff /dev/hda3
dd if=/etc/dosswap of=/dev/hda3 bs=1024 count=32
if [ -z %1 ]; then reboot; fi
%1 %2 %3 %4 %4 %6
This takes a parameter which is a program to run after restoring the DOS
contents of the partition. The default action is to reboot. You could
also type 'dos halt' to shutdown the machine.
And a hint for running DOS: If you don't like SMARTDRV's write cacheing,
disable it on your C drive. You can leave it enabled on your D (swap)
drive since it only contains temporary information anyway. This leaves
your data partition a bit safer while speeding up Windows swap/page
activity.
tom_p
======================================================================
pfau@coffee.enet.dec.com | There is a place in space beyond our
16.69.208.195 | sense of time. There is a time
| beyond space.
======================================================================