PDA

View Full Version : How To use Linux Swap Partition as windows Swap file


jsnipe
August 27th, 2006, 07:14 PM
I came across this neat little trick while researching another issue, installed it and have been running it for about two weeks. That being said, I only use win XP for morrowind, so I can't say I've fully verified this programs functionality.

How to use linux swap partition as windows swap file:

1. Go to the website below, and download the swapfs zip file to a windows accessible folder:
http://www.acc.umu.se/~bosse/


2. Write down the location of your linux swap partition (for example, mine is the 4th partition on the first drive; /dev/hda4 or (hd0,4). hda=hd0, hdb=hd2, etc... If your drive is sdaX, check your bios settings to determine which drive it is.
(Do not include extended partitions, only primary and logical).

3. Extract the contents of the zip file to its own folder, and open up the file "swapfs.reg" for editing, changing the two lines that read "\\Device\\Harddisk0\\Partition1" to the location of your linux swap partition (in my case "\\Device\\Harddisk0\\Partition4").

4. Copy the driver (swapfs.sys) to "%systemroot%\system32\drivers\".

5. Reboot, and verify you swap settings under system settings, in the control panel (you may have to turn off the old paging file manually).

6. Enjoy the extra disk space!



these instructions are also included with the zip file, along with the source code for the original program. This works great because the swap data contained in linux and windows is forgotten after every reboot, so why not utilize the same space?

P.S- I didn't write this program, I found it while googling another issue.

HAARP
August 27th, 2006, 08:26 PM
I'd definately use this if I still used Windoze :)
How about moving it to Howtos? Any mod?

jsnipe
August 27th, 2006, 09:24 PM
I thought about moving it to HowTo's, but it seemed more relevant to the people still using windows (who are for the majority, gamers). If enough people request it I suppose I could move it.

Laibcoms
December 22nd, 2007, 05:44 AM
Move it out from the gaming forums ;)

Even non-gamers will need that info. There are people who really have no choice but to keep WinXP or WinVista installed - too many factors that prevents us from removing WinXP/WinVista even though we do not use it ourselves. Too many reasons not to.

:) I'm just lucky I just know the proper keywords to search and the bots still indexes this thread, so I found this thread :p

Thanks for sharing it.. useful. :D More free space to use now!

goldmund99
September 7th, 2008, 04:29 PM
Thank you for the howto! But I had some problems to determine the partition number. Finally I got it using this method:

1) On Windows XP select Start->run->"cmd"

2) run "diskpart"

DISKPART> list disk


. Disk n. State Size Free
. -------- ---------- ------- ---- ...
. Disk 0 Ready 233 GB 0 B

DISKPART> select disk 0

DISKPART> list partition

. Partition n. Type Size Offset
. ------------- ---------------- ------- -------
. Partition 1 Primary 49 GB 32 KB
. Partition 2 Unknown 178 GB 49 GB
. Partition 3 Extended 5938 MB 227 GB
. Partition 4 Logic 5938 MB 227 GB

DISKPART> exit

3) Then harddisk number is 0 and the swap partition is the extended one (3)

Bastaard
September 9th, 2008, 11:24 AM
This should definitely be in the How To section. I for one am not a gamer and still use this trick.

Artificial Intelligence
September 9th, 2008, 11:28 AM
Going to move it then.

Steve Fisher
September 10th, 2008, 05:08 PM
This seems like a great idea, but before I go and do something terrible, could someone just look over this for me please?

I've got a single hdd. There's Dell utilty partition (FAT) at the start of the drive, then XP in the second, primary partition. Next is my Ubuntu patition (ext3), then an extended partition which contains my Home partition and my Swap partition.

So am I right in saying that I need to edit the reg file to say disk 0, partition 4 (the extended container)? Even though Ubuntu sees the swap as partition 6?

. Disk n. State Size Free
. -------- ---------- ------- ---- ...
. Disk 0 Online 28 GB 0 B

DISKPART> select disk 0

DISKPART> list partition

. Partition n. Type Size Offset
. ------------- ---------------- ------- -------
. Partition 1 OEM 47 MB 32KB
. Partition 2 Primary 5114MB 47MB
. Partition 3 Unknown 9GB 5162MB
. Partition 4 Extended 14 GB 14GB
. Partition 5 Logical 13 GB 14GB
. Partition 6 Logical 957 MB 27 GB