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

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Creating a Swap File
qx773
post Feb 10 2004, 08:32 PM
Post #1





Group: Members
Posts: 219
Joined: 10-February 04
Member No.: 1,807



Netfront v3.0 or the JavaScript software apparently use more memory than Opera. I ran out of memory while trying to use Ameritrade's portfolio page. If you have an SD or MMC memory card, you can create a 32MB swap file on it, like the following from the terminal:

cd /mnt/card
dd if=/dev/zero of=swapfile bs=32M count=1


or

cd /mnt/cf
dd if=/dev/zero of=swapfile bs=32M count=1


for a compact flash card. Using a higher block size like 64M results in an error message. It seems like some kind of signed 16 bit representation is getting in the way. You can use small block sizes and counts greater than one to get past this limit.

Then, format the swapfile:

mkswap swapfile
su root
swapon swapfile
exit
free


The free command will show you how much, if any, swap memory is activated.
Go to the top of the page
 
+Quote Post
imrambi
post Feb 10 2004, 08:49 PM
Post #2





Group: Members
Posts: 30
Joined: 2-February 04
Member No.: 1,674



You could download the Memory Applet that will create swaps upto 8megs
Go to the top of the page
 
+Quote Post
slocaus
post Feb 10 2004, 10:49 PM
Post #3





Group: Members
Posts: 243
Joined: 16-December 03
From: San Luis Obispo, Ca, USA
Member No.: 1,205



Or do a 16M with dd (32M gives a "dd: Memory Exhausted error") on my 5500. Then use the Memory Applet to activate / deactivate it. smile.gif
Go to the top of the page
 
+Quote Post
havoc
post Feb 27 2004, 09:35 PM
Post #4





Group: Members
Posts: 69
Joined: 8-February 04
Member No.: 1,760



I've got my swap partition on my SD card, but I can't seem to find a place in /etc/rc.d to have it "swapon -a" at boot. Have the files never run!

I'm getting frustrated....
Go to the top of the page
 
+Quote Post
lardman
post Feb 28 2004, 03:46 AM
Post #5





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



the rc.d scripts never actually finish running. Make sure you place it before SXXOpie or SXXQtopia (or whatever the scripts are called which start the GUI).

or

you could stick it in /etc/init.d/opie (or qtopia or whatever it's called) which is the script which the above entries call.


Si
Go to the top of the page
 
+Quote Post
hamiltonpruim
post Feb 28 2004, 05:21 AM
Post #6





Group: Members
Posts: 22
Joined: 21-January 04
Member No.: 1,494



I'd appreciate some advice for what I'm trying to do, too. I've successfully used fdisk to partition my (64Mb) SD into 40Mb FAT16 and 24Mb Swapfile, and I can mount the FAT16 partition. However, the card appears RO (although mount says RW) and even after mkswap /dev/mmcda2 and swapon /dev/mmcda2 it doesn't seem to recognise the swapfile. As I am new to linux, I am probably doing somthing stoopid, but any ideas, please?

(oops just seen the forum is 7x0 and mine is 5600, but that shouldn't make a difference, should it?)

Hamilton
Go to the top of the page
 
+Quote Post
qx773
post Mar 1 2004, 08:51 PM
Post #7





Group: Members
Posts: 219
Joined: 10-February 04
Member No.: 1,807



What does the free program tell you about how much swap is being used? It should not be necessary to create a separate partition for a swap file. SD cards have a physical write protection switch like floppy disks, so you have to make sure that the switch is not loose. What are the contents of your /etc/fstab file?
Go to the top of the page
 
+Quote Post
newkirk
post Mar 3 2004, 12:39 AM
Post #8





Group: Members
Posts: 74
Joined: 28-May 03
From: Pennsauken NJ
Member No.: 60



I keep trying to create a 32mb swapfile on internal flash with:
cd /home
dd if=/dev/zero of=swapfile bs=32M count=1
mkswap swapfile
swapon swapfile

and swapon always returns:
swapon: swapfile: invalid argument

(on pdaXrom as root)

I've tried with and without /etc/fstab entry, with different sizes, all to no avail.

What am I doing wrong?

j
Go to the top of the page
 
+Quote Post
post Mar 3 2004, 12:56 AM
Post #9





Group:
Posts: 0
Joined: --
Member No.: 0



qx733...... you were right... free reports the swapfile (sorry but I am a linux noobie), it seems to get used, too! laugh.gif Removing the SD I could see the read protect, flicking it up and down seems to have sorted that, too. All I have to do now is (edit the fstab file?) make it run like that on startup......

Hamilton
Go to the top of the page
 
+Quote Post
qx773
post Mar 3 2004, 07:09 PM
Post #10





Group: Members
Posts: 219
Joined: 10-February 04
Member No.: 1,807



I recommend that you not create a swap file in your internal flash memory. If you burn out your internal flash memory, then there is no replacement for it short of replacing your entire handheld computer or getting out the tweezers and needle-nose solidering iron and attempting to desolder a surface-mounted chip to replace the internal flash memory. External flash cards are cheap, some less than $1 per megabyte. Using flash memory for a swapfile will cause more rapid aging of the flash memory than using it just as a file system. In the future, perhaps we will have ferroelectric memory cards or ovonic unified memory cards that will have much higher write endurance than flash memory cards.

From the clues I have been able to piece together, it appears that the bs=32M parameter causes the dd program to create a buffer of equal size in SDRAM before it writes the contents of the buffer to the output file. So, it might be better to use a smaller buffer size and a larger count like:

dd if=/dev/zero of=swapfile bs=1M count=32

You might not have 32MB of free space in your internal flash memory. The du command will tell you how much disk space has been used.

Regarding getting the swap file to work on boot-up: If you already have a separate partition for the swap space, then you can run "su root" to become the system administrator and then edit the /etc/fstab file. I do not recall off the top of my head the syntax for that. Someone else here probably knows, or you can read a reference manual.

If you use a swap file, instead of a swap partition, then you might have to run "su root" to gain full system access on the command line and edit the /root/etc/rc.d/rc.sysinit file and uncomment the section that runs the rc.local script. The Zaurus computers with the default ROM are somewhat non-standard in the places where they place some configuration files like rc.sysinit. Then put the "swapon /path/filename" command in the rc.local file. Someone else on the board mentioned how to make /root writable with the mount command.
Go to the top of the page
 
+Quote Post
qx773
post Mar 3 2004, 07:20 PM
Post #11





Group: Members
Posts: 219
Joined: 10-February 04
Member No.: 1,807



The df program might actually be better for determining how much free space is left on your partitions. The du program will tell you about the disk usage of the current directory and any subdirectories.
Go to the top of the page
 
+Quote Post
post Mar 8 2004, 08:20 PM
Post #12





Group:
Posts: 0
Joined: --
Member No.: 0



Thanks all for advice. I'm familiar with the commands (I'm a linux sysadmin) but couldn't figure out why it wasn't working. (I expect that it's because /home is jffs2)

When I performed the precise same sequence but on SD instead of /home it worked as expected. The problem was/is that pdaXrom won't let me partition with / larger than 50mb. My usage calls for large space for installing apps and tools, but I don't need much storage space (/home). Since the size issue was driving me to install packages to SD, I wanted to put swapfile in /home since it was still essentially vacant.

Hopefully I'll be able to successfully repartition with 100mb for / eventually...

j
Go to the top of the page
 
+Quote Post
edwinbradford
post Sep 18 2004, 11:30 AM
Post #13





Group: Members
Posts: 46
Joined: 25-July 04
Member No.: 4,099



QUOTE
Someone else on the board mentioned how to make /root writable with the mount command.


It's at http://www.oesf.org/forums/inde...?showtopic=1543

QUOTE
The 5600 ROM is a readonly JFFS2 partition, so to make the 5600 ROM writable just run this command as root:

mount / -o rw,remount

Then replace the files you need to change and run this command to protect the ROM again:

mount / -o ro,remount

No reboot required


I'm a novice but tried it and it works.
Go to the top of the page
 
+Quote Post

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

 



RSS Lo-Fi Version Time is now: 18th December 2014 - 08:40 PM