ÉèΪÊ×Ò³ - ¼ÓÈëÊÕ²Ø ASPÕ¾³¤Íø£¨Aspzz.Cn£©- ¿Æ¼¼¡¢½¨Õ¾¡¢¾­Ñé¡¢ÔƼÆËã¡¢5G¡¢´óÊý¾Ý,Õ¾³¤Íø£¡
ÈÈËÑ£º Êý¾Ý ÊÖ»ú ¹«Ë¾
µ±Ç°Î»Ö㺠Ê×Ò³ > ·þÎñÆ÷ > ´î½¨»·¾³ > Windows > ÕýÎÄ

LinuxϵͳÉϽ»»»¿Õ¼äµÄ½éÉÜ(2)

·¢²¼Ê±¼ä£º2018-10-16 19:17 ËùÊôÀ¸Ä¿£º117 À´Ô´£ºDavid Both
µ¼¶Á£ºÃæ¶ÔÒÑ°²×° Linux µÄÖ÷»ú²¢¶Ô½»»»¿Õ¼äµÄÐèÇ󲻶ϱ仯£¬ÓÐʱÓбØÒªÐÞ¸Äϵͳ¶¨ÒåµÄ½»»»¿Õ¼äµÄ´óÐ £´Ë¹ý³Ì¿ÉÓÃÓÚÐèÒªÔö¼Ó½»»»¿Õ¼ä´óСµÄÈκÎÇé¿ö¡£Ëü¼ÙÉèÓÐ×ã¹»µÄ¿ÉÓôÅÅ̿ռ䡣´Ë¹ý³Ì»¹¼ÙÉè´ÅÅÌ·ÖÇøΪ ԭʼµÄ EXT4 ºÍ

Ãæ¶ÔÒÑ°²×° Linux µÄÖ÷»ú²¢¶Ô½»»»¿Õ¼äµÄÐèÇ󲻶ϱ仯£¬ÓÐʱÓбØÒªÐÞ¸Äϵͳ¶¨ÒåµÄ½»»»¿Õ¼äµÄ´óС¡£´Ë¹ý³Ì¿ÉÓÃÓÚÐèÒªÔö¼Ó½»»»¿Õ¼ä´óСµÄÈκÎÇé¿ö¡£Ëü¼ÙÉèÓÐ×ã¹»µÄ¿ÉÓôÅÅ̿ռ䡣´Ë¹ý³Ì»¹¼ÙÉè´ÅÅÌ·ÖÇøΪ “ԭʼµÄ” EXT4 ºÍ½»»»·ÖÇø£¬¶ø²»ÊÇʹÓÃÂß¼­¾í¹ÜÀí£¨LVM£©¡£

»ù±¾²½ÖèºÜ¼òµ¥:

  1. ¹Ø±ÕÏÖÓеĽ»»»¿Õ¼ä¡£
  2. ´´½¨ËùÐè´óСµÄн»»»·ÖÇø¡£
  3. ÖضÁ·ÖÇø±í¡£
  4. ½«·ÖÇøÅäÖÃΪ½»»»¿Õ¼ä¡£
  5. Ìí¼ÓзÖÇøµ½ /etc/fstab¡£
  6. ´ò¿ª½»»»¿Õ¼ä¡£

Ó¦¸Ã²»ÐèÒªÖØÐÂÆô¶¯»úÆ÷¡£

ΪÁË°²È«Æð¼û£¬Ôڹرս»»»¿Õ¼äÇ°£¬ÖÁÉÙÄãÓ¦¸ÃÈ·±£Ã»ÓÐÓ¦ÓóÌÐòÔÚÔËÐУ¬Ò²Ã»Óн»»»¿Õ¼äÔÚʹÓá£free »ò top ÃüÁî¿ÉÒÔ¸æËßÄã½»»»¿Õ¼äÊÇ·ñÔÚʹÓÃÖС£ÎªÁ˸ü°²È«£¬Äú¿ÉÒÔ»Ö¸´µ½ÔËÐ춱ð 1 »òµ¥Óû§Ä£Ê½¡£

ʹÓùرÕËùÓн»»»¿Õ¼äµÄÃüÁî¹Ø±Õ½»»»·ÖÇø£º

  1. swapoff -a

ÏÖÔڲ鿴ӲÅÌÉϵÄÏÖÓзÖÇø¡£

  1. fdisk -l

Õ⽫ÏÔʾÿ¸öÇý¶¯Æ÷ÉϵķÖÇø±í¡£°´±àºÅ±êʶµ±Ç°µÄ½»»»·ÖÇø¡£

ʹÓÃÒÔÏÂÃüÁîÔÚ½»»¥Ä£Ê½ÏÂÆô¶¯ fdisk£º

  1. fdisk /dev/<device name>

ÀýÈ磺

  1. fdisk /dev/sda

´Ëʱ£¬fdisk Êǽ»»¥·½Ê½µÄ£¬Ö»ÔÚÖ¸¶¨µÄ´ÅÅÌÇý¶¯Æ÷ÉϽøÐвÙ×÷¡£

ʹÓà fdisk µÄ p ×ÓÃüÁîÑéÖ¤´ÅÅÌÉÏÊÇ·ñÓÐ×ã¹»µÄ¿ÉÓÿռäÀ´´´½¨ÐµĽ»»»·ÖÇø¡£Ó²ÅÌÉϵĿռäÒÔ 512 ×ֽڵĿéÒÔ¼°ÆðʼºÍ½áÊøÖùÃæ±àºÅµÄÐÎʽÏÔʾ£¬Òò´ËÄú¿ÉÄÜÐèÒª×öһЩ¼ÆËãÀ´È·¶¨·ÖÅä·ÖÇøÖ®¼äºÍĩβµÄ¿ÉÓÿռ䡣

ʹÓà n ×ÓÃüÁî´´½¨ÐµĽ»»»·ÖÇø¡£fdisk »áÎÊÄ㿪ʼÖùÃ档ĬÈÏÇé¿öÏ£¬ËüÑ¡Ôñ±àºÅ×îµÍµÄ¿ÉÓÃÖùÃæ¡£Èç¹ûÄãÏë¸Ä±äÕâÒ»µã£¬ÊäÈ뿪ʼÖùÃæµÄ±àºÅ¡£

fdisk ÃüÁîÔÊÐíÄãÒÔ¶àÖÖ¸ñʽÊäÈë·ÖÇøµÄ´óС£¬°üÀ¨×îºóÒ»¸öÖùÃæºÅ»ò×Ö½Ú¡¢KB »ò MB µÄ´óС¡£ÀýÈ磬¼üÈë 4000M £¬Õ⽫ÔÚзÖÇøÉÏÌṩ´óÔ¼ 4GB µÄ¿Õ¼ä£¬È»ºó°´»Ø³µ¼ü¡£

ʹÓà p ×ÓÃüÁîÀ´ÑéÖ¤·ÖÇøÊÇ·ñ°´ÕÕÖ¸¶¨µÄ·½Ê½´´½¨µÄ¡£Çë×¢Ò⣬³ý·ÇʹÓýáÊøÖùÃæ±àºÅ£¬·ñÔò·ÖÇø¿ÉÄÜÓëÄãÖ¸¶¨µÄ²»ÍêÈ«Ïàͬ¡£fdisk ÃüÁîÖ»ÄÜÔÚÕû¸öÖùÃæÉÏÔöÁ¿µÄ·ÖÅä´ÅÅ̿ռ䣬Òò´ËÄãµÄ·ÖÇø¿ÉÄܱÈÄãÖ¸¶¨µÄÉÔС»òÉÔ´ó¡£Èç¹û·ÖÇø²»ÊÇÄúÏëÒªµÄ£¬Äã¿ÉÒÔɾ³ýËü²¢ÖØд´½¨Ëü¡£

ÏÖÔÚÖ¸¶¨Ð·ÖÇøÊǽ»»»·ÖÇøÁË ¡£×ÓÃüÁî t ÔÊÐíÄãÖ¸¶¨¶¨·ÖÇøµÄÀàÐÍ¡£ËùÒÔÊäÈë t£¬Ö¸¶¨·ÖÇøºÅ£¬µ±ËüÒªÇóÊ®Áù½øÖÆ·ÖÇøÀàÐÍʱ£¬ÊäÈë 82£¬ÕâÊÇ Linux ½»»»·ÖÇøÀàÐÍ£¬È»ºó°´»Ø³µ¼ü¡£

µ±Äã¶Ô´´½¨µÄ·ÖÇø¸Ðµ½ÂúÒâʱ£¬Ê¹Óà w ×ÓÃüÁеķÖÇø±íдÈë´ÅÅÌ¡£fdisk ³ÌÐò½«Í˳ö£¬²¢ÔÚÍê³ÉÐ޸ĺóµÄ·ÖÇø±íµÄ±àдºó·µ»ØÃüÁîÌáʾ·û¡£µ± fdisk Íê³ÉдÈëзÖÇø±íʱ£¬»áÊÕµ½ÒÔÏÂÏûÏ¢:

  1. The partition table has been altered!
  2. Calling ioctl() to re-read partition table.
  3. WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
  4. The kernel still uses the old table.
  5. The new table will be used at the next reboot.
  6. Syncing disks.

´Ëʱ£¬ÄãʹÓà partprobe ÃüÁîÇ¿ÖÆÄÚºËÖØжÁÈ¡·ÖÇø±í£¬ÕâÑù¾Í²»ÐèÒªÖ´ÐÐÖØÐÂÆô¶¯»úÆ÷¡£

  1. partprobe

ʹÓÃÃüÁî fdisk -l Áгö·ÖÇø£¬Ð½»»»·ÖÇøÓ¦¸ÃÔÚÁгöµÄ·ÖÇøÖС£È·±£ÐµķÖÇøÀàÐÍÊÇ “Linux swap”¡£

ÐÞ¸Ä /etc/fstab ÎļþÒÔÖ¸ÏòеĽ»»»·ÖÇø¡£ÈçÏÂËùʾ£º

  1. LABEL=SWAP-sdaX   swap        swap    defaults        0 0

ÆäÖÐ X ÊÇ·ÖÇøºÅ¡£¸ù¾Ýн»»»·ÖÇøµÄλÖã¬Ìí¼ÓÒÔÏÂÄÚÈÝ£º

  1. /dev/sdaY         swap        swap    defaults        0 0

ÇëÈ·±£Ê¹ÓÃÕýÈ·µÄ·ÖÇøºÅ¡£ÏÖÔÚ£¬¿ÉÒÔÖ´Ðд´½¨½»»»·ÖÇøµÄ×îºóÒ»²½¡£Ê¹Óà mkswap ÃüÁ·ÖÇø¶¨ÒåΪ½»»»·ÖÇø¡£

  1. mkswap /dev/sdaY

×îºóÒ»²½ÊÇʹÓÃÒÔÏÂÃüÁîÆôÓý»»»¿Õ¼ä£º

  1. swapon -a

ÄãµÄн»»»·ÖÇøÏÖÔÚÓëÒÔÇ°´æÔڵĽ»»»·ÖÇøÒ»ÆðÔÚÏß¡£Äú¿ÉÒÔʹÓà free »òtop ÃüÁîÀ´ÑéÖ¤ÕâÒ»µã¡£

ÔÚ LVM ´ÅÅÌ»·¾³ÖÐÌí¼Ó½»»»¿Õ¼ä

Èç¹ûÄãµÄ´ÅÅÌʹÓà LVM £¬¸ü¸Ä½»»»¿Õ¼ä½«Ï൱ÈÝÒס£Í¬Ñù£¬¼ÙÉ赱ǰ½»»»¾íËùÔڵľí×éÖÐÓпÉÓÿռ䡣ĬÈÏÇé¿öÏ£¬LVM »·¾³ÖÐµÄ Fedora Linux ÔÚ°²×°¹ý³Ì½«½»»»·ÖÇø´´½¨ÎªÂß¼­¾í¡£Äú¿ÉÒԷdz£¼òµ¥µØÔö¼Ó½»»»¾íµÄ´óС¡£

£¨±à¼­£ºASPÕ¾³¤Íø£©

ÍøÓÑÆÀÂÛ
ÍƼöÎÄÕÂ
    ÈȵãÔĶÁ