share swap file between linux and windows

Status
Not open for further replies.

infra_red_dude

Wire muncher!
i searched for this topic on this forum. but i couldnt find it anywhere. we haf a separate swap partition in linux. my question is whether the same swap partition can be shared wid windows? i mean the windows and linux swap file on the same partition? i'd read about this somewhere i dun remember the link. and ppl were successful in doing that...any linux gurus here can help??????
 

ujjwal

Padawan
Although the same swap file cannot be shared by linux and windows, I think it should be easy enough to have the linux swap file on the same partition as the windows one. However, follow these instructions at your own risk.

Make sure that your windows partition is set to auto-mount at start up (check the FC3 FAQ for details), and then create a swap file in the partition (I assume the partition is mounted at /mnt/win/c)

dd if=/dev/zero of=/mnt/win/c/swap_linux bs=1024 count=16000

This will create a file with null data of size about 16MB. Now use mkswap to make this a swap file -

mkswap /mnt/win/c/swap_linux

And now, add a line at the end of the file /etc/rc.d/rc.local

Code:
swapon /mnt/win/c/swap_linux

This automatically uses the file for swap space, every time the system starts. I added the line to rc.local to make sure that it is executed after the windows partitions are mounted.
 
OP
infra_red_dude

infra_red_dude

Wire muncher!
ok i installed fedora core 4 a couple of days ago and created a separated linux swap partition of about 520mb. now how do i implement this thing? i understand that i haf to format the partition as a fat32 one. how do i go about doing that?
 

ujjwal

Padawan
You dont need to convert the partition to FAT32, if you already have a FAT partition accessible by windows. Just ensure that this partition is auto mounted by linux at boot, and follow the steps I mentioned earlier.

Do remember that this will not share a swap partition between the OS's, but rather create a swap file on the same partition.

vignesh, linux can use either a swap partition or a file, in this case we are using a file.
 
OP
infra_red_dude

infra_red_dude

Wire muncher!
yeah thats wot i wanted. i can save about half a GB space by sharing the swap partition. i'll do as u said there and get back to u if need be. thanks!
 
Status
Not open for further replies.
Top Bottom