Installing Win/Linux shared swap on old swap partition

Installing Win/Linux shared swap on old swap partition

Post by Stephen Bens » Sun, 27 Nov 1994 22:20:17



I need to convert my swap partition into a shared win/linux swap partition,
without having to touch the other partitions. This is my setup (Slackware
2.0):

chromace:~# df
Filesystem         1024-blocks  Used Available Capacity Mounted on
/dev/hdb1             169268  141720    19085     88%   /
/dev/hdb3              47190   41829     3002     93%   /mnt
/dev/hda1             239064  214524    24540     90%   /dos-c
/dev/hdb4             100106   74974    25132     75%   /dos-d
/dev/sbpcd            662038  662038        0    100%   /cdrom

chromace:~# more /etc/fstab
/dev/hdb1        /              ext2         defaults
/dev/hdb2        none           swap         sw
/dev/hdb3        /mnt           ext2         defaults
none             /proc          proc         defaults
/dev/hda1        /dos-c         msdos        defaults
/dev/hdb4        /dos-d         msdos        defaults
/dev/cdrom       /cdrom         iso9660      ro

Basically I think I know what to to do; I've got the latest mini-howto I could
find (April '94) but I have 2 questions:

1... is there anything I should know that isn't in the howto -- later
     version, recent discoveries/bugs/problems etc?

2... I assume that if I go into Linux, swapoff /dev/hdb2, and remove
     the line "/dev/hdb2        none           swap         sw"
     from my fstab, I can then boot DOS, and proceed with every step
     except number 1: create the partition (which is already there), rather
     I'll create a DOS partition in that same space, give it a drive number
     and label it SWAP SPACE. And when I boot Linux nothing * will happen
     b/c something's looking for a non-exisant swap partition.

When I come back into Linux I presume I try to do my editing/symlnks with low
memory usage tools. Does this all sound about right? Or have I missed
something crucial (it's a few months since I installed and played with all
this stuff. I've checked the docs but am still wary of missing something; can't
afford any*-ups right now).

--                                            

 
 
 

Installing Win/Linux shared swap on old swap partition

Post by Peter Bark » Fri, 02 Dec 1994 05:55:24



>I need to convert my swap partition into a shared win/linux swap partition,
>without having to touch the other partitions. This is my setup (Slackware
>2.0):
>chromace:~# df
>Filesystem         1024-blocks  Used Available Capacity Mounted on
>/dev/hdb1             169268  141720    19085     88%   /
>/dev/hdb3              47190   41829     3002     93%   /mnt
>/dev/hda1             239064  214524    24540     90%   /dos-c
>/dev/hdb4             100106   74974    25132     75%   /dos-d
>/dev/sbpcd            662038  662038        0    100%   /cdrom
>chromace:~# more /etc/fstab
>/dev/hdb1        /              ext2         defaults
>/dev/hdb2        none           swap         sw
>/dev/hdb3        /mnt           ext2         defaults
>none             /proc          proc         defaults
>/dev/hda1        /dos-c         msdos        defaults
>/dev/hdb4        /dos-d         msdos        defaults
>/dev/cdrom       /cdrom         iso9660      ro
>Basically I think I know what to to do; I've got the latest mini-howto I could
>find (April '94) but I have 2 questions:
>1... is there anything I should know that isn't in the howto -- later
>     version, recent discoveries/bugs/problems etc?
>2... I assume that if I go into Linux, swapoff /dev/hdb2, and remove
>     the line "/dev/hdb2        none           swap         sw"
>     from my fstab, I can then boot DOS, and proceed with every step
>     except number 1: create the partition (which is already there), rather
>     I'll create a DOS partition in that same space, give it a drive number
>     and label it SWAP SPACE. And when I boot Linux nothing * will happen
>     b/c something's looking for a non-exisant swap partition.
>When I come back into Linux I presume I try to do my editing/symlnks with low
>memory usage tools. Does this all sound about right? Or have I missed
>something crucial (it's a few months since I installed and played with all
>this stuff. I've checked the docs but am still wary of missing something; can't
>afford any*-ups right now).

In one of the HOWTOs it has a method where you setup a partition for swap
under DOS, then run Windows, create a swapfile in the whole of this
partition, exit Windows (DO NOT restart, i.e. do not let Windows use the
swapfile yet). Then boot Linux and use dd to copy the swap partition to
a file. Compress this file. Then you can use makeswap and swapon (I think)
to use this area as Linux swapfile. Before exiting Linux, use gunzip and
dd to restore the first 100 blocks of the swapfile ready for DOS. (Put
the commands in rc.d to make and turn swap on, and to restore DOS swap).
The HOWTO says to initially copy the whole partition using dd, but only
restore 100 blocks. I don't see the point in copying whole partition if
you are only going to restore 100 blocks, so I only copy and restore
200 blocks. Note you only do the copy once - when you first set up the swap
area.
I hope this helps.
--

                               |  Telephone     +(612) 315 8554

 
 
 

1. WIN95 Linux share a swap partition from new linux install?


You can do it best like this (please don't quote me on the exact names
of commands and locations, it's been a while since i installed it on
my Linux box, it has been running without a problem):

1) Make the D drive empty and temporarely do NOT use it as a swap
   drive for Win95. So Drive D should be empty and formatted correctly
   with MS-DOS
2) Go into Linux
3) In linux save the first few blocks (128K or so) from /dev/hda2 with
   dd if=/dev/hda2 bs=512 count=256 | compress > /etc/hda2_copy.Z
4) Put in your rc.local a mkswap command (or what was it) for
   /dev/hda2, and and swapon (or what was it)
5) Put the restore of the hda2_copy.Z file in the appropriate rc file
   (don't remember which) so that it is executed when you shutdown the
   system (i do that with CTRL-ALT-DEL).

Then Windows 95 will see an empty drive D on which to put its swap.
Linux will recreate its swap space each time it boots. It's is fast
enough :-)

If you want a permanent swap file tou should set that up first, then
save the file in Linux. You don't have to save more than 128K or so
because the contents of the Swap-file is not important information,
only the header containts some critical information.

I am using this mechanism for a shared swapfile between Windows 3.11
and Linux.

Klaas

2. UDP SOCKET: CANT RECVFROM

3. Win 95, Win 3.1 and Linux sharing the same swap?

4. Login problem

5. Linux Swap Partition and Win3.1 Swap File

6. Huge problem with MOUNT Floppy on FreeBSD 3.4

7. Same space for OS/2 swap file/Linux swap partition?

8. MGETTY .99 + Slack 3.0

9. Putting OS/2 Swap in the Linux Swap Partition?

10. will linux use swap partition AND swap file at the same time

11. Win 3.11 swap file = Linux Swap?

12. slakware install won't recognize 2nd swap partition

13. That Old Linux/Solaris Swap Partition Question.