Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Zaurus 中文论坛 Forum Index » pdaXrom & debain & openBSD

This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
怎么划分swap分区,要详细
View previous topic :: View next topic  
Author Message
xiaoyaosou



Joined: 28 Nov 2007
Posts: 9

小企鹅: 252

PostPosted: 2007-Nov-30 Fri, pm1:42 Reply with quote
 Post subject: 怎么划分swap分区,要详细

要最好的最适合sl-750的分区方法,谢谢
Back to top
View user's profile Send private message
ccpaging



Joined: 07 Dec 2006
Posts: 757

小企鹅: 16604

PostPosted: 2007-Dec-01 Sat, pm4:06 Reply with quote
 Post subject:

常见问题里边有,搜索一下。
_________________
SL-C1000, 1G CF, 1G SD
pdaxrom 1.1beta3
Roku Wifi Card(Used in Cacko 1.23 & pdaXrom 1.1 Beta3)
http://ccpaging.blog.ubuntu.org.cn/
http://ccpaging.osall.com/
http://blog.sina.com.cn/zaurus/
Back to top
View user's profile Send private message
n00544



Joined: 26 Apr 2006
Posts: 26

小企鹅: 756

PostPosted: 2007-Dec-06 Thu, pm5:00 Reply with quote
 Post subject: 我这里有一篇蛛蛛侠的文章,但是无法操作,请大家来谈论一下

猪猪侠--天健,致远




Pdaxrom下自动加载swap分区

Info *文章信息*

关键字:zaurus,pdaxrom,swap
本文版本:2
最后修改于 2007-08-30 18:10:12
本文章参考了Lonelyp(杀手)的Blog

注:本文章适用于C750/760/860,7500C,C1000,C3X00,用于pdaXrom
2.4.18/2.4.20 kernel的pdaXrom,2.6.20的pdaxrom系统会在启动时自动检测是否
有swap,会自动加载,meanie做的pdaXii13(2.4.20 kernel)的系统也进行了配置
了,可以在启动时自动加载swap,不必进行此操作。

一 选择开swap的存储介质(SD与CF) --Zaurus支持SD与CF这两种存储卡,

1.SD
SD协议是封闭的,高速SD卡开了4个数据通道,而zaurus只开了其中一条通道,所
以高速SD卡,到zaurus上只有1/4速度了。也就是说高速SD在Z机上也只能低速来读
写,高速与否意义不大。swap开在SD上,速度其实很慢的,但C1000及以下型号
zaurus,只有一个CF口与SD口,CF可以扩展WIFI,GPRS,BlueTooth.zaurus的SD口
没带SDIO的function(汗一下,SD的扩展设备还是很贵的,相比CF设备),所以,
C1000以下的用户为了能用CF口扩
展,还是选择SD作为开swap。

2.CF
CF卡在Zaurus就可以全速运行了,高速的CF卡开了swap后,明显速度比SD要快上不
少。C3X00可以把内置的CF开swap,所以不用SD。

二 存储卡分区

1.选择好你要分区的存储卡后,就进行分区。

2.分成2个分区,一个是ext3,一个是swap分区。swap大小256M(注:编译程序,建
议开了256M,不编译程序的话,128M应该就可以了,一般人建议开128M或64M都可以了)

3.分区顺序,ext3一定要分在第一个分区,这样改动最小,swap就是swap分区,不
是ext3。

因为,系统默认只挂载SD/CF卡的第一个分区,所以,无论你用什么卡了,开了多
少个分区,用了什么格式,在XP下(PC机上),只认第一分区,其余的都不认。所
以,分区多少,格式如何只对Z机有意义,对PC没意义,如果你想开个FAT格式的分
区来读写的话,对不起,除非你拿第一个分区来作FAT,否则PC上认不出来。因为
XP读的也是SD卡的第一个分区,而这个分区是ext3,所以无法识别,所以建议你把
SD卡分成2个分区,第一个是ext2/3,第二个是swap分区。这样CF卡可以用于与PC
交换数据,CF高速卡的速度优势也可以体现出来。常用CF口的WIFI上网的人,选择
SD卡来作EXT3和SWAP。(你必须要有一个EXT3分区,以安装程序到卡上,并且这个
分区必须是第一分区)

4.进行分区操作

在C750/C760/C860/7500C中,

SD在系统里的设备是:
/dev/mmcd/disc0/part1 <--第一分区
/dev/mmcd/disc0/part2 <--第二分区

CF在系统里的设备是:
/dev/hda1 <--第一分区
/dev/hda2 <--第二分区
...
/dev/hdaN <--第N分区
以此类推

在C1000/C3X00里

SD在系统里的设备是:
/dev/mmcda1 <--第一分区
/dev/mmcda2 <--第二分区

CF在系统里的设备是:
/dev/hda1 <--第一分区
/dev/hda2 <--第二分区
...
/dev/hdaN <--第N分区


注:因为C3X00有内置的CF微硬盘,所以外置的CF是hdc.


好了一不做二不休,打开console,用fdisk重新分区。

#umount /dev/mmcda1

接着fdisk分区

# fdisk /dev/hda

在fidsk的命令模式,使用d命令,分别删除原来的分区

Command (m for help): d
Partition number (1-4): 1

接着用n命令新建分区

Command (m for help): n
Command action
p
1
First cylinder (1-xxxx, default 1) (直接Enter回车,使用默认值)
Last cylinder or +size or +sizeM or +sizeK (1-xxxx): +872M

继续创建第二个分区

Command (m for help): n
Command action
p
2
First cylinder (xxxx-yyyy, default xxxx) (直接Enter回车,使用默认值)
Last cylinder or +size or +sizeM or +sizeK (xxxx-yyyy): +256M

好啦,分区创建完了,用w命令保存分区表吧

Command (m for help): w

# mke2fs -j /dev/mmcda1
# mkswap /dev/mmcda2

现在分区都能用了,把它们都mount起来

# mount /dev/mmcda1 /mnt/card
# swapon /dev/mmcda2

好了,现在分区弄好了,如何使机子在开机的时候自动加载swap呢?

修改 /etc/fstab ,在最后加入一行。

/dev/mmcda2 swap swap defaults 0 0


保存后,在/etc/rc.d/init.d目录下创建一个脚本。

# vi swap

脚本的内容如下:

#!/bin/sh
case "$1" in
start)
/sbin/swapon -a
;;
stop)
/sbin/swapoff -a
;;
esac
exit 0

保存后,给文件加上可执行属性

# chmod +x swap

然后,给run level 3,run level 5和run level 6做symbol link,让系统在启动
时(run

level 5)自动加载和关闭时(run level 6)自动卸载SWAP。
#cd /etc/rc.d/rc3.d
#ln -s ../init.d/swap S90swap

#cd /etc/rc.d/rc5.d
#ln -s ../init.d/swap S90swap

#cd /etc/rc.d/rc6.d
#ln -s ../init.d/swap K30swap

修改fstab以后,reboot时就会自动装载。但是考虑偶尔可能会弹出SD卡,所以还
要修改

/etc/sdcontrol
如果你升级过sd卡驱动。(为sdcard_2.4.20_armv5tel.ipk)
在/ etc / sdcontrol
你打开sdcontrol
先找到SD_MODULE=那一行
改成
SD_MODULE=sharp_mmcsd_m

如果没有升级SD卡驱动,这里就不要改动

下面修改sdcontrol的其它内容:
if [ -f /usr/bin/ipkg-link ]; then
/usr/bin/ipkg-link mount $MOUNT_POINT
fi 70
swapon -a #新增
;;
'eject') 73
swapoff -a #新增
if [ "$STORAGE_DEV" = "$DEVICE" ]; then
if [ $STORAGE_PID ]; then
kill -HUP "$STORAGE_PID"
fi
fi

增加swapon和swapoff

'compeject') 91
swapoff -a #新增
if [ "$STORAGE_DEV" = "$DEVICE" ]; then
if [ $STORAGE_PID ]; then
kill -HUP "$STORAGE_PID"
fi
fi
is_mount=`mount | fgrep $DEVICE`
if [ ! "$is_mount" = "" ]; then
fuser -k -m $DEVICE > /dev/null
if [ $? != 0 ]; then
usleep 500000
umount $MOUNT_POINT
fi
fi 107
swapoff -a #新增
card_detach
;;

好啦,搞定,重起测试ok !
#reboot
Back to top
View user's profile Send private message AIM Address374728 MSN Messenger
Display posts from previous:     
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Zaurus 中文论坛 Forum Index » pdaXrom & debain & openBSD All times are GMT + 8 Hours
Page 1 of 1

 
Jump to:   
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum

[ 页面生成时间: 秒 ] :: [ 次查询 ] :: [ ]
Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional