I am dual booting my system with Ubuntu 12.04 and Windows 7. I have created the special swap partition for Ubuntu while installing (as recommended).
Can Windows use this swap area/partition--as its own swap/page file--when I boot from Windows?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
Note: This is a what-if answer and is not recommended, especially if you are using hibernate from Ubuntu!
In theory, yes, Windows should be able to use your swap partition for its page (swap) file with some clever scripting on the Linux side.
I'm not going to do a step-by-step because I haven't tried it and if you can't figure out how to implement this you shouldn't be trying it either :)
Format the partition as NTFS from within Windows and set up Windows to use that drive exclusively for its swap file (nothing on C:)
Have a startup/upstart script to format the partition as Linux swap on Ubuntu startup and enable swap (
Have a shutdown script to swapoff and reformat the partition as ntfs.
Alternative (still not recommended) option:
You can create a swap file by following this guide on the NTFS partition, provided the NTFS partition is large enough for both swap files.
However this alternative is not recommended because:
If your goal is to save hard drive space -- not having to waste many GBs for both Linux's swap and Windows's pagefile, then you might consider using dynamic swapfile size on linux via SwapSpace:
I haven't tried it myself but you can mount a swap partition with swapfs. You can then, in theory, place your pagefile there (there's some good reasons not to, such as minidumps, but its an option).
It works great.
Whats needed? Just follow the instruction in the SwapFs-3.0 file.
Also you could find some helpful stuff at How To use Linux Swap Partition as Windows Swap file on Ubuntuforums.org.
At first I tried to format swap space into NTFS but turned out that Linux lost ability to recognize it as an own created.
Then I reformatted it back to classical Linux swap.
Next I changed back fstab. Was:
UUID=4c6a4... none swap sw 0 0
Deactivated that and put instead:
/dev/sda7 swap swap defaults 0 0
If I remember well, after I booted into Windows it didn't recognized it as RAW or if I could have formatted it as FAT32.
And everything started working.
But a problem appear. Namely my Vista 'attached' an additional letter, thus at last had two drivers but in fact linked with the same partition 'e:\' and established by me as 's:\'.
Fortunately it was enough to get to the registry to place recommended in *.reg file, from 'SwapFs-3.0'. Turned out that the extra additional record 'e:\' should be removed from registry.
Right now enjoying inter-system swap space without problems. Recovered 3.2 GB space.
I would like to mention that using Linux just 4 three months and be able to do such complicated operations, thus you could do this without any enormous effort.
Things have changed... There used to be an IFS driver that could read Linux Partitions (primarily for EXT3 at the time) IFS by the way means Installable FileSystem - which may have began in MS-DOS 4 (I previously thought it was an element from OS2 that remained in Windows), there were some interesting things you could do with IFS, like create a RAM Drive, and assign it a drive letter. (these days imdisk is probably a better way of doing that) Along with EXT2IFS (and later ext2fsd) was the ability to access Linux Swap Partitions from within windows. So all you needed to do was use the small drive manager utility that came with the filesystem driver to assign a drive letter to the Swap Partition and tell windows to use that for the I think it was the swapfile.sys file, etc... Nowerdays Windows10 since the Anniversary update require Signed Drivers and most IFS drivers currently do not function at least for me, which, sadly, robs me of access to my EXT2 and HFS+ partition data from within Windows. So the answer has essentially become no longer. But for older Versions (such as Win7 or XP) it's quite plausible to do by the method I stated here.