Author Topic: Swap File Problem  (Read 9318 times)

uMP2k

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • http://
Swap File Problem
« on: October 01, 2006, 10:05:24 pm »
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
My new toy: C1000/pdaXrom/xfce4 and Rox - now I just have to get it all working!.

Other stuff: Axim x50v and a brace of Newtons....!

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Swap File Problem
« Reply #1 on: October 01, 2006, 10:37:16 pm »
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.  

Hope it helps.
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

karlto

  • Sr. Member
  • ****
  • Posts: 343
    • View Profile
    • http://
Swap File Problem
« Reply #2 on: October 01, 2006, 10:37:49 pm »
Quote
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: [Select]
# mkswap /dev/mmcda1
But this is what you should have done (and what the linked thread told you to):
Code: [Select]
# 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!
« Last Edit: October 01, 2006, 10:41:58 pm by karlto »
SL6000-L, RC12

Antikx

  • Hero Member
  • *****
  • Posts: 1147
    • View Profile
    • http://tyrannozaurus.com
Swap File Problem
« Reply #3 on: October 01, 2006, 10:40:42 pm »
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.
Kanpai,
-Antikx (Twitter, Mugshot and PodNova)
C1000 - pdaXrom R198 (Celestial Environment)
tyrannozaurus.com
[img]http://www.tyrannozaurus.com/files/category_pictures/general_1.png\" border=\"0\" class=\"linked-sig-image\" /]
Zaurus news/blogs feed from Zaurus users
Free Windows, Linux, or Web RSS readers.
Featured pages at tyrannozaurus:
Sharp Petition, ScummVM, Cacko, pdaXii13, and Celestial Environment

uMP2k

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • http://
Swap File Problem
« Reply #4 on: October 01, 2006, 11:04:03 pm »
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.
My new toy: C1000/pdaXrom/xfce4 and Rox - now I just have to get it all working!.

Other stuff: Axim x50v and a brace of Newtons....!

Antikx

  • Hero Member
  • *****
  • Posts: 1147
    • View Profile
    • http://tyrannozaurus.com
Swap File Problem
« Reply #5 on: October 01, 2006, 11:32:35 pm »
Good attitude! Have fun!
Linux puts the fun back into modern computing.
Kanpai,
-Antikx (Twitter, Mugshot and PodNova)
C1000 - pdaXrom R198 (Celestial Environment)
tyrannozaurus.com
[img]http://www.tyrannozaurus.com/files/category_pictures/general_1.png\" border=\"0\" class=\"linked-sig-image\" /]
Zaurus news/blogs feed from Zaurus users
Free Windows, Linux, or Web RSS readers.
Featured pages at tyrannozaurus:
Sharp Petition, ScummVM, Cacko, pdaXii13, and Celestial Environment

uMP2k

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • http://
Swap File Problem
« Reply #6 on: October 02, 2006, 12:12:05 am »
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
« Last Edit: October 02, 2006, 12:12:22 am by uMP2k »
My new toy: C1000/pdaXrom/xfce4 and Rox - now I just have to get it all working!.

Other stuff: Axim x50v and a brace of Newtons....!

zeigerpuppy

  • Full Member
  • ***
  • Posts: 109
    • View Profile
Swap File Problem
« Reply #7 on: October 02, 2006, 04:51:05 am »
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?
Zaurus C3100, CE-RH2, Socket lowpower CF Wifi, Socket CF Bluetooth
pdaXrom r198 - testing!, IceWM, Bluetooth modem: Sony Ericsson v600i with 3G.
see some howtos and tips at http://greenant.net/portal/greenant/wiki/Zaurus3100

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Swap File Problem
« Reply #8 on: October 02, 2006, 07:50:16 am »
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.
« Last Edit: October 02, 2006, 07:51:59 am by Capn_Fish »
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

loji

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • http://
Swap File Problem
« Reply #9 on: October 02, 2006, 01:49:02 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.
-> pdaXrom beta 3 fixes & feeds
C-1000 + pdaXrom beta3
linksys wifi + expansions

anunakin

  • Sr. Member
  • ****
  • Posts: 340
    • View Profile
    • http://vivaphp.net
Swap File Problem
« Reply #10 on: October 02, 2006, 03:49:09 pm »
Quote
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.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=142856\"][{POST_SNAPBACK}][/a][/div]

I using this command (128MB file):
Code: [Select]
dd of=swapfile bs=1024 seek=128000 count=0
[img]http://www.vivaphp.net/imagens/rev2.jpg\" border=\"0\" class=\"linked-sig-image\" /]
Anunakin (Marcus Fazzi)

Nokia N900 32GB + microSD 2GB
Nokia N810 w/ microSD 8GB
Nokia 5310 XpressMusic w/ microSD 1GB
HP48GX->Psion Sienna->Palm m130->Tungsten T->Zaurus SL-5500->C3000->C3100 ALL SOLD

My FEED(On Line AGAIN!!!)

loji

  • Full Member
  • ***
  • Posts: 130
    • View Profile
    • http://
Swap File Problem
« Reply #11 on: October 02, 2006, 03:57:23 pm »
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.  : )
-> pdaXrom beta 3 fixes & feeds
C-1000 + pdaXrom beta3
linksys wifi + expansions

uMP2k

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • http://
Swap File Problem
« Reply #12 on: October 02, 2006, 09:50:32 pm »
I have certianly learned some very interesting stuff from this thread!

Loji[/b] - 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   and have now set up a 18mb swap on it using the method you suggest.
My new toy: C1000/pdaXrom/xfce4 and Rox - now I just have to get it all working!.

Other stuff: Axim x50v and a brace of Newtons....!

InSearchOf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1144
    • View Profile
    • http://
Swap File Problem
« Reply #13 on: October 02, 2006, 10:12:48 pm »
Quote
I have certianly learned some very interesting stuff from this thread!

Loji[/b] - 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   and have now set up a 18mb swap on it using the method you suggest.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=142916\"][{POST_SNAPBACK}][/a][/div]

18mb! that is sure tiny...

Late
Sharp Zaurus SL-C3100 and SL-6000L
pdaXrom Developer
Please visit pdaXrom.org for updates
My Blog
IRC #pdaxrom @ FreeNode

uMP2k

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • http://
Swap File Problem
« Reply #14 on: October 02, 2006, 10:17:27 pm »
Quote
Quote
I have certianly learned some very interesting stuff from this thread!

Loji[/b] - 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   and have now set up a 18mb swap on it using the method you suggest.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=142916\"][{POST_SNAPBACK}][/a][/div]

18mb! that is sure tiny...

Late
[div align=\"right\"][a href=\"index.php?act=findpost&pid=142917\"][{POST_SNAPBACK}][/a][/div]

Actually, I was just wondering if what the advantages of a bigger swap file (maybe 64mb) might be?
My new toy: C1000/pdaXrom/xfce4 and Rox - now I just have to get it all working!.

Other stuff: Axim x50v and a brace of Newtons....!