Author Topic: Could somebody teach me how to swap on C3000?  (Read 5683 times)

xandery

  • Newbie
  • *
  • Posts: 5
    • View Profile
Could somebody teach me how to swap on C3000?
« on: November 21, 2004, 02:08:16 pm »
 Sorry, I'm totally a freshman in Zaurus & linux
Could Someone  teach me how to use the 4GBs HD to swap?
I wanna increase my virtual memory
Thanks in advance...

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Could somebody teach me how to swap on C3000?
« Reply #1 on: November 21, 2004, 02:32:30 pm »
OK, probably the easiest way is to make a swap file but first you need to tell me what mount points you have available. I have an SL-C860 not a 3000 so it's going to be different.

So drop to a command prompt, su to root and type the following.

mount

... tell me  what comes back.

Next tell me if any of the following commands return nothing.

which swapon
which dd
which mkswap

- Andy
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

xandery

  • Newbie
  • *
  • Posts: 5
    • View Profile
Could somebody teach me how to swap on C3000?
« Reply #2 on: November 21, 2004, 02:57:15 pm »
#mount
rootfs on / type rootfs (rw)
/dev/root on / type jffs (ro)
/proc on /proc type proc (rw)
/dev mtblock3 on /home type jffs2 (rw,notatime)
/dev/ram1 on /dev type minix (rw)
none on /dev/shm type tmpfs (rw)
/dev/hda1 on /hdd1 type ext3 (rw,notatime)
/dev/hda2 on /hdd2 type ext3 (rw,notatime)
/dev/hda3 on /hdd3 type vfat (rw,notatime)
none on /dev/pts type devpts (rw)
/dev/mmcda1 on / usr/mnt.rom/card type vfat  (rw,notatime)


--------------------------------------------------------------------------

#dd  return nothing

    It's so tired typing so much words......

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Could somebody teach me how to swap on C3000?
« Reply #3 on: November 21, 2004, 05:24:01 pm »
OK, dd is quite important.

Did you type...

which dd

or did you try dd on it's own ?

Let's assume that it's there.

Start with

dd if=/dev/zero of=/hdd3/swapfile bs=1048576 count=64

This will create a file 64Mb in length containing nothing..  If successful it should show 64+0 records in and 64+0 records out. Then you run...

mkswap /hdd3/swapfile

This will write a swap file system into the file. Then..

swapon /hdd3/swapfile

This actually activates the swap. If you get through that and swap is active (swapon -s will show status) then you may want to add the following line to the END of /etc/fstab

/hdd3/swapfile               swap                 defaults               0 0

This will mount he swap file on each system boot. I would suggest that you run for a while without the fstab line though JUST in case there are problems with suspend/resume to swapfiles on the HDD of the SL-C3000. We know that Microdrives cause problems to other Zs on Suspend/Resume.... If you can suspend/resume and are happy with the stability then add the fstab line.

Please let us know how you get on

- Andy
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

xandery

  • Newbie
  • *
  • Posts: 5
    • View Profile
Could somebody teach me how to swap on C3000?
« Reply #4 on: November 22, 2004, 12:18:38 am »
Thanks!
It works great on my C3000.
And I've added the  "/hdd3/swapfile swap default 0 0" line at the end of my /etc/fstab.
It's so nice of you to teach me so nuch things    

hkamuro

  • Newbie
  • *
  • Posts: 10
    • View Profile
Could somebody teach me how to swap on C3000?
« Reply #5 on: December 05, 2004, 10:44:17 am »
I am also a new C3000 user.
I have followed what Andy has taught, however, I cannot use "swapon -s" command to see the status of swap.

It only has swapon -a command in C3000.

Anyone has idea about how can I check the swap status? Thanks.

- Ken

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Could somebody teach me how to swap on C3000?
« Reply #6 on: December 05, 2004, 11:07:07 am »
Ah yes, the version in the Sharp ROM is part of busybox and doesn't have the feature.

Try...

cat /proc/swaps

- Andy
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

hkamuro

  • Newbie
  • *
  • Posts: 10
    • View Profile
Could somebody teach me how to swap on C3000?
« Reply #7 on: December 06, 2004, 05:23:08 am »
Thanks. Andy.

I can check the swap status now.

However, I found that the speed of the application is running slower than before, is it normal?

And how can I revert back to original settings?

Sorry for so many questions.

- Ken

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Could somebody teach me how to swap on C3000?
« Reply #8 on: December 06, 2004, 05:40:31 am »
It is normal to see some performance degradation when utilising the swap, it just means that you will be less likely to run out of memory when running complex tasks like compiling etc.

If you are not doing much of this I would suggest only enabling swap when you are potentially likely to run out of memory.

Your system may be showing quite high memory utilisation with little or nothing running, however, this is probably due to memory allocation to the cache pool and when programs need more memory they will reclaim it from the cache pool if there is no other place to get it. This is far faster than swapping.

swapoff -a

will temporarily disable the swap. If you decide that you don't want it at boot take the line back out of /etc/fstab

- Andy
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

darkloran

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • http://freeloran.free.fr/zaurus.html
Could somebody teach me how to swap on C3000?
« Reply #9 on: December 09, 2004, 02:19:10 am »
hello

  i have a Z 3k, i've added swap like described here. it works fine, thanks.

  i have a question on "tmpfs". There is a special partition called /dev/shm, which is of tmpfs type and is used by applications to launch themselves.

  when i have a "calendar", a "music player" and a "terminal" opened. I cannot use vi in terminal to edit a file, because /dev/shm is full. It's by default 1m. I guess this partition is created in "RAM". If so i can make it bigger through the fstab. Can you confirm ?

thank you

loran
SL-C3000 -- Cacko1.23b1
CE-RH2 remote / Belkin usblan / Asus WL-110 / Sandisk SD UII 256MB / Sandisk CF UII 1GB
STOREX OTG Club 40GB / Belkin IR Keyboard / Logitech mouse

sharppda

  • Newbie
  • *
  • Posts: 11
    • View Profile
Could somebody teach me how to swap on C3000?
« Reply #10 on: December 15, 2004, 09:23:00 am »
when i have a "calendar", a "music player" and a "terminal" opened. I cannot use vi in terminal to edit a file, because /dev/shm is full. It's by default 1m. I guess this partition is created in "RAM". If so i can make it bigger through the fstab. Can you confirm ?

  I had a similiar problem. Seems it does not work by changing size in fstab.

  As a temporary solution I just symlink /dev/shm/tmp to anywhere I want.

   After the job is done ( I was compiling something) , I move it back because from other discussions that tmp/ should be remaining in RAM to avoid wearing on your CF/SD.

   Hope this help

slackwaresupport

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Could somebody teach me how to swap on C3000?
« Reply #11 on: January 06, 2005, 05:22:59 pm »
why not just reconfigure it in the fstab?

like

dev/mtdblock2  /               jffs2   ro,noatime      1  1
/dev/mtdblock3  /home           jffs2   defaults,noatime        1  2
#none           /dev/shm        tmpfs   size=1m,noauto  0  0
none          /hdd3/tmp         tmpfs   size=250m,noauto        0  0
dev/mmcda1      /mnt/card       auto    noauto,owner    0  0
none            /dev/pts        devpts  gid=5,mode=620  0  0
/hdd3/swapfile  swap            defaults                0       0

darkloran

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • http://freeloran.free.fr/zaurus.html
Could somebody teach me how to swap on C3000?
« Reply #12 on: January 18, 2005, 04:00:57 am »
Quote
why not just reconfigure it in the fstab?
like
none          /hdd3/tmp         tmpfs   size=250m,noauto        0  0
i believe we don't need such amount of tmpfs !

i've found how to tweak this value. You have to modify the value in /etc/fstab
for example put size=4m and you too have to change this value in /root/etc/rc.d/rc.rofilesys

to modify this last script you must be root and remount slash as rw with
Code: [Select]
mount -o remount,rw /i've found that 4m is a good value for tmpfs for my own use.

loran
SL-C3000 -- Cacko1.23b1
CE-RH2 remote / Belkin usblan / Asus WL-110 / Sandisk SD UII 256MB / Sandisk CF UII 1GB
STOREX OTG Club 40GB / Belkin IR Keyboard / Logitech mouse