PDA

View Full Version : howto: swap file sharing in windows and linux


infra_red_dude
19-05-2006, 11:48 PM
a small that tells u howto share swap file between linux and windows. this is something i found out after researching the net for many many dayz. finally i found out that it was a piece of cake while i was getting confused over wot was given in various sites!

1) let windows swapfile reside on a separate partition wid fat32 file system and let it be of a fixed size preferably.
2) boot into linux and ensure that the partition is automounted at boot. note down the partition number.
3) create a suitable mount point for it say, /mnt/swap
4) issue the command: mkswap /mnt/swap/pagefile.sys (assuming pagefile.sys is the windows' swap file)
5) then issue the command: swapon /mnt/swap/pagefile.sys
6) there u haf it, a system that shares the swap file between linux and windows!

u might want to add the last two lines as a startup script. put the scrip in the init.d folder and make sure that the partition is mounted before the script is executed!

i was going crazy looking at complicated steps given at various sources...but somehow i figured out this method...which is something which even a n00b can perform!

cheers!

vignesh
20-05-2006, 02:01 PM
Nice tip.....

I don`t think its a good practise to have a swap file on a mounted partition..Have it on /tmp or something..

infra_red_dude
21-05-2006, 12:24 AM
how do we do it for /tmp? i mean how can windows share the partition then? how do we do that? create a hard link?

vignesh
21-05-2006, 09:26 AM
No windows can`t share the swap file..

infra_red_dude
21-05-2006, 11:40 PM
ok! but my intention was to share swap file b/w linux and windows to save that half a gb of space...

anyways i did find out other things on the net..but they were like too messy...i find this method quite viable! :)

vignesh
22-05-2006, 03:46 PM
Thats fine... Nice tip though.If you have time paste those findings here...

infra_red_dude
22-05-2006, 08:10 PM
these are some of those:

http://tldp.org/HOWTO/Swap-Space-6.html
http://www.ibiblio.org/pub/linux/docs/faqs/Swap-space-FAQ
http://www.ibiblio.org/pub/Linux/docs/HOWTO/unmaintained/Swap-Space