Home > zaurus > swapファイルの作成

swapファイルの作成

  • Posted by: YAMAGISHI Norimasa
  • 2006年4月 4日 00:00
  • zaurus

いままでは、swapがなくても、問題なく動作してきたが、TTextReaderやyahoonewsTTRの起動時に"SlSharedManager: can't get proc entry"のエラーが出るようになり、この原因がメモリ不足にあるという情報をWeb上で見つけたので、swapを作成することにした。

$ su
# dd if=/dev/zero of=/hdd3/.swap bs=512 count=131072

(64MB)

# mkswap /hdd3/.swap
# swapon /hdd3/.swap

# vi /etc/fstab

/hdd3/.swap      swap    swap    defaults        0 0

# vi /etc/rc.d/init.d/swap

#!/bin/bash

# rc.swap 1.00 2002/12/30 03:46:43 (Kenichi Okada)
#

# Source function library.
. /etc/rc.d/init.d/functions

usage()
{
    echo "Usage: $0 {start|stop|status|restart|reload}"
}

if [ $# -lt 1 ] ; then usage ; exit 0 ; fi
action=$1

case "$action" in

start)
    msg -n "Activating swap:"
    swapon -a 2>/dev/null
    RETVAL=$?
    if [ $RETVAL -eq 0 ]; then
	msg " done."
    else
	msg " failed."
    fi
    ;;

stop)
    msg -n "Deactivating swap:"
    swapoff -a 2>/dev/null
    RETVAL=$?
    if [ $RETVAL -eq 0 ]; then
	msg " done."
    else
	msg " failed."
    fi
    ;;

status)
    cat /proc/swaps
    ;;

restart|reload)
    $0 stop
    $0 start
    ;;

*)
    usage
    ;;

esac

exit 0

# chmod a+x /etc/rc.d/init.d/swap

# cd /etc/rc.d
# for i in rc3.d rc4.d rc5.d
do
cd $i
ln -s ../init.d/swap S30swap
cd ..
done
# for i in rc0.d rc6.d
do
cd $i
ln -s ../init.d/swap K70swap
cd ..
done

Trackbacks:0

TrackBack URL for this entry
http://rally.jp/cgi-bin/mt/mt-tb.cgi/1585
Listed below are links to weblogs that reference
swapファイルの作成 from Computer

Home > zaurus > swapファイルの作成

Search
etc...
Feeds

Return to page top