howto: swap file sharing in windows and linux

Discussion in 'Open Source' started by infra_red_dude, May 19, 2006.

Thread Status:
Not open for further replies.
  1. infra_red_dude

    infra_red_dude Wire muncher!

    Joined:
    Nov 5, 2003
    Messages:
    6,156
    Likes Received:
    5
    Trophy Points:
    0
    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!
     
  2. vignesh

    vignesh New Member

    Joined:
    Jul 20, 2004
    Messages:
    1,658
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Chennai
    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..
     
  3. OP
    OP
    infra_red_dude

    infra_red_dude Wire muncher!

    Joined:
    Nov 5, 2003
    Messages:
    6,156
    Likes Received:
    5
    Trophy Points:
    0
    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?
     
  4. vignesh

    vignesh New Member

    Joined:
    Jul 20, 2004
    Messages:
    1,658
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Chennai
    No windows can`t share the swap file..
     
  5. OP
    OP
    infra_red_dude

    infra_red_dude Wire muncher!

    Joined:
    Nov 5, 2003
    Messages:
    6,156
    Likes Received:
    5
    Trophy Points:
    0
    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! :)
     
  6. vignesh

    vignesh New Member

    Joined:
    Jul 20, 2004
    Messages:
    1,658
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Chennai
    Thats fine... Nice tip though.If you have time paste those findings here...
     
  7. OP
    OP
    infra_red_dude

    infra_red_dude Wire muncher!

    Joined:
    Nov 5, 2003
    Messages:
    6,156
    Likes Received:
    5
    Trophy Points:
    0
Thread Status:
Not open for further replies.

Share This Page