Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Windows 9x + Linux shared swap file/partition?

Featured Replies

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?


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

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.

  • Author

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).

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

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

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

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.

  • Author

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?

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
  • Author
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

 

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

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.