OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
> Swap File Problem
uMP2k
post Oct 1 2006, 06:05 PM
Post #1





Group: Members
Posts: 79
Joined: 7-June 06
From: Perth - Sunny Oz
Member No.: 10,104



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
Go to the top of the page
 
+Quote Post
Capn_Fish
post Oct 1 2006, 06:37 PM
Post #2





Group: Members
Posts: 2,350
Joined: 30-July 06
Member No.: 10,575



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.
Go to the top of the page
 
+Quote Post
karlto
post Oct 1 2006, 06:37 PM
Post #3





Group: Members
Posts: 343
Joined: 3-October 05
From: NZ
Member No.: 8,243



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!
Go to the top of the page
 
+Quote Post
Antikx
post Oct 1 2006, 06:40 PM
Post #4





Group: Members
Posts: 1,156
Joined: 5-January 05
From: Winnipeg, Manitoba
Member No.: 6,127



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.
Go to the top of the page
 
+Quote Post
uMP2k
post Oct 1 2006, 07:04 PM
Post #5





Group: Members
Posts: 79
Joined: 7-June 06
From: Perth - Sunny Oz
Member No.: 10,104



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.
Go to the top of the page
 
+Quote Post
Antikx
post Oct 1 2006, 07:32 PM
Post #6





Group: Members
Posts: 1,156
Joined: 5-January 05
From: Winnipeg, Manitoba
Member No.: 6,127



Good attitude! Have fun!
Linux puts the fun back into modern computing.
Go to the top of the page
 
+Quote Post
uMP2k
post Oct 1 2006, 08:12 PM
Post #7





Group: Members
Posts: 79
Joined: 7-June 06
From: Perth - Sunny Oz
Member No.: 10,104



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
Go to the top of the page
 
+Quote Post
zeigerpuppy
post Oct 2 2006, 12:51 AM
Post #8





Group: Members
Posts: 109
Joined: 23-December 05
Member No.: 8,778



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?
Go to the top of the page
 
+Quote Post
Capn_Fish
post Oct 2 2006, 03:50 AM
Post #9





Group: Members
Posts: 2,350
Joined: 30-July 06
Member No.: 10,575



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.
Go to the top of the page
 
+Quote Post
loji
post Oct 2 2006, 09:49 AM
Post #10





Group: Members
Posts: 130
Joined: 11-May 04
Member No.: 3,244



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.
Go to the top of the page
 
+Quote Post
anunakin
post Oct 2 2006, 11:49 AM
Post #11





Group: Members
Posts: 340
Joined: 22-August 04
From: Belem, Brasil
Member No.: 4,358



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
Go to the top of the page
 
+Quote Post
loji
post Oct 2 2006, 11:57 AM
Post #12





Group: Members
Posts: 130
Joined: 11-May 04
Member No.: 3,244



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. : )
Go to the top of the page
 
+Quote Post
uMP2k
post Oct 2 2006, 05:50 PM
Post #13





Group: Members
Posts: 79
Joined: 7-June 06
From: Perth - Sunny Oz
Member No.: 10,104



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.
Go to the top of the page
 
+Quote Post
InSearchOf
post Oct 2 2006, 06:12 PM
Post #14





Group: Admin
Posts: 1,210
Joined: 20-January 06
From: York, Pennsylvania
Member No.: 8,961



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
Go to the top of the page
 
+Quote Post
uMP2k
post Oct 2 2006, 06:17 PM
Post #15





Group: Members
Posts: 79
Joined: 7-June 06
From: Perth - Sunny Oz
Member No.: 10,104



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?
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 22nd November 2014 - 08:46 PM