Ãæ¶ÔÒÑ°²×° Linux µÄÖ÷»ú²¢¶Ô½»»»¿Õ¼äµÄÐèÇ󲻶ϱ仯£¬ÓÐʱÓбØÒªÐÞ¸Äϵͳ¶¨ÒåµÄ½»»»¿Õ¼äµÄ´óС¡£´Ë¹ý³Ì¿ÉÓÃÓÚÐèÒªÔö¼Ó½»»»¿Õ¼ä´óСµÄÈκÎÇé¿ö¡£Ëü¼ÙÉèÓÐ×ã¹»µÄ¿ÉÓôÅÅ̿ռ䡣´Ë¹ý³Ì»¹¼ÙÉè´ÅÅÌ·ÖÇøΪ “ÔʼµÄ” EXT4 ºÍ½»»»·ÖÇø£¬¶ø²»ÊÇʹÓÃÂß¼¾í¹ÜÀí£¨LVM£©¡£
»ù±¾²½ÖèºÜ¼òµ¥:
- ¹Ø±ÕÏÖÓеĽ»»»¿Õ¼ä¡£
- ´´½¨ËùÐè´óСµÄн»»»·ÖÇø¡£
- ÖضÁ·ÖÇø±í¡£
- ½«·ÖÇøÅäÖÃΪ½»»»¿Õ¼ä¡£
- Ìí¼ÓзÖÇøµ½
/etc/fstab ¡£
- ´ò¿ª½»»»¿Õ¼ä¡£
Ó¦¸Ã²»ÐèÒªÖØÐÂÆô¶¯»úÆ÷¡£
ΪÁË°²È«Æð¼û£¬Ôڹرս»»»¿Õ¼äÇ°£¬ÖÁÉÙÄãÓ¦¸ÃÈ·±£Ã»ÓÐÓ¦ÓóÌÐòÔÚÔËÐУ¬Ò²Ã»Óн»»»¿Õ¼äÔÚʹÓá£free »ò top ÃüÁî¿ÉÒÔ¸æËßÄã½»»»¿Õ¼äÊÇ·ñÔÚʹÓÃÖС£ÎªÁ˸ü°²È«£¬Äú¿ÉÒÔ»Ö¸´µ½ÔËÐ춱ð 1 »òµ¥Óû§Ä£Ê½¡£
ʹÓùرÕËùÓн»»»¿Õ¼äµÄÃüÁî¹Ø±Õ½»»»·ÖÇø£º
swapoff -a
ÏÖÔڲ鿴ӲÅÌÉϵÄÏÖÓзÖÇø¡£
fdisk -l
Õ⽫ÏÔʾÿ¸öÇý¶¯Æ÷ÉϵķÖÇø±í¡£°´±àºÅ±êʶµ±Ç°µÄ½»»»·ÖÇø¡£
ʹÓÃÒÔÏÂÃüÁîÔÚ½»»¥Ä£Ê½ÏÂÆô¶¯ fdisk £º
fdisk /dev/<device name>
ÀýÈ磺
fdisk /dev/sda
´Ëʱ£¬fdisk Êǽ»»¥·½Ê½µÄ£¬Ö»ÔÚÖ¸¶¨µÄ´ÅÅÌÇý¶¯Æ÷ÉϽøÐвÙ×÷¡£
ʹÓà fdisk µÄ p ×ÓÃüÁîÑéÖ¤´ÅÅÌÉÏÊÇ·ñÓÐ×ã¹»µÄ¿ÉÓÿռäÀ´´´½¨ÐµĽ»»»·ÖÇø¡£Ó²ÅÌÉϵĿռäÒÔ 512 ×ֽڵĿéÒÔ¼°ÆðʼºÍ½áÊøÖùÃæ±àºÅµÄÐÎʽÏÔʾ£¬Òò´ËÄú¿ÉÄÜÐèÒª×öһЩ¼ÆËãÀ´È·¶¨·ÖÅä·ÖÇøÖ®¼äºÍĩβµÄ¿ÉÓÿռ䡣
ʹÓà n ×ÓÃüÁî´´½¨ÐµĽ»»»·ÖÇø¡£fdisk »áÎÊÄ㿪ʼÖùÃ档ĬÈÏÇé¿öÏ£¬ËüÑ¡Ôñ±àºÅ×îµÍµÄ¿ÉÓÃÖùÃæ¡£Èç¹ûÄãÏë¸Ä±äÕâÒ»µã£¬ÊäÈ뿪ʼÖùÃæµÄ±àºÅ¡£
fdisk ÃüÁîÔÊÐíÄãÒÔ¶àÖÖ¸ñʽÊäÈë·ÖÇøµÄ´óС£¬°üÀ¨×îºóÒ»¸öÖùÃæºÅ»ò×Ö½Ú¡¢KB »ò MB µÄ´óС¡£ÀýÈ磬¼üÈë 4000M £¬Õ⽫ÔÚзÖÇøÉÏÌṩ´óÔ¼ 4GB µÄ¿Õ¼ä£¬È»ºó°´»Ø³µ¼ü¡£
ʹÓà p ×ÓÃüÁîÀ´ÑéÖ¤·ÖÇøÊÇ·ñ°´ÕÕÖ¸¶¨µÄ·½Ê½´´½¨µÄ¡£Çë×¢Ò⣬³ý·ÇʹÓýáÊøÖùÃæ±àºÅ£¬·ñÔò·ÖÇø¿ÉÄÜÓëÄãÖ¸¶¨µÄ²»ÍêÈ«Ïàͬ¡£fdisk ÃüÁîÖ»ÄÜÔÚÕû¸öÖùÃæÉÏÔöÁ¿µÄ·ÖÅä´ÅÅ̿ռ䣬Òò´ËÄãµÄ·ÖÇø¿ÉÄܱÈÄãÖ¸¶¨µÄÉÔС»òÉÔ´ó¡£Èç¹û·ÖÇø²»ÊÇÄúÏëÒªµÄ£¬Äã¿ÉÒÔɾ³ýËü²¢ÖØд´½¨Ëü¡£
ÏÖÔÚÖ¸¶¨Ð·ÖÇøÊǽ»»»·ÖÇøÁË ¡£×ÓÃüÁî t ÔÊÐíÄãÖ¸¶¨¶¨·ÖÇøµÄÀàÐÍ¡£ËùÒÔÊäÈë t £¬Ö¸¶¨·ÖÇøºÅ£¬µ±ËüÒªÇóÊ®Áù½øÖÆ·ÖÇøÀàÐÍʱ£¬ÊäÈë 82 £¬ÕâÊÇ Linux ½»»»·ÖÇøÀàÐÍ£¬È»ºó°´»Ø³µ¼ü¡£
µ±Äã¶Ô´´½¨µÄ·ÖÇø¸Ðµ½ÂúÒâʱ£¬Ê¹Óà w ×ÓÃüÁеķÖÇø±íдÈë´ÅÅÌ¡£fdisk ³ÌÐò½«Í˳ö£¬²¢ÔÚÍê³ÉÐ޸ĺóµÄ·ÖÇø±íµÄ±àдºó·µ»ØÃüÁîÌáʾ·û¡£µ± fdisk Íê³ÉдÈëзÖÇø±íʱ£¬»áÊÕµ½ÒÔÏÂÏûÏ¢:
The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot. Syncing disks.
´Ëʱ£¬ÄãʹÓà partprobe ÃüÁîÇ¿ÖÆÄÚºËÖØжÁÈ¡·ÖÇø±í£¬ÕâÑù¾Í²»ÐèÒªÖ´ÐÐÖØÐÂÆô¶¯»úÆ÷¡£
partprobe
ʹÓÃÃüÁî fdisk -l Áгö·ÖÇø£¬Ð½»»»·ÖÇøÓ¦¸ÃÔÚÁгöµÄ·ÖÇøÖС£È·±£ÐµķÖÇøÀàÐÍÊÇ “Linux swap”¡£
ÐÞ¸Ä /etc/fstab ÎļþÒÔÖ¸ÏòеĽ»»»·ÖÇø¡£ÈçÏÂËùʾ£º
LABEL=SWAP-sdaX swap swap defaults 0 0
ÆäÖÐ X ÊÇ·ÖÇøºÅ¡£¸ù¾Ýн»»»·ÖÇøµÄλÖã¬Ìí¼ÓÒÔÏÂÄÚÈÝ£º
/dev/sdaY swap swap defaults 0 0
ÇëÈ·±£Ê¹ÓÃÕýÈ·µÄ·ÖÇøºÅ¡£ÏÖÔÚ£¬¿ÉÒÔÖ´Ðд´½¨½»»»·ÖÇøµÄ×îºóÒ»²½¡£Ê¹Óà mkswap ÃüÁ·ÖÇø¶¨ÒåΪ½»»»·ÖÇø¡£
mkswap /dev/sdaY
×îºóÒ»²½ÊÇʹÓÃÒÔÏÂÃüÁîÆôÓý»»»¿Õ¼ä£º
swapon -a
ÄãµÄн»»»·ÖÇøÏÖÔÚÓëÒÔÇ°´æÔڵĽ»»»·ÖÇøÒ»ÆðÔÚÏß¡£Äú¿ÉÒÔʹÓà free »òtop ÃüÁîÀ´ÑéÖ¤ÕâÒ»µã¡£
ÔÚ LVM ´ÅÅÌ»·¾³ÖÐÌí¼Ó½»»»¿Õ¼ä
Èç¹ûÄãµÄ´ÅÅÌʹÓà LVM £¬¸ü¸Ä½»»»¿Õ¼ä½«Ï൱ÈÝÒס£Í¬Ñù£¬¼ÙÉ赱ǰ½»»»¾íËùÔڵľí×éÖÐÓпÉÓÿռ䡣ĬÈÏÇé¿öÏ£¬LVM »·¾³ÖÐµÄ Fedora Linux ÔÚ°²×°¹ý³Ì½«½»»»·ÖÇø´´½¨ÎªÂß¼¾í¡£Äú¿ÉÒԷdz£¼òµ¥µØÔö¼Ó½»»»¾íµÄ´óС¡£
£¨±à¼£ºASPÕ¾³¤Íø£©
|