Author Topic: swap files  (Read 4556 times)

Anonymous

  • Guest
swap files
« 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.

CoreyC

  • Sr. Member
  • ****
  • Posts: 288
    • View Profile
    • http://
swap files
« Reply #1 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.

hammy

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • http://
swap files
« Reply #2 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
UK, z5600, pxa250
Qtopia 1.54, Sharp ROM 1.32V
D-Link DCF-660W, Viking 64Mb SD, Integral 128Mb CF, IBM 1Gb CFMD

Anonymous

  • Guest
swap files
« Reply #3 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.

grey_moon

  • Full Member
  • ***
  • Posts: 100
    • View Profile
swap files
« Reply #4 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
SL_5600 with Sharp ROM 1.32 - Windows XP Pro
AmbiCom 802.11b CF WL1100C, Pretec CompactBT Bluetooth CF, Hagiwara 256MB SD Card
Expansys Black Chairmans Case, ShirtPocket Battery Extender, ShirtPocket Retractable USB Sync/Charger

ScottYelich

  • Hero Member
  • *****
  • Posts: 992
    • View Profile
    • http://www.zaurususergroup.com/modules.php?opmodload&namephpWiki&filei
swap files
« Reply #5 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

Anonymous

  • Guest
swap files
« Reply #6 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.

bvv

  • Newbie
  • *
  • Posts: 9
    • View Profile
    • http://
swap files
« Reply #7 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?
Regards,
Vladimir, sl-c700 X11 pdaXrom 1.0

donquixote

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
swap files
« Reply #8 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

Zumi

  • Sr. Member
  • ****
  • Posts: 257
    • View Profile
    • http://
swap files
« Reply #9 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:
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
SL-C860: pdaXrom 1.1.0beta1
SD: 1GB A-data, GPS: Haicom HI-303S, Bluetooth: Nokia DTL-1 CF, CF WiFi: ASUS SpaceLink WL-110
Browse user contributed packages for pdaXrom!

donquixote

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
swap files
« Reply #10 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

Zumi

  • Sr. Member
  • ****
  • Posts: 257
    • View Profile
    • http://
swap files
« Reply #11 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
« Last Edit: January 10, 2005, 04:25:37 am by Zumi »
SL-C860: pdaXrom 1.1.0beta1
SD: 1GB A-data, GPS: Haicom HI-303S, Bluetooth: Nokia DTL-1 CF, CF WiFi: ASUS SpaceLink WL-110
Browse user contributed packages for pdaXrom!

ScottYelich

  • Hero Member
  • *****
  • Posts: 992
    • View Profile
    • http://www.zaurususergroup.com/modules.php?opmodload&namephpWiki&filei
swap files
« Reply #12 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