Help - Search - Members - Calendar
Full Version: Swap File Problem
OESF Forums > Distros, Development, and Model Specific Forums > Distro Support and Discussion > pdaXrom
uMP2k
Hmmmm - what have I done!

I am using a C1000 running pdaXrom beta3. Following the directions HERE

The actual commands I typed in were:

# dd if=/dev/zero of=swapfile bs=4096 count=1]
# mkswap /dev/mmcda1
# swapon /dev/mmcda1

I am not sure where on the forum I got the actual figures used in the first line, but I found them somewhere....

I have set up a swap file on my SD card. What I seem to have done is turn my entire sd card into a swap file. It will no longer mount either using the mount plugin or from the command line - where it gives the error "/dev/mmcda1 looks like swapspace - not mounted" .

I have tried #swapoff /dev/mmcda1 but that does not seem to do anything. even after that if I try to mount /dev/mmcda1 I get the same error about swapspace. same if I try mount/mnt/card/.

As you can probably see I am pretty much a Linux newbie, so please go easy on me!

I am hoping there may be some way to recover from this without just reformating the card as that would mean re-installing pdaXrom as I have some of my programs running from the card.

Any help appreciated
Capn_Fish
I would appear to me that by using #mkswap /dev/mmcda1 you did turn your card into a swapfile. I used (for my CF Microdrive):

# cd /mnt/cf
# dd if=/dev/zero of=swapfile bs=16M count=1
# mkswap swapfile
# swapon swapfile

This makes the file a swapfile instead of the card. Also, the 16M indicates 16 megabytes.

That's my take on it, if anybody sees something wrong with it, let us know, as I'm more or less a newbie myself. tongue.gif

Hope it helps.
karlto
QUOTE(uMP2k @ Oct 2 2006, 03:05 PM)
Hmmmm - what have I done!

What I seem to have done is turn my entire sd card into a swap file.

So you have...

You did this:
CODE
# mkswap /dev/mmcda1


But this is what you should have done (and what the linked thread told you to):
CODE
# mkswap swapfile


So you've trashed everything on the card and you need to reformat the card as FAT again and try the file idea again... sorry...

Edit: Capn_Fish beat me to it!
Antikx
Im prety sure you have hosed the programs that you installed to your card. Sorry.

This page should get you on the right track:
http://www.pdaxrom.org/node/29

You will probably have to create the file before going into X windows as you need Y amount of ram free to create Y sized swap file.
uMP2k
Thanks for all the fast responses guys - you live and learn!

Fortunately there was nothing really important on the card (actually nothing important at all) as I am still feeling my way around with the Z and pdaXrom so it is really just a testing set up.

I will reformat and try again!

Thanks.
Antikx
Good attitude! Have fun!
Linux puts the fun back into modern computing.
uMP2k
One more quick point.

I issued the original command while still in the root directory on the console (I mean I had not switched to the card with # cd /mnt/card). does this mean that I have created a swap file on my internal flash (not a good idea I am guessing!) and if so how can I find it and kill it.

Thanks again
zeigerpuppy
On a related issue:

I have created a swp partition on my 3100 as /dev/hda1
using beta 3
with swapon /dev/hda1
the swap partition mounts fine
however, when placed in the /etc/rc.d/rc.sysinit
this command fails.

Where is the proper place to add this at startup?
Capn_Fish
uMP2k: I believe that you just have an empty file called "swapfile". If you were in / or in oyour home directory (you said root, but I can't tell for sure if you mean home or /) when you made it, it should be there and you can simply delete it. It shouldn't be used (even if it could be used) without you doing a "swapon swapfile" in the directory where it is.

zeigerpuppy: I don't think that you want to run with swap on all the time. It will slow down your system and can potentially reduce battery life if your drive is constantly spinning.

If you still want it to be turned on when you boot, I can't help, but you may want to think about it.
loji
QUOTE
Capn_Fish Posted Yesterday, 06:37 PM


# cd /mnt/cf
# dd if=/dev/zero of=swapfile bs=16M count=1
# mkswap swapfile
# swapon swapfile

This makes the file a swapfile instead of the card. Also, the 16M indicates 16 megabytes.


dd is making a file full of zeros bs= bitesize, and count is how many ... it is cleaner to make a smaller bitsize (ie: 1MB) and then use the count to populate how large the file is count=16.
anunakin
QUOTE(loji @ Oct 2 2006, 05:49 PM)
QUOTE
Capn_Fish Posted Yesterday, 06:37 PM


# cd /mnt/cf
# dd if=/dev/zero of=swapfile bs=16M count=1
# mkswap swapfile
# swapon swapfile

This makes the file a swapfile instead of the card. Also, the 16M indicates 16 megabytes.


dd is making a file full of zeros bs= bitesize, and count is how many ... it is cleaner to make a smaller bitsize (ie: 1MB) and then use the count to populate how large the file is count=16.
*



I using this command (128MB file):
CODE
dd of=swapfile bs=1024 seek=128000 count=0
loji
That was it !! I was looking for the exact bitsize when I set up my swap but couldn't find it (and didn't feel like looking that hard) .. I have the knoppix hacks book, and they used the 1MB size, so I figured the little extra difference wouldn't matter. If I understand correctly, the smaller bitsize makes it quicker when seeking. (just like setting up any filesystem, big blocks for larger files (say audio/video recording) and smaller blocksizes for small files that are accesssed often.

I don't understand why you're using seek intead of the count option tho? the man says seek=BLOCKS
skip BLOCKS obs-sized blocks at start of output

so you're skipping to the end of the file size and creating there? It doesn't seem as intuitive, but there surley is a reason. : )
uMP2k
I have certianly learned some very interesting stuff from this thread!

Loji - I was wondering what the syntax of the dd command actually meant. I feel much better now I now what I was telling my Z to do!

I have reinstalled the apps I lost by turning my whole card into a swap file wink.gif and have now set up a 18mb swap on it using the method you suggest.
InSearchOf
QUOTE(uMP2k @ Oct 2 2006, 09:50 PM)
I have certianly learned some very interesting stuff from this thread!

Loji - I was wondering what the syntax of the dd command actually meant.  I feel much better now I now what I was telling my Z to do!

I have reinstalled the apps I lost by turning my whole card  into a swap file  wink.gif and have now set up a 18mb swap on it using the method you suggest.
*


18mb! that is sure tiny...

Late
uMP2k
QUOTE(InSearchOf @ Oct 3 2006, 12:12 PM)
QUOTE(uMP2k @ Oct 2 2006, 09:50 PM)
I have certianly learned some very interesting stuff from this thread!

Loji - I was wondering what the syntax of the dd command actually meant.  I feel much better now I now what I was telling my Z to do!

I have reinstalled the apps I lost by turning my whole card  into a swap file  wink.gif and have now set up a 18mb swap on it using the method you suggest.
*


18mb! that is sure tiny...

Late
*



Actually, I was just wondering if what the advantages of a bigger swap file (maybe 64mb) might be?
Capn_Fish
As far as I know, you want to keep the file as small as you can. This will cause more RAM to be used (there is a larger amount of RAM available than swap, so more is available for use and will be used) and will wear on your card less. It will also decrease the effect on speed that swap has.

Once again, corrections are welcome.
desertrat
QUOTE(uMP2k @ Oct 3 2006, 02:17 AM)
Actually, I was just wondering if what the advantages of a bigger swap file (maybe 64mb) might be?

The bigger it is the more programs you can run. I have a 256MB swap partition and usually have these programs running: dillo, mozilla (or firefox), abiword, stardict (with a number of large dictionaries), mrxvt, ka/pi, pwmanager, xmms ...
uMP2k
QUOTE(desertrat @ Oct 3 2006, 01:38 PM)
QUOTE(uMP2k @ Oct 3 2006, 02:17 AM)
Actually, I was just wondering if what the advantages of a bigger swap file (maybe 64mb) might be?

The bigger it is the more programs you can run. I have a 256MB swap partition and usually have these programs running: dillo, mozilla (or firefox), abiword, stardict (with a number of large dictionaries), mrxvt, ka/pi, pwmanager, xmms ...
*



Hmm - I will give "bigger" a go then.

I am addicted to running lots of stuff at the same time on my computers and that includes whatever my mobile device of the day is.

I am currently trying to get freeciv 2.10 beta 2 running and not having much luck, maybe a bigger swap will help!
karlto
QUOTE(Capn_Fish @ Oct 3 2006, 03:39 PM)
As far as I know, you want to keep the file as small as you can. This will cause more RAM to be used (there is a larger amount of RAM available than swap, so more is available for use and will be used) and will wear on your card less. It will also decrease the effect on speed that swap has.

Once again, corrections are welcome.
*

Actually, any modern OS should utilise swap correctly regardless. Often forcing programs to use RAM can degrade performance and proper use of swap/virtual mem is much better. It shouldn't put something needed fast on slow swap, but it will significantly increase the amount of available memory.

Now someone much more knowledgeable will come along and tell me I'm wrong smile.gif
Meanie
QUOTE(karlto @ Oct 3 2006, 02:30 PM)
QUOTE(Capn_Fish @ Oct 3 2006, 03:39 PM)
As far as I know, you want to keep the file as small as you can. This will cause more RAM to be used (there is a larger amount of RAM available than swap, so more is available for use and will be used) and will wear on your card less. It will also decrease the effect on speed that swap has.

Once again, corrections are welcome.
*

Actually, any modern OS should utilise swap correctly regardless. Often forcing programs to use RAM can degrade performance and proper use of swap/virtual mem is much better. It shouldn't put something needed fast on slow swap, but it will significantly increase the amount of available memory.

Now someone much more knowledgeable will come along and tell me I'm wrong smile.gif
*



swap will always be slower than real physical memory but when we dont have enough physical memory then we need to use swap at the sacrifice of speed. cacko/sharp rom have an applet that can monitor available memory and enable/disable swap depending on need. this does not exist on pdaXrom but would be a great app for someone to port over.

also, remember the general rule of thumb. swapfile should be around 2-2.5 times the amount of physical ram. ymwv
bluedevils
I've learned that is not always true. If you are using a system with 4GB of ram and you are constantly swapping a 1GB of hard drive space, then there is something wrong and 8GB of swap is not the solution.

You have to be carefull of swap when you use the Z as a usb reader.
bluedevils
Sorry meanie, I didn't see the word "general"
InSearchOf
Actually... I thought the general rule of thumb was 1.5... but on the Z I used 256.. just because I compile native apps and to much is never to much...

Late
uMP2k
QUOTE(bluedevils @ Oct 6 2006, 01:47 AM)
You have to be carefull of swap when you use the Z as a usb reader.
*



Please explain....

I use my Z as a card reader quite a bit at work and would like to know more about this.
Capn_Fish
I'd like to know how to use the Z as a card reader.
karlto
QUOTE(Meanie @ Oct 6 2006, 03:05 AM)
swap will always be slower than real physical memory but when we dont have enough physical memory then we need to use swap at the sacrifice of speed. cacko/sharp rom have an applet that can monitor available memory and enable/disable swap depending on need. this does not exist on pdaXrom but would be a great app for someone to port over.

also, remember the general rule of thumb. swapfile should be around 2-2.5 times the amount of physical ram. ymwv
*

Obviously swap is much (much) slower than real memory, but it is quite curious that adding more swap will cause it to be used instead and degrade performance. Is this Linux-arm in general, or is it pdaXrom specific?
uMP2k
QUOTE(Capn_Fish @ Oct 6 2006, 09:09 AM)
I'd like to know how to use the Z as a card reader.
*


As far as I know this only works with the Cxx00 series which have USB host built in.

Of course I may be wrong....
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.