Jump to content

Windows 9x + Linux shared swap file/partition?


Recommended Posts

Posted

Hi.

Again I find myself attempting to set up a old pc for someone. Based on it's specs, I was going to try installing an older Windows on it, along with a Linux that could run modern programs. (Native Linux, or WiNE)

My main question is:

Is it possible to set up a shared swap-space/page-file on a separate partition from the OSes?

Yes, I know Linux uses a partition, and Windows uses a file on a partition.

Would there be some way for me to max out the size of the Windows paging file to the size of the partition, assuming the min & max sizes are the same?


Posted

Yes, I know Linux uses a partition, and Windows uses a file on a partition.

Would there be some way for me to max out the size of the Windows paging file to the size of the partition, assuming the min & max sizes are the same?

Do you also know which filesystems the two OS actually use? :whistle:

jaclaz

Posted

It is not, or hardly, possible to put a Windows swapfile on a Linux swappartition, because it doesn't contain a filesystem. However, it is possible to use a file as swapspace for Linux. You'll have to add some commands to the Linux startscript, something like

mount /dev/hda5 /mnt/hda5

mkswap /mnt/hda5/pagefile.sys

swapon /mnt/hda5/pagefile.sys

I don't know which Windows will do with a swapfile which is used this way.

Posted

Yes, I know Linux uses a partition, and Windows uses a file on a partition.

Would there be some way for me to max out the size of the Windows paging file to the size of the partition, assuming the min & max sizes are the same?

Do you also know which filesystems the two OS actually use? :whistle:

jaclaz

They will both recognize the standard fat (16, 32) file systems...

I found some rudimentary instructions on the web, but they were tailored towards specific Linux distros (or Windows XP using the NTFS file system).

Posted
I found some rudimentary instructions on the web, but they were tailored towards specific Linux distros (or Windows XP using the NTFS file system).

Give pointers to them, they may be easier and faster to adapt to Win 9x/ME, than if we start inventing a method from scratch.

Then again... Mijzelf may just have hit jackpot with his idea, which should completely obviate the need for a swap partition... And, BTW, the name of the Win 9x/ME swapfile need not to be always win386.swp, it may be whatever you want: just use the directives exemplified below (add them, if the don't exist) at the [386Enh] section of SYSTEM.INI

PagingFile=J:\PAGEFILE.SYS 
PagingDrive=J:
MaxPagingFileSize=1835008
MinPagingFileSize=1572864

Also, BTW, do read these two pages: Sharing Swap Files and, particularly, Linux Swap Space Mini-HOWTO

Posted

They will both recognize the standard fat (16, 32) file systems...

Sure. :)

I was just only hinting what Mijzelf explicited, that the Linux "Swap partition" has actually NOT a filesystem, (the 0x82 ID simply means "don't mess with it" ;)):

http://www.win.tue.nl/~aeb/partitions/partition_types-1.html

As you pointed out, traditionally Linux uses this partition space as RAW, whilst you want to set up the Linux install to use a swap file, instead:

http://www.linux.com/news/software/applications/8208-all-about-linux-swap-space

http://linux.die.net/man/8/mkswap

jaclaz

Posted
I was just only hinting what Mijzelf explicited...

1st.gif jaclaz, The Finder, I hereby award you the 2010 trophy for the most transverse hint of the year!!! :D

Posted

I use swap files instead of swap partitions on all of my Linux installs (the only exception being my first experiment with Linux). And, it is possible to move the Windows swap file to a different partition as dencorso pointed out. So what you are wanting should be possible, provided Linux and Windows don't have a problem using the same file.

Posted

It is not, or hardly, possible to put a Windows swapfile on a Linux swappartition, because it doesn't contain a filesystem. However, it is possible to use a file as swapspace for Linux. You'll have to add some commands to the Linux startscript, something like

mount /dev/hda5 /mnt/hda5

mkswap /mnt/hda5/pagefile.sys

swapon /mnt/hda5/pagefile.sys

I don't know which Windows will do with a swapfile which is used this way.

Okay, two questions about this.

What if I already created a swap file through Windows, could I just use that with the swapon command?

And... how do I add this file to the startup script, is it the same for every generic Linux?

Posted
What if I already created a swap file through Windows, could I just use that with the swapon command?
Yes, after applying mkswap. But I don't know what Windows will do with the -now Linux- swapfile.
And... how do I add this file to the startup script, is it the same for every generic Linux?
No. Different distro's can use different ways to boot. But in many cases you can add the commands to /etc/rc.local or /etc/rc.d/rc.local
Posted (edited)
What if I already created a swap file through Windows, could I just use that with the swapon command?
Yes, after applying mkswap. But I don't know what Windows will do with the -now Linux- swapfile.

I loaded up the Windows 9x after doing this, and it seems to be fine.

And... how do I add this file to the startup script, is it the same for every generic Linux?
No. Different distro's can use different ways to boot. But in many cases you can add the commands to /etc/rc.local or /etc/rc.d/rc.local

Found it, thanks. (See above)

BTW - Is there any way for me to check to see if it's working properly, like a utility/command to see if it's being used?

Edited by HardDriv'n
Posted

 

BTW - Is there any way for me to check to see if it's working properly, like a utility/command to see if it's being used?
cat /proc/swaps
Posted

@HardDriv'n: once you're satisfied its working OK, you might put toghether a Mini How-To here, for others having the same need.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...