OESF Portables Forum

Model Specific Forums => Sharp Zaurus => Zaurus - pdaXrom => Topic started by: Anonymous on March 12, 2004, 05:45:45 pm

Title: swap files
Post by: Anonymous on March 12, 2004, 05:45:45 pm
How do i get a swap file working? The following works fine to create an 4MB swap file

dd if=/dev/zero of=swp.img bs=1k count=4096
mkswap swp.img

but how do I actually use it:
\"swapon swp.img\" complains that \"swp.img\" is an invalid option.

Thanks.
Title: swap files
Post by: CoreyC on March 12, 2004, 06:17:06 pm
This is what I do:

dd if=/dev/zero of=swapfile bs=4MB count=1
mkswap swapfile
swapon swapfile

IF you are putting it on your SD or CF card you need to make sure they are ext2 formatted or you will get that invalid option error.
Title: swap files
Post by: hammy on March 12, 2004, 06:55:18 pm
I\'ve fdisked my sd card (64Mb) into a 20Mb ext2 (/dev/mmcda2), rest FAT16 (/dev/mmcda1). This works for me:
 mkswap /dev/mmcda2
swapon /dev/mmcda2

It took a couple of re-boots before I had to stop mounting mmcda1 manually..... Someone who knows what they were doing may have done that bit faster.

Hamilton
Title: swap files
Post by: Anonymous on March 12, 2004, 07:10:04 pm
thanks... but why does mkswap not format it correctly... works great on all my other boxs. ext2. huh? who would have guessed.

well at least I can now run more stuff at once . thanks.
Title: swap files
Post by: grey_moon on March 15, 2004, 08:28:35 am
One thing puzzles me, sd cards are solid state drives and have a limited lifetime. Is the internal rom a solid state drive too? and therefore will have a limited amount of writes, so if I create a swap on the 64mb of rom on my sl5600 will i be lowering it\'s life expectancy?

Cheers
Moon
Title: swap files
Post by: ScottYelich on March 15, 2004, 12:28:40 pm
yes.
people say that external CF is reasonably fast (faster than sd?) ..

cf is cheap.  

I\'d like to know if *anyone* has written a CF into failure... but, it is a *slight* concern of
mine for internal storage... same with compiling, etc.

I figure if you keep the internal flash working, the device should have a LONG life span.

Scott
Title: swap files
Post by: Anonymous on March 15, 2004, 01:15:51 pm
cf cards these days have about 100 000 erase cycles per block. using flash for swap is about the fastest way to toast it under normal use.
Title: swap files
Post by: bvv on March 19, 2004, 04:12:56 pm
Please, help! I\'m trying to create ext2 filesystem on my SD an put a swap onit
using fdisk but no effect!
/dev/mmcda1 still remains the same FAT16!
Could you explain to me fdisk procedure step-by-step for ext2 creation?
Title: swap files
Post by: donquixote on January 09, 2005, 03:24:27 pm
Quote
One thing puzzles me, sd cards are solid state drives and have a limited lifetime.

And someone else posted:

using flash for swap is about the fastest way to toast it under normal use.
Where are you people getting this information on the limited lifetime of flash memory? Because I can't find any info on it, so I am thinking that what you are saying is not true.

Feel free to correct me though.

dq
Title: swap files
Post by: Zumi on January 09, 2005, 04:53:20 pm
Quote
Quote
One thing puzzles me, sd cards are solid state drives and have a limited lifetime.

And someone else posted:

using flash for swap is about the fastest way to toast it under normal use.
Where are you people getting this information on the limited lifetime of flash memory? Because I can't find any info on it, so I am thinking that what you are saying is not true.

Feel free to correct me though.

dq
It is true, they do have a limited lifespan. Quote from here (http://www.robgalbraith.com/bins/multi_page.asp?cid=6007):
Quote
Individual flash memory cells have a limited lifespan. That's the bad news. The good news is that their lifespan is measured in the hundreds of thousands or even millions of erase/write cycles. CompactFlash cards are designed to automatically and transparently map out memory cells that go bad, or in some cases when they reach a predefined limit, i.e. 300,000 erase/write cycles (note that this figure is just an example; manufacturers may use a different figure). Cards should continue to function long after a few cells have expired, since even the busiest flash memory card won't start turning off a significant number of memory cells until after many years of service.
But swaping is quite an intense reading/writing process, that's why nobody recommends using a flash drive as swap place.

They getting cheaper however, so I usually use swap, but with a little bit of protection. I always make about 3 swapfiles and use 2 of them with different priority level (the higher the priority the more the system uses that swap).

Zumi
Title: swap files
Post by: donquixote on January 09, 2005, 07:12:40 pm
Quote
They getting cheaper however, so I usually use swap, but with a little bit of protection. I always make about 3 swapfiles and use 2 of them with different priority level (the higher the priority the more the system uses that swap).
Would you mind explaining how you did this? I never thought that one would need more than one swapfile/partition. How do you prioritize them?

dq
Title: swap files
Post by: Zumi on January 10, 2005, 04:23:24 am
Quote
Would you mind explaining how you did this? I never thought that one would need more than one swapfile/partition. How do you prioritize them?

dq
You can set the prority with swapon (man swapon), but they get lower priority anyway if you turn them on later (-1, -2, etc.). That's all.

Zumi
Title: swap files
Post by: ScottYelich on January 10, 2005, 11:33:37 pm
what's the word? 10,000 writes to the same location?

512MB CF $34 ...

dunno, I think I could spare $34 here or there.

Scott