Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 01 Sep 2014, 17:19
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Puppy Swap File Questions
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 3 [41 Posts]   Goto page: 1, 2, 3 Next
Author Message
peb

Joined: 24 Oct 2005
Posts: 18

PostPosted: Fri 19 Dec 2008, 12:10    Post subject:  Puppy Swap File Questions  

I've browsed a bit trying to figure out Puppy swap files. I have some basic questions.

I'm running Puppy 4.1 from a CD-ROM with a pupsave file on a Windows vfat volume. The pupsave file, about 512 mb, is encrypted supposedly.

I assume that part of that pupsave file is being used as a swap file when I'm working in Puppy, and that it's encrypted when I'm not. Right?

Can Puppy mess at all with pagefile.sys on the vfat volume?

Does it write any other transient files, even temporarily on the vfat volume outside the pupsave file?

Thanks.
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11032
Location: Arizona USA

PostPosted: Fri 19 Dec 2008, 16:00    Post subject:  

By default Puppy looks for a swap partition (not a swap file) when it boots, and uses it if it finds it. I think Puppy can be configured to use a swap file, even use the Windows page file. There was a discussion in the forum a year or two ago about doing just that. Try entering "page file AND swap" in the forum search engine.

Puppy doesn't encrypt what it puts in swap memory. I seem to remember a thread somewhere in this forum discussing that (I think it was started by forum member Aitch.) I can't remember if a way was suggested to encrypt what is in swap memory.
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11092
Location: The Peoples Republic of California

PostPosted: Fri 19 Dec 2008, 16:48    Post subject:  

By default most Puppys will look for a swap file by the name of pupswap.swp in the root directory. In frugal install this is AKA /mnt/home, AKA /initrd/mnt/dev_save/. (maybe in other locations also, but I've not checked every possibility)

On boot up I perform a variety of tasks.

On shutdown I perform different tasks with a script I call po, which is short for PowerOff.

On shutdown, a person could, with ease write a script to:

1) turn off the swapfile
2) mount the swapfile
3) write zeros or random data to the swapfile
4) unmount the swap file
5) Then continue with the shut down process.

_________________
New! Puppy Linux Links Page
Back to top
View user's profile Send private message 
PaulBx1

Joined: 16 Jun 2006
Posts: 2308
Location: Wyoming, USA

PostPosted: Fri 19 Dec 2008, 19:08    Post subject:  

The other thing is to not use swap at all. Many machines will run fine without it.

Unfortunately Puppy requires a swap file or volume while booting; if a linux swap partition is not available it will CREATE a swap file WITHOUT ASKING. Shocked And then use it. There is no "pfix=noswap" parameter although I've been lobbying for one. This means at the end of the boot you must kill swap with the swapoff command; I do it in /etc/rc.d/rc.local. And hope nothing got stuck in it even by that point.

If you use swap, cleartext passwords and so forth will be in it, and you MUST clean it as Bruce suggests to ensure security. No, swap is not in the pupsave.

Pupsave encryption is pretty rudimentary at this point.
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11032
Location: Arizona USA

PostPosted: Sat 20 Dec 2008, 01:06    Post subject:  

Thanks Bruce. Once again I stand corrected. Laughing

PaulBx1, I don't have a hard disk drive at all, only RAM. What does Puppy do if it can't find a place to put a swap file?

_________________
Puppy Help 101 - an interactive tutorial for Lupu 5.25
Back to top
View user's profile Send private message 
Bligh

Joined: 08 Jan 2006
Posts: 484
Location: California

PostPosted: Sat 20 Dec 2008, 06:16    Post subject:  

TazOC found this in response to my query.

"Puppy Linux will automatically use a Linux swap partition. With Puppy 2.x and later when using a pup_save file, Puppy will use these files for swap on boot if in same directory as the pup_save file : WIN386.SWP, PAGEFILE.SYS, pup.swp and, with Puppy 2.01, pupswap.swp. Puppy 2.01 and later will create a swap file if needed in same dir as pup_save if needed, unless using 2.02 or later which won't create one if not one of the following file systems: msdos (FAT12/16), vfat (FAT32), ext2, ext3, reiserfs, minix"

Cheers
Back to top
View user's profile Send private message 
peb

Joined: 24 Oct 2005
Posts: 18

PostPosted: Sat 20 Dec 2008, 08:56    Post subject:  

[quote="PaulBx1"]The other thing is to not use swap at all. Many machines will run fine without it.

Unfortunately Puppy requires a swap file or volume while booting; if a linux swap partition is not available it will CREATE a swap file WITHOUT ASKING. Shocked And then use it. There is no "pfix=noswap" parameter although I've been lobbying for one. This means at the end of the boot you must kill swap with the swapoff command; I do it in /etc/rc.d/rc.local. And hope nothing got stuck in it even by that point.
/quote]

Good information. Thank you. And I wholeheartedly support your lobbying. One thing I strongly dislike about Windows is that it runs services, creates all sorts of files that are difficult to track down, etc. when it does anything of substance. But I've found many versions of Linux aren't much better. What I want is something like Portable Apps that leave no footprints (except, I'm sure for the swap files) on the host computer when they exit.

I don't mind using a pupsave file for the convenience, but I don't want Puppy prints elsewhere, even in swap files, and particularly without my assent.
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11092
Location: The Peoples Republic of California

PostPosted: Sat 20 Dec 2008, 09:45    Post subject:  

1) I still have an accuracy concern. Under some circumstances Puppy will make a pupswap.swp file, this is agreed. My accuracy concern is on all recent and current versions? Also on all hdd file systems.

2) Tend to think it is a given that Puppy will look for it and activate it, if found as a pretty standard rule.

3) The other thing is, I didn't offer to show how to clean it on reboot. If someone doesn't know, but wants an example, just ask.

_________________
New! Puppy Linux Links Page
Back to top
View user's profile Send private message 
Aitch


Joined: 04 Apr 2007
Posts: 6825
Location: Chatham, Kent, UK

PostPosted: Sat 20 Dec 2008, 12:14    Post subject:  

Quote:
3) The other thing is, I didn't offer to show how to clean it on reboot. If someone doesn't know, but wants an example, just ask.


OK, Bruce,

I'll volunteer for that, as I know you're dying to tell us Wink

Gets my curiosity juices flowing, for sure

Aitch Smile
Back to top
View user's profile Send private message 
peb

Joined: 24 Oct 2005
Posts: 18

PostPosted: Sat 20 Dec 2008, 19:54    Post subject:  

Bruce B wrote:

3) The other thing is, I didn't offer to show how to clean it on reboot. If someone doesn't know, but wants an example, just ask.


An example would be very helpful
Back to top
View user's profile Send private message 
puppyluvr


Joined: 06 Jan 2008
Posts: 3195
Location: Chickasha Oklahoma

PostPosted: Sat 20 Dec 2008, 21:57    Post subject:  

Very Happy Hello,
I have understood that when booted pfix=ram Puppy didnt touch the hard drive....
Is this mistaken..
.Did I misunderstand, or are you saying Puppy will mount a drive and use a Windows Pagefile on it for swap?? Unknown to the user???
Or create a pupswap.swp file on it???

As for System Ram, doesnt the bios flush it on boot??
Back to top
View user's profile Send private message Visit poster's website 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11032
Location: Arizona USA

PostPosted: Sat 20 Dec 2008, 23:34    Post subject:  

puppyluvr wrote:
... As for System Ram, doesn't the bios flush it on boot?

When the system boots, the BIOS assumes there is nothing stored in RAM because shutting the computer off turns off the power to RAM which allows the data stored in RAM to "evaporate." It takes a few seconds, or possibly even a minute or two, for the data in RAM to completely dissipate, during which time it has been demonstrated that the RAM can be powered back up and its data recovered, if done right. Not with any BIOS I've heard of, however. All BIOSes are designed to simply ignore and overwrite anything that might be in RAM when the computer boots.
Back to top
View user's profile Send private message 
puppyluvr


Joined: 06 Jan 2008
Posts: 3195
Location: Chickasha Oklahoma

PostPosted: Sun 21 Dec 2008, 02:30    Post subject:  

Very Happy Hello,
@Flash,
Thanks for the clarification, so its more an ignore than flush...Equally effective...
As to my other query, any advice. Not accessing the HD is a critical point for some of my users, and I would like to be clear on this...

@ Under any circumstances, will Puppy make use of an existing drive without user direction????? When booted pfix=ram????? And is there a pfix=noswap for Puppy???
Back to top
View user's profile Send private message Visit poster's website 
Bruce B


Joined: 18 May 2005
Posts: 11092
Location: The Peoples Republic of California

PostPosted: Mon 22 Dec 2008, 00:45    Post subject:  

Sorry guys, I got side tracked and forgot to reply fast.

Basically what we want to do is mount it, write zeros to it then unmount it.

The standard name for the Puppy swapfile is: pupswap.swp, I'll use this for illustration. For purpose of illustration I'll make up a mount point at /mnt/swapf

Normally, on an hdd install, your swap file would be at the highest level of the filesystem where puppy is mounted. This is usually accessible at the symlink /mnt/home.

Considering all this as true on your computer, we would run these commands:

swapoff /mnt/home/pupswap.swp

(we deactivated it, but if we didn't we could do the rest, the problem is with an activated swapfile any data it is holding will not get zeroed, just the free area gets wiped)

mount -t tmpfs -o loop /mnt/home/pupswap.swp /mnt/swapf

dd if=/dev/zero of=/mnt/swapf/tmpfile.tmp

(note: we are not zeroing pupswap.swp, not at all, if we did that we'd lose the formatting)

(if you read carefully, you see we are writing of (output file) called tmpfile.tmp inside pupswap.swp)

(this file will have contents of zeros and it will fill the swap file) (alternately we could use the if=/dev/random in place of if=/dev/zero)

rm /mnt/swapf/tmpfile.tmp


(we remove the file, now pupswap.swp is all zeros)

umount /mnt/swapf

Notes

dd is not told when to stop, it will stop when the pupswap.sfs if full. It will usually be short on get compared to the puts. But it will be fast.

one could tell it to write in small chunks like 512 bytes at a time. this would assure the last part gets put, but it takes longer.

dd if=/dev/zero of=/mnt/swapf/tmpfile.tmp bs=512

You can also do similar inside your pup_save file and on partitions.

dd if=/dev/zero of=tmpfile.tmp bs=512

then

rm tmpfile.tmp

Personally, I'm a bit paranoid writing anything of any kind to NTFS. Paranoia is a fear lacking in foundation and I'm not sure of my foundation.

The foundation I have is (1) there was a time we couldn't with Linux, (2) then FOSS development achieved a level where we could, (3) I don't think MS ever released the NTFS specs, did they? (4) lastly it is Microsoft partition and not much trust there on my part.

I'm not saying this to discourage anyone from wiping an NTFS partition. I don't have one either, but if I did, I'd probably wipe it while running XP.

I found a nice set of Unix utility ports for Windows here:

http://unxutils.sourceforge.net/

Lastly, run the commands manually for testing, then when you are satisfied with all your file locations, mount points and whatever else, put the commands in a script, then just call the script.

I would also suppose the best place to deactivate the swapfile is after leaving X and booting to the Command Line.

Then I'll be ready for Q&A if anyone has some.

_________________
New! Puppy Linux Links Page
Back to top
View user's profile Send private message 
PaulBx1

Joined: 16 Jun 2006
Posts: 2308
Location: Wyoming, USA

PostPosted: Tue 23 Dec 2008, 21:33    Post subject:  

Paranoia? Seems justified, given that gparted used to be able to downsize an NTFS partition, but if that partition is a Vista installation, it borks Vista. Since gparted is presumably capable of moving files around, the only conclusion I can think of is that Vista stores data on the partition but outside any file, or that there is a new file type that no one outside Microsoft knows about. Either one is at least disturbing.

I have my own paranoia about scrubbing a swap file or partition. If important cleartext is put on a drive, there is always a chance it will remain there; for example, an incorrect shutdown, or incorrect code that doesn't quite do what one imagines it is doing.

I just noticed Puppy no longer forces you to have a pupswap.swp file, as none exists on my /mnt/home (which is FAT32) with my Puppy 4.1.2. So I wonder what happens if I just boot without shutting off swap in my rc.local? I have no swap partition. I will try it and see if Puppy concocts a swap from somewhere.

Puppyluvr, there is no pfix=noswap. That was only a desire of mine.

<later>
Woops, I just realized my rc.local for this version does not have a swapoff. Yet "free" shows no swap, and as I said before, pupswap.swp is not created. So it looks like Barry responded to the complaints, or at least when he reworked his init script he did not bother to put in the "you'll get swap whether you want it or not" code. Smile
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 3 [41 Posts]   Goto page: 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0955s ][ Queries: 12 (0.0042s) ][ GZIP on ]