Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I put my swap file on a hidden partition? 1

Status
Not open for further replies.

BarryMurphy

Technical User
May 20, 2001
56
NZ
I have a problem and a question. First my situation. I have a P166 with 32MG RAM and a 2GB hard drive, and I have done a clean install of Windows98. I wanted to put the swap file on its own partition at the beginning of the drive, and have separate partitions for software and data. I started by creating three primary partitions (using a DOS utility called PDisk), making the first one small for my swap file, and then activated and installed Win98 on the second. Next I transferred my swap file (using a utility called VoptXP) to the first partition, D:\, and set its min and max to the same value. My final step was to hide D:\ (using PDisk), so that no one could accidentally delete the swap file or save data on that logical drive (this PC is for the use of my sister and her two children who are all novices).

Now I know some people will want to tell me that I should let Windows control virtual memory, but I've done it this way, rightly or wrongly. At least this way the swap file won't get fragmented (I'm not confident that the users will appreciate the benefit of regular defragging). Anyway, my problem is this. When I hid D:\, Windows changed the drive letter of my data drive, which was E:\, into D:\, and at the same time put my swap file into it! There is now a copy of pagefile.sys in both my hidden drive and my data drive, but Win98's Virtual Memory dialog confirms my data drive to be the location of my swap file. How can I get my swapfile to stay in its hidden drive and not be transferred to my data drive? Or is this impossible?

My question is about a related issue. My swapfile is set to 77MB, which is roughly the size I want it to be, but to get 77MB of free space I had to create a partition of 118MB. Does anyone know why this is? There are no other files in that partition. With a data partition of only 671MB I don't want to waste 41MB. We must become the change we want to see. (Mahatma Ghandi)
 
1. If you hide the partition how can you expect windows to find it?! It needs to be unhidden to be used.
I suggest using tweakui if you are bothered about hiding it - you can 'hide' partitions from explorer in there by unchecking the appropriate drive letter in the My Computer tab. I don't think this affects windows ability to use the drive.

2. Did you set min & max to 77MB? If so, I've no idea.

PS. I honestly think you'd be better off with 2 partitions - if you set the swap file to fixed size on one of them you escape the fragmentation problems - it always uses the same area on the disk (which will be contiguous if you set it up just after installing o/s). Just my opinion.
 
1. Thanks wolluf, I hadn't thought of TweakUI; that's exactly what I need to do, hide the partition from users but not from Windows.

2. Yes, I set the min & max to 77MB because that's how much free space Windows indicted was in the drive. We must become the change we want to see. (Mahatma Ghandi)
 
Barry,

Setting a partition aside for the swap file is the right thing to do. Look at linux, you have to create a special partition called a swap partition.

The reason why your partition is 118mb is because you are probably using fat16 instead of fat32. You are using an odd program to create your partitions. You should use windows 98's fdisk program. What I usually do is create a windows 98 bootable recovery disk. That disk has everything you need to install windows 98. The fdisk program is a little difficult, but if you read the instructions you should have no problem (I don't think you'd have a problem). Just remember to say yes when it ask if you want large disk support (This enable fat 32).

As far as the partition size goes, I would give it 100Mb as well as giving that to your swap file. Then give at least 800Mb to windows it self and the rest to the other files.

Also your swap file doesn't have to be the first partition, it should be the last one. I believe this puts it more towards the outer tracks on the hard drive.

Good luck. Troy Williams E.I.T.
fenris@hotmail.com

 
Thanks Fenris, at least someone thinks I'm not crazy for putting the swap file on its own partition.

I did try to use FDisk at first, but I found that I couldn't achieve what I wanted with it. I wanted to create a small partition at the beginning of the disc for the swap file, and install Windows on the second partition. But FDisk required me to create a primary partition first and activate it before creating an extended partition and then dividing that into logical drives, thus Windows would always be on the first partition. Using Pdisk I was able to create three primary partitions, hide the first, and then activate the second. After installing Windows on the active partition, I was then able to unhide the first partition so that I could transfer the swap file to it.

The reason I put the swap file on the first partition is because it is on the outer part of the disc, which is the fastest part of the hard drive.

I'm afraid the missing 41MB is still a mystery as all three partitions are FAT32.

I'm interested that you think I need 100MB for my swap file. I have no experience in this area, and I had difficulty finding authoritative information on what size to make a swap file, but I read somewhere a rule-of-thumb that it should be roughly 2.5 times the amount of RAM. By that reckoning I should have made it roughly 80MB, not far from 77MB. We must become the change we want to see. (Mahatma Ghandi)
 
Barry,

Don't think you're crazy putting swap file in its own partition - just think the performance benefits are totally marginal. I've read various stuff about how big a swap file should be - but they never make sense to me. Swap file is only used when you've run out of free RAM (I've got a win98 installation on this machine that I run with no swap file I've got 512MB RAM which I consider more than enough). So, saying it should be a multiple of the RAM size doesn't make sense to me (1GB RAM, 2.5GB swap file? - no way!). I try to monitor how much RAM & swap gets used at maximum usage - and set swap file size to be a bit bigger than swap at max. Having said that, I would think c. 80MB will be fine for 32MB RAM (especially considering your shortage of space).

On the missing 41MB - how did you work out the 118MB? I would have expected you to create a partition the size you wanted your swap file & then set the virtual memory settings accordingly. It doesn't have anything to do with that 3rd party software you used when you were having trouble getting windows to accept a swap file on the first partition?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top