Linux Swap Space Mini-HOWTO
jurahul@hotmail.com
http://jurahul.freeservers.comv1.42, 18 January 2000
This Linux Mini-HOWTO describes how to share your Linux swap partition with Windows.
Many people use both Linux and MS-Windows. The ability to do so is an important part of "the Linux revolution"; i.e. letting people experiment with (and get hooked on) Linux while still being able to run their off-the-shelf software. Since both Linux and MS-Windows use virtual memory with swap to disk, a frequently occurring question in comp.os.linux.setup is how to share swap spaces, in order to reduce the amount of disk space needed.
There are several methods for sharing swap spaces, the one described in this document is probably the most complicated one but is the only one I have encountered that allows maximum performance for both environments without the risk of trashing a disk partition. If you are using DOS, then many DOS applications manage their own swap files. You can also share the Linux swap partition with these applications.
This procedure have a few requirements that need to be filled. I strongly recommend that you fill these requirements anyway, as there are several problems with older versions.
# MS-DOS 5.0 or newer and MS-Windows 3.1/3.11 OR MS-Windows 95/98 #
# A shutdown/init that knows to run a file on shutdown. (The !SysVinit?-2.50 package can do this, for example.
/pub/Linux/system/Daemons. Almost all current distributions use this init package.) #
from 15 Jan 1998. *
Currently maintained by Rahul U. Joshi *
never actually appeared on the LDP website. *
Modifications by Rahul U. Joshi
Date: 26 Nov 1999
*
*
*
*
*
*
*
*
*
Unless otherwise stated, Linux HOWTO documents are copyrighted by their respective authors. Linux HOWTO documents may be reproduced and distributed in whole or in part, in any medium physical or electronic, as long as this copyright notice is retained on all copies. Commercial redistribution is allowed and encouraged; however, the author would like to be notified of any such distributions.
All translations, derivative works, or aggregate works incorporating any Linux HOWTO documents must be covered under this copyright notice. That is, you may not produce a derivative work from a HOWTO and impose additional restrictions on its distribution. Exceptions to these rules may be granted under certain conditions; please contact the Linux HOWTO coordinator at the address given below.
In short, we wish to promote dissemination of this information through as many channels as possible. However, we do wish to retain copyright on the HOWTO documents, and would like to be notified of any plans to redistribute the HOWTOs.
If you have questions, please contact Tim Bynum, the Linux HOWTO coordinator, at linux-howto@sunsite.unc.edu via email.
Although I have tried my best to bring out various facts, the author is not responsible for any damage due to the actions taken based upon the information contained in this document. It is impossible to test the things under all the configurations, so probably some of the hints given in this document may be buggy and may not work on your system. In case you trace the bug, let me know it first !
This document is provided ``as is''. I put great effort into writing it as accurately as I could, but you use the information contained in it at your own risk. In no event shall I be liable for any damages resulting from the use of this work.
In case you are planning to include this HOWTO on some distribution medium or in print, I will like to have an acknowledgement e-mail (just for my record). In that case, I may also be able to send you the latest version of the document.
This is not a step by step HOWTO. The reader is expected to first read the entire document so that he (or she) becomes aware of the possible pitfalls and performance bottlenecks. After having a fair idea as to what steps are to be taken, he (or she) can then follow the next section in a step by step manner. Since you will be playing as a root and that too with the system initialization files, be alert as to what you are doing. Write in those files comments for those sections that you added, and when you want to remove a section, do not delete it. Instead just comment it out. (In shell scripts comments begin with a pound(#) sign). In case things go wrong, you may restore your original configuration by removing the changes you did. Although you are not required to know shell scripting since I have given all those that would be needed, some knowledge may be advantageous both for understanding as well for debugging.
NOTE: This procedure has been written keeping in mind !RedHat Linux 6.0 Although this procedure in general is applicable for all Linux distributions, the details may vary. You are welcome to add the details for your distribution. Many users will already have a swap partition devoted to Linux. I assume you have one.
*
Boot Linux. Turn off swapping by editing the /etc/fstab file and commenting the line that describes your swap partition.
*
*
Using fdisk under Linux, delete the swap partition in order to create free space on the disk.
*
*
Boot DOS. Create a DOS partition (using FDISK) the size = the size swap space you want. If you cannot create the partition (probably because DOS FDISK says that all the space in extended partition is allocated to the logical drive), you can use fdisk or cfdisk under Linux to create the partition. You can even just change the type of your swap partition from 82h (Linux Swap) to 06h (FAT16). In that case you don't need to delete the swap partition, just change the type.
*
*
Once you have created the partition, Boot DOS if you are not already in DOS. DOS will be assigned a drive letter to your new partition. Use that drive letter instead of X whenever these instructions lists a command like "LABEL X:" or "COPY FOO X:DUMMY.DAT"
*
*
Format this partition using the DOS FORMAT command.
C:\>FORMAT X:
*
*
Set the volume label on this partition to "SWAP SPACE" using the DOS LABEL command. Verify it by the DIR command. Please do this as a separate step. Some versions of FORMAT do not seem to put the volume label in the boot sector as it should.
lib/CachedMarkup.php (In template 'browse' < 'body' < 'html'):257: Error: Pure virtual
lib/InlineParser.php:336: Warning: Invalid [] syntax ignored: [[Note: some people has written me saying the volume label is (...repeated 30 times)
lib/BlockParser.php:552: Notice: Internal Error: no block advance
lib/CachedMarkup.php (In template 'browse' < 'body' < 'html'):257: Error: Pure virtual