LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 897|回复: 6

关于交换分区的问题

[复制链接]
发表于 2006-6-20 14:22:23 | 显示全部楼层 |阅读模式
今天上午刻坏了3张盘 才装上debian(破刻录机) 分区的时候给交换分区分了1.5G的空间 可是安装完成后变成253M了
Filesystem            容量  已用 可用 已用% 挂载点
/dev/hda1             449M   64M  361M  15% /
tmpfs                 253M     0  253M   0% /dev/shm
/dev/hda6             4.2G   33M  3.9G   1% /home
/dev/hda7             897M  8.1M  841M   1% /tmp
/dev/hda8             3.7G  308M  3.2G   9% /usr
/dev/hda9             2.8G   76M  2.6G   3% /var
/dev/hda10             19G   33M   18G   1% /var/lib/mysql
/dev/hda11            2.8G   38M  2.6G   2% /var/log
/dev/hda12             22G   33M   21G   1% /var/www

怎么回事?  怎么重新划分交换空间 谢谢
 楼主| 发表于 2006-6-20 14:34:02 | 显示全部楼层
下面是我google来的 有点没看懂 是不是在/usr 下建一个100M的文件 然后把它变成交换分区 这个是redhat的方法 不知道在debian适用不
1. choose a location where you have lots of space (/usr comes to mind)
2. create a file the size you want the swap to be:
dd if=/dev/zero of=/usr/swap bs=1024 count=100000
(the above will create a file 100Mb in size, so adjust the count as yousee fit)

/*
Here may be wrong. Comment by baif.
*/

3. run the command: mkswap /usr/swap
4. run the command: swapon /usr/swap
5. check w/ free that you just added 100Mb of swap
6. if you want this to be permanent through reboots, youll need to add the appropriate line to /etc/fstab
回复 支持 反对

使用道具 举报

发表于 2006-6-20 16:59:23 | 显示全部楼层
tmpfs 253M 0 253M 0% /dev/shm
上面这一行不是交换分区的大小,你用 free 命令看一下就知道交换分区的大小及使用情况了。
回复 支持 反对

使用道具 举报

发表于 2006-6-21 06:04:25 | 显示全部楼层
Post by viva55
下面是我google来的 有点没看懂 是不是在/usr 下建一个100M的文件 然后把它变成交换分区 这个是redhat的方法 不知道在debian适用不
1. choose a location where you have lots of space (/usr comes to mind)
2. create a file the size you want the swap to be:
dd if=/dev/zero of=/usr/swap bs=1024 count=100000
(the above will create a file 100Mb in size, so adjust the count as yousee fit)

/*
Here may be wrong. Comment by baif.
*/

3. run the command: mkswap /usr/swap
4. run the command: swapon /usr/swap
5. check w/ free that you just added 100Mb of swap
6. if you want this to be permanent through reboots, youll need to add the appropriate line to /etc/fstab
Try following method:

using fdisk or cfdisk to creat a partition to hold your swap partition, make sure that the type of the newly created partition is swap

mkswap /dev/the-partition-you-just-created, e.g.  mkswap /dev/hda3 etc.
swapon /dev/the-partition-you-just-created

edit /etc/fstab if necessary
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-6-21 11:28:40 | 显示全部楼层
Post by giselly
tmpfs 253M 0 253M 0% /dev/shm
上面这一行不是交换分区的大小,你用 free 命令看一下就知道交换分区的大小及使用情况了。

问下  这行表示的是什么意思 那个区呢
tmpfs 253M 0 253M 0% /dev/shm
回复 支持 反对

使用道具 举报

发表于 2006-6-21 12:03:11 | 显示全部楼层
/dev/shm是你内存的一部分
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-6-24 10:51:25 | 显示全部楼层
Post by njusz
/dev/shm是你内存的一部分

谢谢楼上 ~·
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表