LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   common swap partition for XP & Linux (https://www.linuxquestions.org/questions/slackware-14/common-swap-partition-for-xp-and-linux-395678/)

jadukor 12-22-2005 12:05 PM

common swap partition for XP & Linux
 
Hi all
I am a newbie running Slackware10.2. I was just going through a book that I downloaded from TLDP. It showed a few steps for creating swap files. Something like this

$ dd if=/dev/zero of=/extra-swap bs=1024 count=1024
$ mkswap /extra-swap 1024
$ swapon /extra-swap

I still do not understand these commands fully, but I already have a 300MB swap partition for Linux, which to the best of my knowledge was never actually used, it is just sitting there. So I was wandering if it is possible to make a separate partition for swap files which can be used by both XP & Linux on my dual boot PC.

If such a swap partition is possible, then can someone please advise me on how to implement it.
Any link will also be appreciated.

Thanks

geeman2.0 12-22-2005 12:32 PM

Linux requires a special type of filesystem (called Linux Swap) for it's page files.
Windows can only read FAT or NTFS partitions for it's page files.

Thus I think what you are trying to do is impossible.
But I could be wrong...

aneroid 12-22-2005 02:09 PM

for a common "swap partition" for linux and windows: http://www.tldp.org/HOWTO/Swap-Space.html (main part starts here)

u can use a "swap file" as u've got it. btw, from the mkswap man page:
Code:

The  size  parameter is superfluous but retained for backwards compati-
bility.        (It specifies the desired size of the swap area        in  1024-byte
blocks.        mkswap will use the entire partition or file if it is omitted.
Specifying it is unwise - a typo may destroy your disk.)

in ur example
Quote:

Originally Posted by jadukor
$ dd if=/dev/zero of=/extra-swap bs=1024 count=1024
$ mkswap /extra-swap 1024
$ swapon /extra-swap

the 'dd' line reads and writes 1024 (bs) bytes at a time, 1024 times (count). it reads zeros from /dev/zero (if, input file) and writes it to /extra-swap (of, output file). 1024 bytes 1024 times is 1 MB. u may want a larger swap file ;-)

read the man pages.
quote:
mkswap sets up a Linux swap area on a device or in a file.
Swapon is used to specify devices on which paging and swapping are to take place.

anirudh


All times are GMT -5. The time now is 09:43 PM.