LinuxÏÂÔö¼ÓSwap¿Õ¼ä
http://inthirties.com:90/thread-1228-1-1.html
Ò»¡¢·ÖÇø·½Ê½
1.´´½¨swap·ÖÇø£¬ÀýÈ磺
# fdisk /dev/sdb
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-13054, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-13054, default 13054):
+100M
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 82
Changed system type of partition 1 to 82 (Linux swap / Solaris)
Command (m for help): w
The partition table has been altered!
2. ͬ²½·ÖÇø±í
# partprobe
3.ÉèÖý»»»Çø
# mkswap /dev/sdb1
4.±à¼/etc/fstabÎļþ
Ìí¼ÓÈçÏÂÄÚÈÝ£º
/dev/sdb1 swap swap defaults 0 0
5.ÆôÓÃswap ·ÖÇø
# swapon -a
6.ÑéÖ¤swap·ÖÇøÊÇ·ñÆôÓÃ
# swapon -s
Filename Type Size Used Priority
/dev/sdb1 partition 104380 0 -2
¶þ¡¢Îļþ·½Ê½
1.´´½¨Îļþ
# dd if=/dev/zero of=/swapfile bs=1024 count=100
2. ²é¿´ÎļþÊôÐÔ
# ls -lh /swapfile
-rw-r--r-- 1 root root 100K Apr 24 16:54 /swapfile
3. ÉèÖÃswap
# mkswap /swapfile
4.±à¼/etc/fstabÎļþ
Ìí¼ÓÈçÏÂÄÚÈÝ£º
/swapfile swap swap defaults 0 0
5. ÆôÓÃswap
# swapon /swapfile
6.ÑéÖ¤swapÊÇ·ñÆôÓÃ
# swapon -s
Filename Type Size Used Priority
/swapfile file 92 0 -3
ËÑË÷¸ü¶àÏà¹ØÖ÷ÌâµÄÌû×Ó: linux
solaris
swap
ÌṩOracle¹ÜÀí/¹ÊÕÏ´¦Àí/ÓÅ»¯/°²×°/RAC/±¸·Ý»Ö¸´¼¼Êõ·þÎñ,ÌṩרҵµÄOracleÅàѵºÍ×Éѯ·þÎñ¡£
Óʼþ: inthirties@gmail.com
MSN: inthirties@hotmail.com
QQ: inthirties@qq.com
רҵÂÛ̳ http://www.inthirties.com
¼¼Êõ²©¿Í http://blog.csdn.net/inthirties
¸öÈËÕ¾µã http://blog.inthirties.com
Ïà¹ØÎĵµ£º
ϵͳ
# uname -a # ²é¿´ÄÚºË/²Ù×÷ϵͳ/CPUÐÅÏ¢
# head -n 1 /etc/issue # ²é¿´²Ù×÷ϵͳ°æ±¾
# cat /proc/cpuinfo # ²é¿´CPUÐÅÏ¢
# hostname # ²é¿´¼ÆËã»úÃû
# lspci -tv # ÁгöËùÓÐPCIÉ豸
# lsusb -tv # ÁгöËùÓÐUSBÉ豸
# lsmod # ......
opendir£¨´ò¿ªÄ¿Â¼£©
Ïà¹Øº¯Êý
open£¬readdir£¬closedir£¬rewinddir£¬seekdir£¬telldir£¬scandir
±íÍ·Îļþ
#include<sys/types.h>
#include<dirent.h>
¶¨Ò庯Êý
DIR * opendir(const char * name);
º¯Êý˵Ã÷
opendir()ÓÃÀ´´ò¿ª²ÎÊýnameÖ¸¶¨µÄĿ¼£¬²¢·µ»ØDIR*ÐÎ̬µÄĿ¼Á÷£¬ºÍopen()ÀàËÆ£¬½ÓÏ ......
linuxÄÚºËprintkµ÷ÊÔ£¨ÕªÂ¼¡¶Linux°²È«Ìåϵ·ÖÎöÓë±à³Ì¡·£©
linuxÄÚºËprintkµ÷ÊÔ£¨ÕªÂ¼¡¶Linux°²È«Ìåϵ·ÖÎöÓë±à³Ì¡·£©
1 printk¼°¿ØÖÆ̨µÄÈÕÖ¾¼¶±ð
º¯ÊýprintkµÄʹÓ÷½·¨ºÍprintfÏàËÆ£¬ÓÃÓÚÄں˴òÓ¡ÏûÏ¢¡£printk¸ù¾ÝÈÕÖ¾¼¶±ð£¨loglevel£©¶ÔÏûÏ¢½øÐзÖÀà¡£
ÈÕÖ¾¼¶±ðÓú궨Ò壬ÈÕÖ¾¼¶±ðºêÕ¹¿ªÎªÒ»¸ö×Ö·û´®£¬ÔÚ±àÒ ......