Will Linux swap work on NTFS drive?

Using applications, configuring, problems
Message
Author
Doglover

Will Linux swap work on NTFS drive?

#1 Post by Doglover »

The laptop I am borrowing has XP but no swap partition, will a linux swap work for ntfs? The only tool I have is Gparted. I used to use Windows but its been so long(thankfully) that I forgot if it will or not. I need to set this up so I can get some ooomph out of this dog.

User avatar
alienjeff
Posts: 2265
Joined: Sat 08 Jul 2006, 20:19
Location: Winsted, CT - USA

Re: non-puppy question

#2 Post by alienjeff »

Caveat emptor: to muck with the hard drive partitioning of a borrowed computer is to take a walk on very thin ice. Would you want someone repartitioning the hard drive of a computer you had loaned out?

If you want ooomph, add a swap partition and boot Puppy from CD or USB. Don't bother with trying to tweak XP. It's hopeless.
[size=84][i]hangout:[/i] ##b0rked on irc.freenode.net
[i]diversion:[/i] [url]http://alienjeff.net[/url] - visit The Fringe
[i]quote:[/i] "The foundation of authority is based upon the consent of the people." - Thomas Hooker[/size]

Sage
Posts: 5536
Joined: Tue 04 Oct 2005, 08:34
Location: GB

#3 Post by Sage »

Too true! Give it back untouched if friendship has any value.
If I were messin' with NTFS, I'd only trust System Rescue. Mind you, this thread does pose some interesting possibilities. For example, one could set up a small swap partition on the end of an NTFS system, and, if appropriate, hide it. But would it then be detected? Could an NTFS system be configured like W98 to use fixed swap space? Guessing that it could. That being true, can swap space be made generic so that any OS could find and use it? Is there something universal about swap space? I think BSD and Linux can do this but Gates is usually on a planet all his own?

User avatar
Boo2themoon
Posts: 54
Joined: Wed 15 Aug 2007, 20:50
Location: West Country UK

#4 Post by Boo2themoon »

Because Vista needs all the help it can get, it uses a system that allows a usb stick to be used as additional ram.

I wonder if there is a way to do this in Puppy or even make a swap partition on a usb stick?

I would guess it would need to be usb2 though.

Doglover

re:Jeff

#5 Post by Doglover »

thanks for you input Jeff, but stick to the topic, which is whether a linux swap will work with ntfs. I didn't ask for an ethics lesson. I have permission to do this from the laptop's owner, who 85 years old and trusts me. Seems as though you've had some experience in the past to have touched a raw nerve.

the laptop in question has 256 ram and a 60 gig drive which is 37% full, I would put the swap in the middle of the drive, adding a primary partition behind it. I've found that the best performance is gained by putting the swap at hda1, fastest part of the drive.

Of course I would image the drive just in case.

User avatar
alienjeff
Posts: 2265
Joined: Sat 08 Jul 2006, 20:19
Location: Winsted, CT - USA

Re: re:Jeff

#6 Post by alienjeff »

Doglover wrote:thanks for you input Jeff, but stick to the topic, which is whether a linux swap will work with ntfs.
No, what you want to do is soup-up an XP installation and you're asking how to do so on a Linux forum. Perhaps the "ethics lesson" touched a raw nerve ...
[size=84][i]hangout:[/i] ##b0rked on irc.freenode.net
[i]diversion:[/i] [url]http://alienjeff.net[/url] - visit The Fringe
[i]quote:[/i] "The foundation of authority is based upon the consent of the people." - Thomas Hooker[/size]

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#7 Post by Flash »

Gee, a supplicant with an attitude. Will wonders never cease? :lol:

Doglover, your question seemed ambiguous to me. Were you asking if Windows can use a swap partition, or if you can add a swap partition to what is now a NTFS drive without messing up the Windows installation?

If the latter, then I can tell you that I have added swap partitions to at least four NTFS hard disk drives with Windows 2000 on them, and never had a problem. The computer I'm using now is one of them. I've used both Partition Magic 8 and Puppy's Gparted to repartition the hard disks.
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=69321][color=blue]Puppy Help 101 - an interactive tutorial for Lupu 5.25[/color][/url]

Sage
Posts: 5536
Joined: Tue 04 Oct 2005, 08:34
Location: GB

#8 Post by Sage »

You didn't give enough information to outline your exact circumstances, so expect to get a more encompassing response! Such processes can cause much grief even to experienced operators.
As to swap partition position, I remember we had an extensive discourse fairly recently. Not entirely sure we reached a final conclusion, but I did not favour swap space at the beginning and gave my reasons there. As I recall, AJ might have disagreed. So that's about par, then!

User avatar
nipper
Posts: 150
Joined: Sat 22 Mar 2008, 16:08

Re: Will Linux swap work on NTFS drive?

#9 Post by nipper »

Doglover wrote:The laptop I am borrowing has XP but no swap partition, will a linux swap work for ntfs? The only tool I have is Gparted. I used to use Windows but its been so long(thankfully) that I forgot if it will or not. I need to set this up so I can get some ooomph out of this dog.
Well, in the first place, I would imagine that a machine that came with XP installed is of the era where there is sufficient RAM to run Puppy well even without swap. Unless your software needs are more demanding.

I took your description to mean that you want to have a swap to use with Puppy. Have you considered using a swap file rather than having to repartition someone else's machine. I don't know if a swap file on a ntfs partition will work for Puppy (no ntfs to try it on here) but someone will be able to answer that, if that's what you want to try. If you do repartition, not important if the partition you carved the new one out of is ntfs, just ID it as a linux swap partition type.

User avatar
Aitch
Posts: 6518
Joined: Wed 04 Apr 2007, 15:57
Location: Chatham, Kent, UK

#10 Post by Aitch »

nipper wrote:If you do repartition, not important if the partition you carved the new one out of is ntfs, just ID it as a linux swap partition type.
Can I just stick my nose in, as my experience says otherwise:-

Bottom line - yes it will work, I concur with Flash, I did it on W2K too.....

What nipper may have meant to say was, "it shouldn't be important if the partition you carved the new one out of is ntfs........"
I would add the rider:
"However, if at any time windows breaks & decides to do a file check on shutdown, it may just view your swap-partition as lost files, run checkdisk on the partition & try to incorporate it into the windoze installation, such that on reboot you will be greeted with the broken filesystem blue screen"

As I say, from experience - maybe rare, but it was a nightmare, especially since I was in the middle of a legal case & had all my court copies on file in a vault which got trashed
I really don't like windoze/ntfs when it decides to self repair and doesn't know the difference between self & other
windoze is far more likely to benefit from a swap partition, [especially on a seperate hard drive], than puppy on that sort of hardware IMHO

Aitch

User avatar
nipper
Posts: 150
Joined: Sat 22 Mar 2008, 16:08

#11 Post by nipper »

Aitch wrote: "However, if at any time windows breaks & decides to do a file check on shutdown, it may just view your swap-partition as lost files, run checkdisk on the partition & try to incorporate it into the windoze installation, such that on reboot you will be greeted with the broken filesystem blue screen"
You are correct, this shouldn't happen. Windows should not recognise a partition ID'd as Linux swap. However, my experience only goes as far as W98, I don't know about the OS since they switched to ntfs. If it happened to you then I guess it's possible.

User avatar
pcguru
Posts: 12
Joined: Sat 02 Dec 2006, 22:29
Location: New Zealand

#12 Post by pcguru »

I'm going to ignore the blah of should he shouldn't he etcetera ...
fact is Doglover wants to, and appears to have permission to use a swap partition on the machine in question ...
what I have to contribute though, may make the whole lot a bit moot. (well, kinda)

I read the query on a thread awhile back - and thought it was a cool idea - so I tried it IT WORKED!!!
on an XP machine (mine) - mounted c drive (ntfs) and used the XP swapfile as a swap file for puppy. (v3.01 I think - definitely done it with wNOP 1 and 2)
--from memory (not the best - but works alright for PC stuff :))
mount /dev/hda1 /mnt/hda1
mkswap /mnt/hda1/pagefile.sys
swapon /mnt/hda1/pagefile.sys
-
then - when finished with it
swapoff /mnt/hda1/pagefile.sys
umount /mnt/hda1
-
pretty sure that's what I did - more importantly - IT WORKED!
-
haven't tried it with a win9x system though ... would prolly be more useful to know.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#13 Post by Flash »

Yes, Linux can use Windows' page file for a swap file. The contents of the page file are wiped after Windows boots, although I believe the page file is where Windows saves the RAM when it hibernates, so Puppy couldn't share the page file if you're hibernating Windows.

dptxp
Posts: 34
Joined: Wed 12 Sep 2007, 05:19

#14 Post by dptxp »

256 MB RAM is fine, no SWAP needed for PUPPY.
[url]http://linux.ixcodes.com[/url]

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#15 Post by amigo »

The safe way to do this is to create a *file* on the ntfs partition and then format and use it as swap space. You do need to be able to write to ntfs for this to work, but even the in-kernel ntfs-write support will let you safely do this -since the file size will not be changed.
You can use a tool like bigfile.exe to create the initial file, or you can just use any large file and then run mkswap on it under linux to format it.

User avatar
alienjeff
Posts: 2265
Joined: Sat 08 Jul 2006, 20:19
Location: Winsted, CT - USA

#16 Post by alienjeff »

dptxp wrote:256 MB RAM is fine, no SWAP needed for PUPPY.
Not necessarily so. It depends on one's computing habits, needs, installation method and Puppy version.

I have a box that maxes out at 256MB of RAM and frequently go into swap partition usage ... and this is with a full HD install of the memory conservative Puppy v2.12.
[size=84][i]hangout:[/i] ##b0rked on irc.freenode.net
[i]diversion:[/i] [url]http://alienjeff.net[/url] - visit The Fringe
[i]quote:[/i] "The foundation of authority is based upon the consent of the people." - Thomas Hooker[/size]

User avatar
HairyWill
Posts: 2928
Joined: Fri 26 May 2006, 23:29
Location: Southampton, UK

#17 Post by HairyWill »

amigo wrote:The safe way to do this is to create a *file* on the ntfs partition and then format and use it as swap space. You do need to be able to write to ntfs for this to work, but even the in-kernel ntfs-write support will let you safely do this -since the file size will not be changed.
You can use a tool like bigfile.exe to create the initial file, or you can just use any large file and then run mkswap on it under linux to format it.
I have seen suggestions that it is prudent to defrag the drive first and ensure that the swap file is contiguous
Will
contribute: [url=http://www.puppylinux.org]community website[/url], [url=http://tinyurl.com/6c3nm6]screenshots[/url], [url=http://tinyurl.com/6j2gbz]puplets[/url], [url=http://tinyurl.com/57gykn]wiki[/url], [url=http://tinyurl.com/5dgr83]rss[/url]

John Doe
Posts: 1681
Joined: Mon 01 Aug 2005, 04:46
Location: Michigan, US

#18 Post by John Doe »

Doglover wrote:The laptop I am borrowing has XP but no swap partition, will a linux swap work for ntfs?
has anyone actually ever tried writing a swap file (perhaps using the exact file name [what is it, pagefile.sys]) to an ntfs partition and using it (all from 'nix/puppy [latest puppy release has ntfs-tools capable for vista ntfs])?

does it work?

Sage
Posts: 5536
Joined: Tue 04 Oct 2005, 08:34
Location: GB

#19 Post by Sage »

has anyone actually ever tried writing a swap... to an ntfs partition
WPA, hidden backups, lack of proper install discs deliberately conspires to make this a risky undertaking? That's the way Billyboy wants it. That's why there's only one rational option for regular folks with XP/Vista machines - wipe it! And resolve, in future, never to buy proprietary boxes; but I think I said that before....

User avatar
alienjeff
Posts: 2265
Joined: Sat 08 Jul 2006, 20:19
Location: Winsted, CT - USA

#20 Post by alienjeff »

Sage wrote:And resolve, in future, never to buy proprietary boxes; but I think I said that before....
To be precise, 284 times -- but who's counting? ;)

Repetition for emphasis, et al.
[size=84][i]hangout:[/i] ##b0rked on irc.freenode.net
[i]diversion:[/i] [url]http://alienjeff.net[/url] - visit The Fringe
[i]quote:[/i] "The foundation of authority is based upon the consent of the people." - Thomas Hooker[/size]

Post Reply