FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 01-23-2009, 04:16 AM
Grant Edwards
 
Default Howto share Linux swap partition with Windows XP

For reasons that probably aren't interesting, I needed to
eliminate the Windows XP swap file from the "C:" NTFS parition
of one of my multi-boot machines [no matter how cheap and fast
disks get, partitions still seem to fill up, and backups still
take too long].

That machine had a 2GB Linux swap partition. After googling for
a while, I found a very slick solution that lets Windows XP use
a Linux swap partition for swap/paging/vm/whatever-MS-calls-it:

http://db.bme.hu/~surprof/SwapFs-i/

Maybe others who do a lot of multi-booting all know about
swapfs, but my finding it took quite a bit of searching and
chasing down useless google hits. Next time I need to find it,
hopefully I'll be able to find this posting...

--
Grant
 
Old 01-23-2009, 11:44 AM
Stroller
 
Default Howto share Linux swap partition with Windows XP

On 23 Jan 2009, at 05:16, Grant Edwards wrote:

... I found a very slick solution that lets Windows XP use
a Linux swap partition for swap/paging/vm/whatever-MS-calls-it:

http://db.bme.hu/~surprof/SwapFs-i/


That looks a really cool & useful idea.

However, I have a reservation. Since you NEED to use it - perhaps for
space considerations? - the go for it, by all means. But if this
driver is slower at reads or writes than Windows' own NTFS driver then
it may actually slow the computer down.


In the case of a driver written by an individual, who is likely not as
familiar with Windows' APIs, or who may not be able to use the private
APIs used by Windows' own filesystem drivers, I find it quite possible
the performance may be questioned.


Stroller.
 
Old 01-23-2009, 01:58 PM
Grant Edwards
 
Default Howto share Linux swap partition with Windows XP

On 2009-01-23, Stroller <stroller@stellar.eclipse.co.uk> wrote:
>
> On 23 Jan 2009, at 05:16, Grant Edwards wrote:
>> ... I found a very slick solution that lets Windows XP use
>> a Linux swap partition for swap/paging/vm/whatever-MS-calls-it:
>>
>> http://db.bme.hu/~surprof/SwapFs-i/
>
> That looks a really cool & useful idea.
>
> However, I have a reservation. Since you NEED to use it -
> perhaps for space considerations?

Yup. Mainly because I use ntfsclone to keep a bunch of backup
copies of the NTFS partition, and having a 2GB swap file in
every backup copy starts to eat up a lot of disk space.

> - the go for it, by all means. But if this driver is slower at
> reads or writes than Windows' own NTFS driver then it may
> actually slow the computer down.

Could be. My understanding is that the system is still using
the Windows NTFS driver. I believe that swapfs is a
block-device filter driver that sits between the NTFS driver
and the bottom layer block device driver (the IDE driver or the
SATA driver or the SCSI driver).

> In the case of a driver written by an individual, who is
> likely not as familiar with Windows' APIs, or who may not be
> able to use the private APIs used by Windows' own filesystem
> drivers, I find it quite possible the performance may be
> questioned.

Well, there are several individuals who've worked on it. That
said, I can't swear that there aren't performance implications.
There probably are, since it adds a layer between the SATA
driver (in my case) and the NTFS driver. But, I haven't
noticed any visible slow-down, and the machine is more than
fast enough for my purposes.

Besides, if you're running MS Windows, you've already lost the
war when it comes to swapping performance: anybody who cares
about swap performance wouldn't be using a normal file on a
normal filesystem for it...

Someday when I'm bored, maybe I'll google for a file I/O
benchmark for windows and run it with and without the swapfs
layer.

--
Grant Edwards grante Yow! INSIDE, I have the
at same personality disorder
visi.com as LUCY RICARDO!!
 
Old 01-23-2009, 03:08 PM
Stroller
 
Default Howto share Linux swap partition with Windows XP

On 23 Jan 2009, at 14:58, Grant Edwards wrote:


On 2009-01-23, Stroller <stroller@stellar.eclipse.co.uk> wrote:


On 23 Jan 2009, at 05:16, Grant Edwards wrote:

... I found a very slick solution that lets Windows XP use
a Linux swap partition for swap/paging/vm/whatever-MS-calls-it:

http://db.bme.hu/~surprof/SwapFs-i/


That looks a really cool & useful idea.

However, I have a reservation. Since you NEED to use it -
perhaps for space considerations?


Yup. Mainly because I use ntfsclone to keep a bunch of backup
copies of the NTFS partition, and having a 2GB swap file in
every backup copy starts to eat up a lot of disk space.


It might be possible to script removing the swap file at shutdown (or
place a wrapper script to mount the partition & remove the swapfile
before running ntfsclone). But I appreciate this is less elegant than
just using the same swap partition for both o/s.


Stroller.
 
Old 01-23-2009, 04:02 PM
Grant Edwards
 
Default Howto share Linux swap partition with Windows XP

On 2009-01-23, Stroller <stroller@stellar.eclipse.co.uk> wrote:
> On 23 Jan 2009, at 14:58, Grant Edwards wrote:
>> On 2009-01-23, Stroller <stroller@stellar.eclipse.co.uk> wrote:
>>> On 23 Jan 2009, at 05:16, Grant Edwards wrote:
>>>> ... I found a very slick solution that lets Windows XP use
>>>> a Linux swap partition for swap/paging/vm/whatever-MS-calls-it:
>>>>
>>>> http://db.bme.hu/~surprof/SwapFs-i/
>>>
>>> That looks a really cool & useful idea.
>>>
>>> However, I have a reservation. Since you NEED to use it -
>>> perhaps for space considerations?
>>
>> Yup. Mainly because I use ntfsclone to keep a bunch of backup
>> copies of the NTFS partition, and having a 2GB swap file in
>> every backup copy starts to eat up a lot of disk space.
>
> It might be possible to script removing the swap file at shutdown (or
> place a wrapper script to mount the partition & remove the swapfile
> before running ntfsclone).

I thought about that. It probably would be a bit more robust
than using the Linux swap partition, but it seemed too much
like giving in to Microsoft.

> But I appreciate this is less elegant than just using the same
> swap partition for both o/s.

--
Grant Edwards grante Yow! Everybody is going
at somewhere!! It's probably
visi.com a garage sale or a disaster
Movie!!
 
Old 01-23-2009, 07:53 PM
Stroller
 
Default Howto share Linux swap partition with Windows XP

On 23 Jan 2009, at 17:09, Paul Hartman wrote:

...
http://support.microsoft.com/kb/314834

There is a registry setting in Windows to "clear" the pagefile.sys at
shutdown. What does "clear" mean? To overwrite with 0? To delete? I
don't know.


From memory it's just to delete it, which is perfect.

It would take too long to zero it out - I don't think that's the
purpose. Instead, I think, it should prevent swapfile fragmentation -
making it a very good general-purpose setting to enable.


What would be really idea for the OP is some kind of grub setting & a
bash script that formats the partition to the appropriate format for
the o/s being booted. But you'd have to be clever about it to avoid
long boot times.


Stroller.
 
Old 01-23-2009, 08:11 PM
Grant Edwards
 
Default Howto share Linux swap partition with Windows XP

On 2009-01-23, Stroller <stroller@stellar.eclipse.co.uk> wrote:
>
> On 23 Jan 2009, at 17:09, Paul Hartman wrote:
>> ...
>> http://support.microsoft.com/kb/314834
>>
>> There is a registry setting in Windows to "clear" the pagefile.sys at
>> shutdown. What does "clear" mean? To overwrite with 0? To delete? I
>> don't know.
>
> From memory it's just to delete it, which is perfect.

That would eliminate the issue of a backup snapshot having 2GB
of pagefile.sys and 1.7GB of other stuff.

> It would take too long to zero it out - I don't think that's
> the purpose. Instead, I think, it should prevent swapfile
> fragmentation - making it a very good general-purpose setting
> to enable.
>
> What would be really idea for the OP is some kind of grub
> setting & a bash script that formats the partition to the
> appropriate format for the o/s being booted. But you'd have to
> be clever about it to avoid long boot times.

I found some old postings from 6-8 years ago from people who
were trying to do that. Nobody seemed to have come up with
anything that worked very well. Since then disks have gotten
large enough that normal people don't care about a few GB.

--
Grant Edwards grante Yow! I have many CHARTS
at and DIAGRAMS..
visi.com
 
Old 01-24-2009, 09:44 AM
Peter Humphrey
 
Default Howto share Linux swap partition with Windows XP

On Friday 23 January 2009 14:58:32 Grant Edwards wrote:

> Mainly because I use ntfsclone to keep a bunch of backup copies of the
> NTFS partition, and having a 2GB swap file in every backup copy starts to
> eat up a lot of disk space.

In the days when I ran Windows I used to have at least one partition other
than C and force the swap file onto it, with fixed size. Then I could just
omit that partition from the backup.

Perhaps it's still possible to do that; I don't know, but it might be worth
a try.

--
Rgds
Peter
 
Old 01-24-2009, 01:20 PM
Stroller
 
Default Howto share Linux swap partition with Windows XP

On 23 Jan 2009, at 21:10, Paul Hartman wrote:

...
From memory it's just to delete it, which is perfect.

It would take too long to zero it out - I don't think that's the
purpose.

...


After further googling, it appears it *does* fill the pagefile.sys
with zeros, and adds a significant delay to windows shutdown times. So
it won't do anything for the OP in this case.


I don't know why I said "from memory" before, I was surely just making
the assumption.


ISTM a bit daft, under Windows, to zero out the pagefile. If you have
physical access to the computer, most anything in the swapfile will be
available elsewhere on the hard-drive anyway. About the only thing you
*might* get out of it is passwords, but that's not something for a
very amateur hacker.


I guess writing the whole routine to (free up swap memory, check the
registry for this setting &) zero the swapfile not to have been a mere
5 minute job. How hard would it have been to add an option _just_ to
delete it? This just requires freeing the inode, is surely less work,
and would have been more useful to far more people. *sigh* Microsoft.


Stroller.
 
Old 01-24-2009, 02:35 PM
Grant Edwards
 
Default Howto share Linux swap partition with Windows XP

On 2009-01-24, Peter Humphrey <peter@humphrey.ukfsn.org> wrote:
> On Friday 23 January 2009 14:58:32 Grant Edwards wrote:
>
>> Mainly because I use ntfsclone to keep a bunch of backup copies of the
>> NTFS partition, and having a 2GB swap file in every backup copy starts to
>> eat up a lot of disk space.
>
> In the days when I ran Windows I used to have at least one
> partition other than C and force the swap file onto it, with
> fixed size. Then I could just omit that partition from the
> backup.
>
> Perhaps it's still possible to do that; I don't know, but it
> might be worth a try.

Yes, it's still possible to do that. I didn't figure out I
_should_ do that until it was too late and the disk was
partitioned and several OSes installed -- I didn't have a spare
primary parition to put the swap file on. I had a bunch of
spare extended partitions but all the docs say you can't put
the XP swap file on en extended paritition (unless you use
something like swapfs, which will work with an extended
partition).

--
Grant
 

Thread Tools




All times are GMT. The time now is 12:18 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org