Swap file partitioning

Status
Not open for further replies.

codeseven

Posts: 32   +0
I've read that its best to locate your page file(swap file)to the beginning and therefore fastest part of your disk drive. What's the best way to do that? I have Partition Magic 8.0,which I have never used,but is just partitioning an area on my 'C' drive for a page file all I would have to do? How then would I actually assign my page file to that partition? I'm running XP Home using NTFS on a 40gig HD with 38% unused space available. Thanks
 
I would make your system partition first and your swap file second. It can save you alot of hassle when installing programs and the default install dir is C: and you always have to change it to D:. You won't notice any performance difference if it was on the leading edge.

Or if PM8 (never used it) supports specific partitioning, start the C: partition at block 2049. Then start your D: partition at 1, to 2048. This will make your swap file partition 2GB, which is plenty. You can make it smaller if you like, but mine are always 2GB...

I'm sure that would work!
 
If you have a lot of time on hand (and a reliable power company ;) ), just move your C: partition forward by 1-2 GB, then create a new partition in the empty space in the beginning of disk. Drive letter assignment shouldn't be a problem, you can do it PM8 and Windows itself.

Windows booting mechanism will be messed up, so you will have to change your "boot.ini" file and/or fix your installation by using Recovery Console.

Or just clean up the HD, repartition and reinstall..

And another point - the swap file is dead slow no matter where it's located. Unless you are frequently doing some video editing or sth else non-interactive and requiring large amounts of memory, you will probably not notice a performance increase.

You will get more performance just by using an unfragmented fixed-size swapfile somewhere on the disk (unless you're doing that already, of course).
 
Nothing beats getting more memory - Swapping should be a bare minimum if at all possible.

But when my computer does do an annoying amount of swapping, I have a 1gb C: partition dedicated to my swapfile. The benfits are two fold... 1.) Way faster access times since it is a small partition with basically no other data on it. 2.) It is located physically, on the fastest part of the drive. This means transfer rates are about 50% better than compared with the end of the disk.
 
The best way I found to do it is to Set the system pasrtition first(C:) then swap file(D:, so it is close to the beginning, then change the letter to one that you won't ever use like S:) Then make your other partitions. The swapfile should be about 1.5x RAM amount but don't exceed 350MB because this just slows down the swap process(according to "experts") Also if you have more than 512MB you may be able to have no swapfile, providing you don't use apps which use it. This would include most graphics applications as well as some others.

My swapfile resides on a dedicated partition and the swapfile is sized to fit the partition. The swapfile is 345MB and the partition is almost the same size(as close as the system allows anyway) This prevents the swapfile from fragmenting, setting the minimum and maximum size to the same also prevents fragmentation of the swapfile.

**The 345MB was what I found to be best for this system because I have 1.5 GB RAM but I use several apps which rely on the swapfile so I am forced to keep it.
 
one idea is to have a small boot partition with just the boot environment on it (say about 100MB or so). Then the swap partition. Then the operating system(s)
 
Thanks for your help and suggestions guys,I really appreciate it. I have 512mb SDRAM. MS recommends a 1024mb swap file for their CFS3 game. I was doing a defrag without a swap file assigned(I read this would allow a 'complete' defrag to take place)and watched as several blue lines merged into one leaving 85% of my HD free. Then I configured the 1024mb swap file and the next time I defragged a big fat green line(the swap file?)appears right in the middle bordered on both sides by large,blank, open space,not on a leading edge where I heard it would be optimal. Thats why I was looking into moving it or creating a partition for it.
 
Originally posted by Phantasm66
one idea is to have a small boot partition with just the boot environment on it (say about 100MB or so). Then the swap partition. Then the operating system(s)

I never thought about that Phant, is there any great benifit in this?
 
well with the swap file on its own partition, where it will never get fragmented, and near the start of the drive where the access times are greater, certainly anything that's swap intensive will benefit a great deal.

having a dedicated boot partition is nice if you have lots of operating systems. you can easily backup the partition with drive image and restore VERY quickly because there's very little data. FAT32 is great for this, allowing you to edit configuration files in DOS merely by booting from an WIN98 rescue disk.

In the end, you could do lots of experiments with partitioning and there are many different schemes, lots of which have their good points and bad points. these are just some ideas.
 
Try moving the swap file to the start of your second drive,
presuming that it is assigned as the "master" on your
secondary IDE channel. This way there is no I/O contention
either. The OS and Swap file can be accessed simultaneously.
 
Phant, I already knew of the benifits of the Swapfile on a separate partition, mine has been that way for quite a while now.

I was only refering to the part about the boot partition which you also provided much appreciated info on. I'll have to try that out on one of my experiment machines.
 
Originally posted by Mudshark
Try moving the swap file to the start of your second drive,
presuming that it is assigned as the "master" on your
secondary IDE channel. This way there is no I/O contention
either. The OS and Swap file can be accessed simultaneously.

Yeah, that's even better. Putting the swap file on another disk or indeed another disk on another controller.


StormBringer,

The boot partition thingy is really stolen from linux where this was one suggested partitioning strategy for a while. On a machine with many different operating systems the active marked primary partition becomes VERY important, and its not uncommon for certain operating systems and software like partition magic, drive image, etc to mess with config files there without permission, sometimes in an undesireable way.
If you have a really small boot partition with just the boot environment on it, you can drive image it very quickly and restore it very quickly (I mean like in under 10 secs, etc) if there is a problem. You can also keep records of older ones, etc. I have found all of this pretty useful. And as I said, if its FAT32 then its accessible simply with a win98 rescue disk, you can edit with edit.exe command. I've got out of a lot of nasty scrapes with that.
 
Originally posted by StormBringer
Phant, I already knew of the benifits of the Swapfile on a separate partition, mine has been that way for quite a while now.

I was only refering to the part about the boot partition which you also provided much appreciated info on. I'll have to try that out on one of my experiment machines.

The boot partition (C:) is also, by default, located at the front end of the drive. This means higher sustained thoroughput as well.
 
An interesting idea is that you could use the c: just for boot environment AND swap.

The idea behind a swap partition is that the swap file is the only file on there, and as such does not get fragmented.

However the other files on a boot partition will be MUCH smaller and are not likely to be continually deleted, rewritten, etc. So fragmention will be very minimal

So one idea is to use the c: drive for the boot environment AND swap.

This is however a bit crap when it goes to drive imaging. You'd then be drive imaging the swap file as well which is a waste of time and disk space. You could investigate deleting it first in a command prompt.

However, as I said the best file system to use for the boot partition is FAT32, but NTFS would be better for a swap partition for Windows 2000/XP, etc, as it has smaller cluster sizes and generally has better performance. So this is a case against the mixed boot and swap partition. Ultimately, the best system would be:

1)Active marked primary partition c: boot files only.
2)Swap partition
----Followed by operating system partitions.

If you are dual booting with linux, you might want to have your swap partition immediately following 3), so that BOTH swap partitions are located before ANY operating systems.
 
Here... try this. It's a Swap/Pagefile defragger :
http://www.sysinternals.com/ntw2k/freeware/pagedefrag.shtml

In fact, check out some of the other goodies at this site..... they
have some cute Utils.
One word of warning though.... after the defrag, Windows can't
find the swapfile..... just go in and re-"set" it - the settings will still be there
and all will be well.... this is normal.
The defragger defrags all the system files even the Reg. hive....
and it's free. In fact all their stuff is free.
Also try this one:
http://www.sysinternals.com/ntw2k/freeware/contig.shtml
"force" contig. file alocation. ;-)
 
Two of my boxes have no swapfile, and those that do all have their own partition for swap.

2gb swap? That's way excessive, unless you are doing massively heavy audio/video editing.
 
Originally posted by Phantasm66
my page file never gets fragmented because its on its own partition....

Sure... even if you set the min. and max. sizes of the swap file
to the same amount, it should never become fragmented even
if it shares a disc, the file will be permanently allocated.

The Contiguous Utility is great if you have only one drive and
want to reserve space at the start of the disc for the swap file
before you start installing the OS.
That is if you don’t want to go the dedicated partition route.
 
if a file is the ONLY file on a partition, or the largest file with only a couple of MUCH smaller files, it won't really get fragmented at all, even if that large file changes size. fragmentation is mainly caused by having lots of different files on a partition.

the min and max setting being the same thing refers to swap files which are on the same partition as the operating system. that helps to prevent fragmentation in that case. but it does not apply to a model where you have a dedicated swap partition with on the the swap file on there. that can grow and shrink and not get fragmented.
 
Originally posted by Soul Harvester
2gb swap? That's way excessive, unless you are doing massively heavy audio/video editing.

I've done some video editing before, and plus I have 120GB available so I might as well :D

My swap file doesn't get fragmented anyway, either. Best way to do it is have it's own little partition. For people not like me, 1GB should be plentiful, usually I don't use any more than 768MB.
 
So, the fastest area of hard disk drive is the outer part, right?
And partitioning begins from outer tracks, right? Not like with CD-ROMs?
 
I would have thought that the outer part of the drive (physically) would be the best place for swap (after os maybe), because each revolution reads more data than each revolution on the physically inner part of the drive.
I have been confused by front end and other things, but if the hard drives start from the outside and write in towards the center of the physical disk then everything makes sense. If not I may require further reading on how these things work to understand the recommendations.
 
Originally posted by Mictlantecuhtli
So, the fastest area of hard disk drive is the outer part, right?
And partitioning begins from outer tracks, right? Not like with CD-ROMs?

Indeed. Although you can designate the main, first partition to start at say block 1025 and go all the way to 10k or smth like that, then make the 2nd part go from 1-1024. Good trick of the trade :cool:
 
I have an oldish 1.9gb 5400rpm hdd which I am thinking of using only for the page file, thus removing it from my system hdd (7200 rpm). Is there any point in doing that as the hdd is slower? And if so to which file system should I format the drive?
 
Status
Not open for further replies.
Back