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 Wed 27 Aug 2014, 06:57
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Swap file suggestion
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 2 of 2 Posts_count   Goto page: Previous 1, 2
Author Message
Everitt

Joined: 19 Dec 2006
Posts: 331
Location: Leeds,UK or Birmingham, UK

PostPosted: Sat 22 Sep 2007, 17:18    Post_subject:  

That's a nice idea but, I'm afraid, a very bad one. Razz
The problem is the flash memory has a very limited lifespan. This a time limit, it's a number of read/write operations. Swap is very IO (read/write) intensive, so putting a swap file or partition on a flash disk will soon lead to the disk failing.
So yes, it would be fantastic if we could do that, but it just isn't sensible, unless you like spending all your money on new flash disks Smile
Back to top
View user's profile Send_private_message 
Bluedogruns


Joined: 12 Sep 2007
Posts: 38

PostPosted: Sat 22 Sep 2007, 20:54    Post_subject: Flash Drive Life  

I do understand the life limits of a flash drive and I know using one as a swap file would reduce the life greatly. I do know some people that could care less (not me) how much money they spend and even if they had to replace the flash drive with the swap file once a month so long as fit their needs they would do it.

For limited use when there is no other choice would putting the swap on the flash work? Or if necessary how about using an external hard drive for the swap file in those rare cases when you need to.

Blue
Back to top
View user's profile Send_private_message 
Bruce B


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

PostPosted: Sat 22 Sep 2007, 21:16    Post_subject:  

Some of the flash sticks are very cheap. I suppose the write limits are more on a per section of the stick, rather than for the stick. (Supposition only)

Use the swap file for a short while, rename it, then write another swap file so the same sections of the stick are not being constantly used.
Back to top
View user's profile Send_private_message 
Bluedogruns


Joined: 12 Sep 2007
Posts: 38

PostPosted: Sat 22 Sep 2007, 22:16    Post_subject: Flash Drive Writes  

When I first started using flash drives several years ago 4 to be exact I read the details on how my drive worked from either the manufacturer site or the manual which you once got way back when got in the package with the drive, this is when they still supplied W98 driver cd with the flash drive.

Anyway in that reading I learned that the PNY Brand not sure the others are this way are programed not to use the same portion of the memory all of the time. My understanding is each time you write to the drive it writes to a new place so that all of the space will get evenly used so that it does not destroy a portion of the drive be writing to the same place over and over.

Since it is actually memory and not sectors on a hard drive the fragmentation is not such an issue, that is why they do this.

My first drives purchased 4 years ago are used as temporary backup drives. Every day I write and erase and overwrite files to those drives. Have done so for 4 years. At the end of each month when make a complete total hard drive backup I clear the flash drives. 4 years and still running. I think the paper stated each sector of the memory has either a 1,000,000 or 10,000,000 write erase cycle before it starts failing.

Blue
Back to top
View user's profile Send_private_message 
Flash
Official Dog Handler


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

PostPosted: Sat 22 Sep 2007, 23:38    Post_subject:  

Thank you. Most people seem to avoid writing to a flash drive for fear of wearing it out. You are the first Puppy forum member I can remember who has reported the results of writing a lot to a flash drive. Smile

The following is exerpted from this article.

Quote:
Using a swap file(s) also allows you to share swap space with other
OSes as described in the Linux Swap Space Mini-HOWTO [3] and on the
linux-kernel mailing list [4].

To use a file in a filesystem for swap space, choose the swap space
size that you want for this swap area (up to 2 GiB on x86) and then
enter (as described in 'man mkswap'):
dd bs=1024 count=1M if=/dev/zero of=/path/to/swapfile.n
This writes a 1 GiB file (1 MiB * 1024) to "/path/to/swapfile.n".
You can do this multiple times to use more swap files on large-memory
systems. Swap files cannot be sparse; they must be fully allocated
before using them.

In Linux 2.4 and earlier, swap files are less robust than swap
devices (partitions) because of the need to read metadata from the
filesystem for swap files, making them prone to OOM deadlocks when
allocating pages and buffer_heads to use in swapping.
This has changed in Linux 2.5. Using a swap file has no disadvantage
compared to swapping to a device (partition). The kernel doesn't
need to allocate any memory to get a swapcache page to disk.

This is interesting because swap files are much easier to administer
(add, remove, resize) and easier to stripe. It is now feasible
(in the Linux 2.5.40 timeframe) to eliminate swap devices (partitions)
completely and not be penalized in performance.

But really, if your application is dependent on swap performance, you
need more RAM. Swap should be viewed as a lightweight background
optimization to make unused pages available for other work, rather
than as a cure for an underprovisioned machine.

Swap devices (partitions) can also be used for "software suspend"
(swsusp) in Linux 2.5 and as a destination for saving a kernel crash
dump in versions of Linux which support these features.


3. Swap-Space, Linux Swap Space Mini-HOWTO. Updated: July 2002.
How to share your Linux swap partition with Windows.
URL:: http://www.tldp.org/HOWTO/mini/Swap-Space.html
4. URL:: http://marc.theaimsgroup.com/?l=linux-kernel&;m=103623636324081&w=2

Edited_time_total
Back to top
View user's profile Send_private_message 
Bluedogruns


Joined: 12 Sep 2007
Posts: 38

PostPosted: Sun 23 Sep 2007, 00:39    Post_subject: Cheap  

Can't believe I am the only one that has reported a lot of use on flash drives.

I have to tell you for the price unless you live somewhere where they are very expensive you can not go wrong.

I mean how many times do you burn a cd then only want part of what is on the cd. Then you make a new cd with just the files you want and add more. Then if you have anything on the cd's you need to protect such as bank accounts, ss numbers etc you have to be sure you have really destroyed them. In the end with 1 gig units selling under $10.00 each and I have even seen them free after rebate just last week you can't go wrong. First you don't have to have a new one like you do each time your write a cd, that builds up in price. You can not scratch the surface and make them unreadable. You don't have an issue of will the cd drive in someone elses machine actually read my cd. Unlike a portable hard drive if you drop your flash drive or knock it off the table while it is running there are no platters and heads to get damaged, no motors to wear out.

Now this sounds bad but I have read stories where people accidentally put the flash drive through the laundry cycle. Guess what as long as you let the thing dry before you use it, it will usually still work. When I read that I asked Sandisk about this when I was on the phone with them one day and the person on the phone confirmed it. Try that with a portable hard drive.

I can also state from limited but still experience that I have never lost any data on a flash drive going through an airport.

I guess the only real issue with a flash drive is loosing it or erasing something by mistake.

I am a person that hates to spend money, I will milk every last bit of life I can get out of a product (I bought a new vehicle14 years ago and still am not ready to trade it in). I will spend an hour on line trying to save a couple of dollars on a product but I do not even think twice when it comes to spending my money on one of these devices.

Blue
Back to top
View user's profile Send_private_message 
willhunt


Joined: 05 Oct 2005
Posts: 495

PostPosted: Mon 24 Sep 2007, 15:13    Post_subject:  

Has anyone tried swapd with puppy? (thanks muggins) and if it helps
anyone I removed my pagefile.sys every time I boot linux and windows
makes a fresh one every time it boots no muss no fuss. Maybe puppy
could just make it's swap file name pagefile.sys instead of
puppy.swp then just rm it in the shutdown script M$ will regenerate
the swap next time it boots:)

I think it would just be easier to just remove puppy.swp during
shutdown

_________________
176 Icewm Themes Exclamation
vlc-0.8.6c-i586.pet
vlc-0.8.6c-i586.pet
Back to top
View user's profile Send_private_message 
Flash
Official Dog Handler


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

PostPosted: Mon 24 Sep 2007, 22:47    Post_subject:  

I haven't seen this explained to my satisfaction anywhere so I'll just wing it. My guess is the filesystem data, metadata, index, table of contents, whatever you call it, which an OS normally stores on the hard disk so it can find a particular file when it needs to, and know its permissions and so forth, is not needed for swap memory. By design, all any OS needs to know about swap memory in order to use it is the boundaries of the swap space on the hard disk. Nothing needs to be known about the format of the filesystem on the hard disk. Everything that is required by the OS to use that area for swap purposes is generated by the OS memory management and kept only in RAM. As long as the OS doesn't write outside the boundaries of the swap space, it can share that swap space with other operating systems. Obviously, they can't use the swap space at the same time. It's like sharing a bathroom with your sister when you were growing up.

In the case of Puppy writing to NTFS partitions, swap space is a special case because no NTFS metadata is touched when Puppy uses the swap area of the hard disk, and Windows will overwrite anything in that area when it boots. Therefore the chances that Puppy will corrupt a Windows installation by using its pagefile for swap is nil.

Those are just my random thoughts on the subject, constructed from first principles and a little reading, and unimpeded by any real knowlege or experience. I'd be interested to know how close I am to being right. Laughing
Back to top
View user's profile Send_private_message 
PaulBx1

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

PostPosted: Tue 25 Sep 2007, 09:40    Post_subject:  

Maybe have a boot parameter (OK, I'm crazy about boot parameters Rolling Eyes ) instructing Puppy to use pagefile.sys for swap; then it's on the user whether it causes problems with XP or not.

Actually, I've been lobbying for a NOSWAP parameter for a while for us encrypted pupsave fans, to no avail. If you want a boot parameter you might have to edit the boot script yourself.

Regenerating a swap file every boot probably is going to lengthen boot times, enough to be noticable.

Quote:
Now this sounds bad but I have read stories where people accidentally put the flash drive through the laundry cycle.


I used to work for a small computer company that would run circuit boards through an ordinary dishwasher at the end of the manufacturing process. These were big boards, about 10x15 inches, full of medium scale integrated circuits. And they weren't cheap either; they sold for around $10k IIRC. As long as no residue is left, you are probably safe. Clothes washers do leave a lot of soap in clothes though; might need to run another cycle without soap, or just dunk the flash drive in clear, hot water for a while. Smile
Back to top
View user's profile Send_private_message 
Flash
Official Dog Handler


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

PostPosted: Tue 25 Sep 2007, 10:21    Post_subject:  

I repair equipment that is full of aluminum electrolytic energy storage capacitors which sometimes fail by overheating and then exploding like a giant kernel of popcorn, with the amusing sound of a shotgun blast. I rinse out the liquid residue of the capacitor innards (supposed to be mostly ethylene glycol which is water soluble) with a garden hose. The trick is to dry everything thoroughly before applying power. I've never had one come back because of anything that appeared to be caused by spraying it with the garden hose.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 2 of 2 Posts_count   Goto page: Previous 1, 2
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0853s ][ Queries: 11 (0.0077s) ][ GZIP on ]