Help - Search - Members - Calendar
Full Version: swap files
OESF Forums > Distros, Development, and Model Specific Forums > Distro Support and Discussion > pdaXrom
Anonymous
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.
CoreyC
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.
hammy
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
Anonymous
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 smile.gif. thanks.
grey_moon
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
ScottYelich
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
Anonymous
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.
bvv
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?
donquixote
QUOTE(grey_moon @ Mar 15 2004, 01:28 PM)
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
Zumi
QUOTE(donquixote @ Jan 9 2005, 09:24 PM)
QUOTE(grey_moon @ Mar 15 2004, 01:28 PM)
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:
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 smile.gif
donquixote
QUOTE(Zumi @ Jan 9 2005, 09:53 PM)
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
Zumi
QUOTE(donquixote @ Jan 10 2005, 01:12 AM)
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
ScottYelich
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
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.