Here you will find various ways of manually creating a dummy file to be used as a coLinux swap partition.
|Note: The content of the swap file doesn't matter, you'll only need a file with the appropriate size.|
For details how to add a swap partition to coLinux, see the AddSwapPartition page.
|Note: After replacing the swap file, if you have the message "Unable to find swap space signature", you may need to do the following:|
Using (copy) an already existing file
If you already have such a file with the desired size in your Windows system, you can simply copy that one into the coLinux directory, and name it as you want, eg. swap-file.
Using Windows-builtin tool fsutil (XP and later Only)
|Note: You must have administrator privileges to call fsutil.|
Go to Start->Programs->Accessories->Command Prompt
fsutil file createnew c:\colinux\swap_file 1000000000
Instead of 1000000000, you could use the following sizes:
- 64M: 67108864
- 128M: 134217728
- 256M: 268435456
- 512M: 536870912
- 1024M: 1073741824
It creates sparse files, so the creation is very quick.
Additional info: http://www.winnetmag.com/Article/ArticleID/40935/40935.html.
One of the features of Sysinternals Contig is the creation of files. It then attempts to defragment the file:
contig -v -n swap-file 536870912
will create a 512Mb file.
It is possible with Cygwin by using a Unix command like dd :
dd if=/dev/zero of=swap-file bs=1024k count=512
will create a 512*1024*1024 bytes aka 512Mb file.
Very stupid way how to create any file, preferable 2^N size:
- Open notepad, create a new text file containing only the letter "a" and save it as "swap.txt"
- Go into the directory containing "swap.txt" and check that it is only one byte using dir.
- Double the size of the file as required by using "type swap.txt >> swap.txt".
- Each time you call the previous line, it will double the size of the file. Executing it 10 times will give a one kilobyte file. 20 times will give a one megabyte file.
Times executed=Resulting filesize(mb)
20=1mb 21=2mb 22=4mb 23=8mb 24=16mb 25=32mb 26=64mb 27=128mb 28=256mb 29=512mb 30=1024(1gb)
Or you could type on COMMAND(DOS) window:
>copy con myfile 12345678^F6 >type myfile>>myfile >...... repeat,repeat,repeat,....
Using Bochs Windows port
It's easy to create a file of a given size on Windows using the Bochs Windows port. You need their tool called 'bximage' to do the job.
a.) Go to the Bochs Download Page:
and download bochs-2.1.1.win32-bin.zip.
b.) Extract from this archive the file 'bximage.exe' which is a stand-alone binary and put it in a suitable directory.
c.) Open up a Windows Command Prompt, cd to the coLinux installation directory, and run bximage.
d.) Create a hd image, flat image.
e.) Specify the size of the swap file you want in MB (I created a big 1024MB swap file).
f.) Choose the file name you want (e.g., swap-file).
g.) Ignore the bochsrc info statement and hit enter. You're done creating an empty file to use as a swap file!
There is a native WIN32 dd port at http://gnuwin32.sourceforge.net/packages.html (search for GNU fileutils).
There's another very nice Win32 dd port at http://uranus.it.swin.edu.au/~jn/linux/rawwrite/dd.htm.
MassTranslated on Sun Apr 23 17:36:18 UTC 2006