µ±Ç°Î»ÖãºLinux½Ì³Ì - Linux×ÊѶ - ͨÓÃỊ̈߳ºÑ§Ï° Linux LVM£¬µÚ 1 ²¿·Ö

ͨÓÃỊ̈߳ºÑ§Ï° Linux LVM£¬µÚ 1 ²¿·Ö

×÷ÕߣºDaniel Robbins ¡¡¡¡¡¡¡¡¡°Âß¼­¾í¹ÜÀí¡±Îª´æ´¢Æ÷¹ÜÀí´øÀ´µÄħÁ¦¡¡¡¡¡¡¡¡±¾ÎÄÖУ¬Daniel ÏòÄú½éÉÜÁË Linux LVM£¨Âß¼­¾í¹ÜÀí£©±³ºóµÄ¸ÅÄ²¢¸æËßÄúÈçºÎ½«×îеÄÄں˲¹¶¡ºÍ¹¤¾ß°²×°µ½ÄúµÄϵͳÉÏ¡£LVM ¿ÉÒÔÈÃÄúÔÚ³ý»úÆ÷ÉϵÄÎïÀí´æ´¢×ÊÔ´ÒÔÍâ´´½¨Âß¼­¾í¡£²»¹ý£¬ÓëÎïÀí¾í²»Í¬£¬Âß¼­¾í¿ÉÒÔÔÚϵͳÈÔ´¦ÓÚÔËÐÐ״̬ʱÀ©³äºÍËõ¼õ£¬ÕâÑù¾ÍΪ Linux ϵͳ¹ÜÀíÔ±ÌṩÁËËûÃÇÃÎÃÂÒÔÇóµÄ´æ´¢Æ÷Áé»îÐÔ¡£¡¡¡¡¡¡¡¡ÔÚÕâһϵÁÐÖУ¬ÎÒÒªÏòÄú½éÉÜÈçºÎ°²×°ºÍʹÓÃеÄÄÚÖÃÔÚ Linux 2.4 ÄÚºËÖеġ°Âß¼­¾í¹ÜÀí¡±Ö§³Ö¡£Èç¹ûÄúÒÔÇ°´ÓδʹÓùýÈκÎÐÎʽµÄ LVM £¬ÄÇôÄúµÃºÃºÃѧһѧ£»ËüÊÇÒ»Öַdz£°ôµÄ¼¼Êõ¡£ ÔÚÎÒÃÇÕæÕýÉèÖúÍÔËÐÐ LVM ֮ǰ£¬ÎÒÒª½âÊÍÒ»ÏÂËü¾¿¾¹ÊÇʲôÒÔ¼°ËüÊÇÈçºÎ¹¤×÷µÄ¡£È»ºó£¬ÎÒÃÇ×¼±¸¶Ô LVM ×öһЩ²âÊÔÀ´³ä·ÖÁ˽âËü¡£¡¡¡¡¡¡¡¡LVM ½éÉÜ¡¡¡¡Èç¹ûÄúÏóÎÒÒ»Ñù£¬ÄÇôÄú¶Ô UNIX ºÍ Linux µÄÌåÑéÊÇ´Ó PC ƽ̨£¬¶ø²»ÊÇ´Ó´óÐ͵ÄÉÌÒµ UNIX ·þÎñÆ÷ºÍ¹¤×÷Õ¾ÉÏ¿ªÊ¼µÄ¡£ÔÚ»ù±¾ PC ÉÏ£¬ÎÒÃÇ×ÜÊDz»µÃ²»¶ÔÓ²ÅÌÇý¶¯Æ÷Ö´ÐзÖÇø¡£Ê¹Óà PC µÄÈËͨ³£Ï൱Á˽â fdisk ÕâÑùµÄÔÚÓ²ÅÌÉÏ´´½¨ºÍɾ³ýÖ÷Òª·ÖÇøºÍÀ©Õ¹·ÖÇøµÄ¹¤¾ß¡£Ó²ÅÌ·ÖÇøÊÇÒ»ÖÖÁîÈËÑá·³£¬µ«¹«ÈÏÊÇʹ²Ù×÷ϵͳÉèÖúÍÔËÐнø³Ì²»¿É»òȱµÄÒ»²¿·Ö¡£¡¡¡¡¡¡¡¡ÒòΪҪ×öºÃ¹¤×÷£¬È·ÊµÐèÒª¾«È·µØ¹À¼Æÿ¸ö·ÖÇøÐèÒª¶àÉٿռ䣬ËùÒÔÓ²ÅÌÇý¶¯Æ÷·ÖÇø¿ÉÄÜÊǷdz£·³È˵ÄÊ¡£Èç¹û¹À¼ÆµÃ²»×¼È·£¬Linux ϵͳºÜ¿ÉÄÜ»á¹Ë´Ëʧ±Ë -- Ϊ½â¾öÕâ¸öÎÊÌ⣬ÄúÉõÖÁ¿ÉÄÜÐèÒªÖ´ÐÐÕû¸öϵͳ±¸·Ý¡¢½«Ó²ÅÌÇå³ý¸É¾»£¬È»ºó½«ËùÓÐÊý¾Ý»Ö¸´µ½Ðµģ¨¿ÉÄܱÈÔ­À´ºÃһЩ£©·ÖÇø²¼¾ÖÖС£ÌÖÑᣡÕâЩ¾ÍÊÇϵͳ¹ÜÀíÔ±ÔÚÒ»¿ªÊ¼¾Í¾¡Á¦±ÜÃâµÄÇé¿ö¡£¡¡¡¡¡¡¡¡ËäÈ»·ÖÇøÔøÒ»¶ÈÊǾ²Ì¬´æ´¢Æ÷µÄÌìÏ£¬µ«ÖµµÃÇìÐÒµÄÊÇ£¬ÎÒÃÇÏÖÔÚÓÐÐí¶à PC ÖØзÖÇø¹¤¾ß£¨PowerQuest µÄ Partition Magic ²úÆ·¾ÍÊÇ×îÁ÷ÐеÄÒ»ÖÖ£©¡£ÕâЩ¹¤¾ß¿ÉÒÔÈÃÄúÓÃÒ»¸öÌØÊâ´ÅÅÌÀ´Òýµ¼ÏµÍ³£¬²¢¿ÉÒÔ¶¯Ì¬µØÖØе÷Õû·ÖÇøºÍÎļþϵͳµÄ´óС¡£ÖØÐÂÒýµ¼ºó£¬Äú¾ÍÓµÓÐÁËÖØе÷Õû¹ý´óСµÄзÖÇø£¬ÕâÑù¾ÍÓÐÍû½«Äú´Ó´æ´¢Æ÷Σ¾³ÖнâÍѳöÀ´¡£ÕâЩÖØе÷Õû·ÖÇø´óСµÄ¹¤¾ßºÜÓÐЧ£¬²¢´ÓijÖ̶ֳÈÉϽâ¾öÁËһЩ´æ´¢Æ÷¹ÜÀíÎÊÌâ¡£µ«ËüÃÇÊDz»ÊǾÍÍêÃÀÁËÄØ£¿²»Ò»¶¨¡£¡¡¡¡¡¡¡¡Ïó Partition Magic ÕâÑùµÄ¹¤¾ß¶ÔÓÚ¹¤×÷Õ¾À´Ëµ·Ç³£ÓÐЧ£¬µ«¶Ô·þÎñÆ÷À´Ëµ¾Í²»ºÏÊÊÁË¡£Ê×ÏÈ£¬ËüÃÇÐèÒªÖØÐÂÒýµ¼ÏµÍ³¡£¶øÕâÕýÊÇ´ó¶àÊýϵͳ¹ÜÀíÔ±¾¡Á¿±ÜÃâµÄ¡£Èç¹ûÔÚÿ´ÎÐèÒªµ÷Õû´æ´¢Æ÷£¨ÀýÈ磬Èç¹ûÿÖÜ´æ´¢Æ÷µ÷Õû¶¼ÐèÒª×öºÜ´óµ÷Õû£©Ê±²»ÄÜÖØÐÂÒýµ¼»úÆ÷Ôõô°ì£¿Èç¹ûÐèÒªÀ©³äÎļþϵͳʹËüÄÜ¿çÔ½¶à¸öÓ²ÅÌÇý¶¯Æ÷»á·¢Éúʲô£¬»òÕßÈç¹ûÔÚÔÊÐí Apache ¼ÌÐøÌṩ Web Ò³ÃæµÄͬʱÐèÒª¶¯Ì¬À©³ä»òËõ¼õ¾íµÄ´æ´¢ÈÝÁ¿£¬Äú¸ÃÔõô×ö£¿ÔÚÒ»¸ö¸ß¶È¿ÉÓõĶ¯Ì¬»·¾³ÖУ¬»ù±¾µÄ·ÖÇø´óСµ÷ÕûÆ÷ÎÞ·¨Âú×ãÕâЩҪÇ󡣶ÔÓÚÕâÑùһЩºÍÆäËüһЩÇé¿ö£¬¡°Âß¼­¾í¹ÜÀí¡±ÊÇÒ»Öַdz£³öÉ«£¨Èç¹û²»ÊÇ×îÍêÃÀ£©µÄ½â¾ö·½°¸¡£¡¡¡¡¡¡¡¡½øÈë LVM¡¡¡¡ÏÖÔÚ£¬ÈÃÎÒÃÇ¿´¿´ LVM ÊÇÈçºÎ½â¾öÕâЩÎÊÌâµÄ¡£ÎÒÃÇÖ´ÐÐÏÂÃæµÄÈý²½Öè¹ý³ÌÀ´´´½¨ LVM Âß¼­¾í¡£Ê×ÏÈ£¬ÎÒÃÇÐèҪѡÔñÓÃÓÚ LVM µÄÎïÀí´æ´¢Æ÷×ÊÔ´¡£ÕâЩͨ³£ÊDZê×¼·ÖÇø£¬µ«Ò²¿ÉÒÔÊÇÎÒÃÇÒÑ´´½¨µÄ Linux Software RAID ¾í¡£Èç¹ûʹÓà LVM ÊõÓÕâЩ´æ´¢Æ÷×ÊÔ´³ÆΪ¡°ÎïÀí¾í¡±¡£ÉèÖà LVM µÄµÚÒ»²½ÊÇÕýÈ·³õʼ»¯ÕâЩ·ÖÇøÒÔʹËüÃÇ¿ÉÒÔ±» LVM ϵͳʶ±ð¡£Èç¹ûÌí¼ÓÎïÀí·ÖÇø£¬Ëü»¹°üÀ¨ÉèÖÃÕýÈ·µÄ·ÖÇøÀàÐÍ£¬ÒÔ¼°ÔËÐÐ pvcreate ÃüÁî¡£¡¡¡¡¡¡¡¡ÔÚ³õʼ»¯ LVM ʹÓõÄÒ»¸ö»ò¶à¸öÎïÀí¾íºó£¬¿ÉÒÔ¼ÌÐø½øÐеڶþ²½ -- ´´½¨¾í×é¡£Äú¿ÉÒ԰Ѿí×é¿´×÷ÊÇÓÉÒ»¸ö»ò¶à¸öÎïÀí¾íËù×é³ÉµÄ´æ´¢Æ÷³Ø¡£ ÔÚ LVM ÔËÐÐʱ£¬ÎÒÃÇ¿ÉÒÔÏò¾í×éÌí¼ÓÎïÀí¾í£¬ÉõÖÁ´ÓÖгýÈ¥ËüÃÇ¡£²»¹ý£¬ÎÒÃDz»ÄÜÖ±½ÓÔÚ¾í×éÉÏ°²×°»ò´´½¨Îļþϵͳ¡£¶øÊǸæËß LVM ʹÓÃÎÒÃǵľí×é´æ´¢Æ÷³Ø´´½¨Ò»¸ö»ò¶à¸ö¡°Âß¼­¾í¡±£º¡¡¡¡¡¡¡¡ÔÚÎïÀí¾íÉÏ´´½¨¾í×é¡¡¡¡¡¡¡¡¡¡ ¡¡¡¡´´½¨ LVM Âß¼­¾í·Ç³£ÈÝÒ×£¬¶øÇÒÒ»µ©´´½¨ËüÒÔºó£¬ÎÒÃǾͿÉÒÔ°ÑÎļþϵͳ·ÅÔÚËüÉÏÃæ¡¢°²×°Ëü£¬È»ºó¿ªÊ¼Ê¹ÓþíÀ´´æ´¢Îļþ¡£Ê¹Óà "lvcreate" ÃüÁîÀ´´´½¨Âß¼­¾í£¬Ö¸¶¨Ð¾íµÄÃû³Æ¡¢ËùÏ£ÍûµÄ¾íµÄ´óС£¬ÒÔ¼°Ï£ÍûÕâ¸öÌض¨Âß¼­¾íËùÊôµÄ¾í×顣Ȼºó£¬LVM ϵͳ´ÓÎÒÃÇÖ¸¶¨µÄ¾í×éÖзÖÅä´æ´¢Á¿À´´´½¨×¼±¸Ê¹ÓõÄÐÂ¾í¡£´´½¨Ð¾íºó£¬¿ÉÒÔ½« ext2 »ò ReiserFS Îļþϵͳ·ÅÔÚÉÏÃæ¡¢°²×°Ëü£¬È»ºóÕÕÎÒÃÇϲ»¶µÄ·½Ê½Ê¹ÓÃËü¡£¡¡¡¡¡¡¡¡´ÓÏÖÓоí×é´´½¨Á½¸öÂß¼­¾í¡¡¡¡¡¡ ¡¡¡¡¡¡¡¡·¶Î§¡¡¡¡ÔÚÄ»ºó£¬LVM ϵͳÒÔ´óСÏàµÈµÄ¡°¿é¡±£¨³ÆΪ¡°·¶Î§¡±£©Îªµ¥Î»·ÖÅä´æ´¢Á¿¡£ÎÒÃÇ¿ÉÒÔÖ¸¶¨ÔÚ´´½¨¾í×éʱʹÓõÄÌض¨µÄ·¶Î§´óС¡£·¶Î§µÄ´óСȱʡΪ 4Mb£¬Õâ¶ÔÓÚ´ó¶àÊýÇé¿öÀ´ËµÏ൱ÀíÏë¡£LVM µÄÒ»¸öºÃ´¦ÊÇÔÚÒѾ­°²×°ÁËÂß¼­¾í²¢ÔÚʹÓÃÂß¼­¾íµÄÇé¿öÏ£¬¿ÉÒÔ¶¯Ì¬µØ¸Ä±äÂß¼­¾íʹÓõķ¶Î§µÄÎïÀí´æ´¢Î»Ö㨻»¾ä»°Ëµ£¬¾ÍÊÇ´æ´¢ËüÃÇËùÔڵĴÅÅÌ£©¡£LVM ϵͳȷ±£Âß¼­¾íÔÚ¹ÜÀíÔ±ÎïÀíµØ¸Ä±ä´æ´¢Î»ÖõÄͬʱÄܹ»¼ÌÐøÕý³£²Ù×÷¡£¡¡¡¡¡¡¡¡µ±È»£¬ÒòΪËùÓÐÊÂÎﶼÊÇÔÚ´óСÏàµÈµÄ·¶Î§Ö®ÉÏ´´½¨µÄ£¬ËùÒÔҪΪÒÑ´æÔÚµÄÂß¼­¾í·ÖÅäһЩ¶îÍâµÄ·¶Î§Êµ¼ÊÉϺÜÈÝÒ× -- »»¾ä»°Ëµ£¬¶¯Ì¬¡°Ôö³¤¡±¾í£º¡¡¡¡¡¡¡¡´Ó¾í×éÌí¼Ó¶îÍâµÄ·¶Î§£¬À©Õ¹Âß¼­¾íµÄ´óС¡¡¡¡¡¡¡¡ ¡¡¡¡Ò»µ©À©³äÁËÂß¼­¾í£¬½ÓÏÂÀ´¾Í¿ÉÒÔÀ©³ä ext2 »ò ReiserFS ÎļþϵͳÀ´ÀûÓÃÕâһеĴÅÅ̿ռ䡣Èç¹ûʹÓÃÀýÈç resize_reiserfs ÕâÑùµÄ³ÌÐò£¬Ò²¿ÉÒÔÔÚÒÑ°²×°ºÍÕýʹÓþíʱÀ©³äÎļþϵͳ£¡ÕæÕýÁîÈ˳ÆÆæµÄÊÇ -- ʹÓà LVM ºÍÁª»úÎļþϵͳÀ©³äʵÓóÌÐò£¬¿ÉÒÔÔڸıä´æ´¢Æ÷ÅäÖÃʱ²»ÔÙÐèÒªÖØÐÂÒýµ¼ÏµÍ³£¬ÉõÖÁ²»ÐèÒª½µµÍµ½ÔËÐ춱ð 1¡£¡¡¡¡¡¡¡¡Î¨Ò»ÐèÒª¹Ø±ÕϵͳµÄÇé¿öÊÇÔÚÐèÒªÌí¼ÓеÄÎïÀí´ÅÅÌʱ¡£Ìí¼ÓÁËдÅÅ̺󣬿ÉÒÔ½«ÕâЩеÄÎïÀí¾íÌí¼Óµ½¾í×éÖÐÀ´´´½¨Ðµķ¶Î§²¹¸ø¡£¡¡¡¡¡¡¡¡ÉèÖà LVM¡¡¡¡ºÃ£¬ÈÃÎÒÃÇ¿ªÊ¼°²×° LVM¡£LVM ÓÉÁ½²¿·Ö×é³É£ºÄں˲¿·ÖºÍÒ»Ì×Óû§¿Õ¼ä¹¤¾ß¡£ÎªÁË¿ªÊ¼£¬ÏÈÌøµ½Ö÷Òª LVM Ò³Ã棨Çë²ÎÔı¾ÎÄÉԺ󲿷ֵIJο¼×ÊÁÏ£©²¢ÏÂÔØ¿ÉÒÔÕÒµ½µÄ×îа汾µÄ LVM tar Îļþ£¨µ±Ç°ÊÇ lvm_0.9.1_beta3.tar.gz£©¡£LVM tar Îļþ°üº¬ÁËËùÓÐÓû§¿Õ¼ä¹¤¾ßÒÔ¼°Ò»×éÄں˲¹¶¡³ÌÐò¡£ÕâÕýÊÇÁîÈ˸ÐÐËȤµÄµØ·½¡£¡¡¡¡¡¡¡¡Èç¹ûÒѾ­°²×°ÁË 2.4 ϵÁÐÄںˣ¬ÔòϵͳÉÏÒÑÓÐ LVM Ö§³Ö£¬Èç¹ûûÓУ¬ºÜ¼òµ¥£¬Ö»ÐèÒªÖØбàÒëÄÚºËÀ´ÆôÓà LVM Ö§³Ö¼´¿É¡£²»¹ý£¬Äú¿ÉÄܲ»Ï£ÍûʹÓÃ×Ô´øµÄ£¨»ò·¢ÐаæÌṩµÄ£©2.4 ÄÚºËËù°üÀ¨µÄ LVM Ö§³Ö¡£Èç¹ûÏ£ÍûʹÓÃ×îÐ嵀 LVM °æ±¾£¬Òª½« LVM tar ÎļþÖеIJ¹¶¡³ÌÐòÓ¦Óõ½µ±Ç°µÄ 2.4 ÄÚºËÔ´ÂëÊ÷¡£ÒÔÏÂÊÇÖ´Ðз½·¨¡£¡¡¡¡¡¡¡¡ÎªÁË¿ªÊ¼£¬½øÈëÄÚºËÔ´ÂëĿ¼ (/usr/src/linux) ²¢´´½¨Ò»¸ö³ÆΪ "extras" µÄĿ¼¡£È»ºó½øÈë¸ÃĿ¼²¢³éÈ¡ LVM tar Îļþ£º¡¡¡¡¡¡¡¡# cd /usr/src/linux¡¡¡¡# mkdir extras¡¡¡¡# cd extras¡¡¡¡# tar xzvf /path/to/location/of/lvm_0.9.1_beta3.tar.gz¡¡¡¡¡¡¡¡Ö´ÐÐÍêÕâÒ»²½ºó£¬Äú»á×¢Òâµ½ÔÚ extras ÖÐÓÐÒ»¸ö³Æ֮Ϊ "LVM" µÄĿ¼£¬Ëü°üº¬ÁËÁíÒ»¸ö¸ù¾ÝÄú¸Õ¸Õ½â°üµÄ LVM °æ±¾ÃüÃûµÄĿ¼¡£½øÈëÕâÁ½¸öĿ¼ÕÒµ½ LVM Ô´Â룺¡¡¡¡¡¡¡¡Çåµ¥ 1£ºÕÒµ½ LVM Ô´Âë¡¡¡¡¡¡¡¡Äú½«¿´µ½¼¸¸öÎı¾Îļþ¡¢½Å±¾ºÍԴĿ¼¡£Äú»áÔÚ "INSTALL" ÎļþÖÐÕÒµ½°²×°Ö¸ÁÎÒ½«Ö¸µ¼ÄúÍê³ÉÕâÒ»¹ý³Ì¡£Ê×ÏÈ£¬ÎÒÃÇÏ£ÍûÔËÐÐÅäÖýű¾£¬ÈçÏ£º¡¡¡¡¡¡¡¡# ./configure --prefix=/ --mandir=/usr/man¡¡¡¡¡¡¡¡¡¡¡¡ÐÞ²¹¡¡¡¡Ö´ÐÐÍêÕâÌõÃüÁîºó£¬½«´´½¨²¢ÅäÖà Makefile£¬ÒÔÔÚ /sbin Öа²×°ËùÓÐ LVM ¹¤¾ß£¬ÔÚ /usr/man Öа²×°°ïÖúÒ³Ãæ¡£Èç¹ûÄúµÄ°ïÖúÒ³ÃæλÓÚ /usr/share/man ÖУ¨°´ÕÕ FHS 2.1£©£¬Ôò¶ÔÉÏÊö·¾¶×÷ÏàÓ¦µÄµ÷Õû¡£Èç¹ûÄÚºËÔ´Âë²»ÔÚ /usr/src/linux ÖУ¬»¹ÐèÒª½« "--with-kernel_dir=/path/to/usr/src/linux" Ñ¡ÏîÌí¼Óµ½Ò»ÐÐÖС£ÅäÖýű¾Íê³Éºó£¬ÎÒÃǾͿÉÒÔ×¼±¸°²×°ÕâЩ¹¤¾ß²¢Éú³Éµ±Ç°Äں˵IJ¹¶¡ÁË¡£ÈÃÎÒÃÇÊ×ÏȶÔÄں˼ÓÒÔÐÞ²¹¡£½øÈë PATCHES Ŀ¼£º¡¡¡¡¡¡¡¡# cd PATCHES¡¡¡¡¡¡¡¡ÏÖÔÚÊäÈë "make"¡£makefile ½«Éú³ÉרÓÃÓÚÌض¨ 2.4 ϵÁÐÄÚºËÔ´ÂëµÄ²¹¶¡£º¡¡¡¡¡¡¡¡# make¡¡¡¡¡¡¡¡²¹¶¡ÃûΪ lvm-[lvmversion]-[kernelversion].patch¡£ÀýÈ磬ÒòΪÎÒʹÓõÄÊÇ°æ±¾ 0.9.1_beta3 µÄ LVM ºÍÄÚºË 2.4.0-ac11£¬ËùÒÔ²¹¶¡ÃûΪ lvm-0.9.1_beta3-2.4.0-ac11.patch¡£Äú¿ÉÒÔÔÚµ±Ç°Ä¿Â¼ÖÐÕÒµ½Ëü¡£ÏÖÔÚ¸ÃÓ¦Óò¹¶¡ÁË¡£ÒªÓ¦Óò¹¶¡£¬ÐèÒª½«Ä¿Â¼Çл»µ½ÄÚºËÔ´ÂëËùÔÚµÄλÖã¬È»ºóʹÓà patch ÃüÁÈçÇåµ¥ 2 Ëùʾ£º¡¡¡¡¡¡¡¡Çåµ¥ 2£ºpatch ÃüÁî¡¡¡¡¡¡¡¡ËäÈ» LVM INSTALL Îĵµ²¢Ã»ÓÐÌáµ½£¬µ«ÎÒͨ³£½« "-l" Ñ¡Ïî´«µÝ¸ø patch¡£¸ÃÑ¡ÏîÈò¹¶¡³ÌÐò²¹³¥¿Õ°×ÖеÄÈκα仯£¨ÀýÈçϸ΢µÄËõÅű仯£©£¬ÕâЩ±ä»¯Ò»°ã»áÔì³É²¹¶¡µÄijЩ²¿·Öʧ°Ü¡£Èç¹ûÉÏÊöÃüÁîÍê³ÉʱûÓÐÈκδøÓÐ "FAILED" µÄÐУ¬ÄÇô¾Í¿ÉÒÔ×¼±¸°²×°Óû§´ÅÅ̿ռ乤¾ßÁË¡£Èç¹û²»ÊÇÕâÑù£¬ÄúÐèÒªÉóÊÓ /usr/src/linux Ŀ¼À´²éÕÒ ..rej Îļþ£¬È»ºóʹÓÃÎı¾±à¼­Æ÷ÊÖ¹¤½«±»¾Ü¾øµÄ²¿·Ö²åÈëµ½Ô´ÂëÖÐ -- ÕæÂé·³£¡²»¹ý£¬ÔÚ´ó¶àÊýÇé¿öÏ£¬Ó¦Óò¹¶¡¶¼ºÜ˳Àû£¬Äú¿ÉÒÔѸËÙʹÓÃËü¡£¡¡¡¡¡¡¡¡ÅäÖᢱàÒëºÍ°²×°¡¡¡¡ºÃ£¬ÏÖÔÚÓÐÁËÒ»¸ö¾­¹ýÐÞ²¹µÄÄںˣ¬Òò´ËËü¾ßÓÐ×îпÉÓÃµÄ LVM ´úÂë¡£ÏÖÔÚÐèÒªÅäÖÃÄÚºËÀ´ÆôÓà LVM Ö§³Ö¡£ÎÒ½¨ÒéÄúÖ±½Ó½« LVM Ö§³Ö±àÒëµ½ÄÚºËÖжø²»Êǽ«ËüÅäÖóÉ×÷Ϊһ¸öÄ£¿é±àÒë¡£Æô¶¯Äúϲ°®µÄ Linux ÄÚºËÅäÖ÷½·¨£º¡¡¡¡¡¡¡¡# cd /usr/src/linux¡¡¡¡# make menUConfig¡¡¡¡¡¡¡¡ÄúÔÚ "Multi-device support (RAID and LVM)" ²¿·ÖÖпÉÒÔÕÒµ½ LVM Ñ¡Ïî¡£Ò»µ©ÆôÓÃÁ˵ÚÒ»¸öÑ¡Ï¡¡¡¡¡¡¡¡[*] Multiple devices driver support (RAID and LVM) ¡¡¡¡¡¡¡¡....Äú½«¿´µ½ÒÔÏÂÑ¡ÏÄúÒ²Ó¦¸ÃÆôÓÃËüÃÇ£º¡¡¡¡¡¡¡¡<*>¡¡ Logical volume manager (LVM) support¡¡¡¡¡¡¡¡¸ù¾ÝÄúʹÓÃµÄ LVM °æ±¾£¬¿ÉÄÜ»¹ÓÐÆäËüһЩϣÍûÆôÓõÄÓë LVM Ïà¹ØµÄÑ¡Ïî¡£Íê³Éºó£¬±£´æÄÚºËÅäÖ㬲¢Ö´Ðбê×¼Äں˱àÒëÀý³Ì£¬È»ºóÖØÐÂÒýµ¼¡£¹§Ï² -- ÄúÏÖÒÑÆôÓÃÁËÄÚºË LVM Ö§³Ö£»ÏÖÔÚ£¬ÎÒÃÇÐèÒª±àÒëºÍ°²×°Óû§´ÅÅ̿ռ乤¾ß¡£ÕâÒ»²½ºÜ¼òµ¥£º¡¡¡¡¡¡¡¡# cd /usr/src/linux/extras/LVM/0.9.1_beta3¡¡¡¡# make¡¡¡¡# make install¡¡¡¡¡¡¡¡ÁíÍ⻹ÓÐÒ»²½£¬ËüÊÇ¿ÉÑ¡µÄ¡£Èç¹ûÄúÒª×öµÄ²»½öÊDzâÊÔ LVM£¬»¹ÐèÒª½«ÒÔϼ¸ÐÐÌí¼Óµ½Æô¶¯ rc ½Å±¾ÖУº¡¡¡¡¡¡¡¡/sbin/vgscan¡¡¡¡/sbin/vgchange -a y¡¡¡¡¡¡¡¡ÕâЩÐн«ä¯ÀÀËùÓпÉÓõľí×é²¢¼¤»îËüÃÇ¡£È»ºó£¬½«ÒÔÏÂÕâÐÐÌí¼Óµ½¹Ø»ú rc ½Å±¾ÖУ¬²¢È·±£ËüÔÚжװÁËËùÓÐÎļþϵͳºóÖ´ÐУº¡¡¡¡¡¡¡¡/sbin/vgchange -a n¡¡¡¡¡¡¡¡Èç¹ûÖ»ÊDzâÊÔ LVM£¬¿ÉÒÔÌø¹ýÕâЩ²½Öè¡£Ö»ÊÇÒª¼Çס£¬ÔÚÿ´ÎÖØÐÂÒýµ¼ºó£¬ÔÚÂß¼­¾í¿ÉÒÔʹÓÃÇ°£¬ÐèÒªÒÔ root ÊäÈë "vgscan" ºÍ "vgchange -a y"¡£¡¡¡¡¡¡¡¡ÒÔÉϾÍÊÇÕâƪÎÄÕµÄÄÚÈÝ¡£ÔÚÏÂһƪÎÄÕÂÖУ¬ÎÒ½«½éÉÜÈçºÎ´´½¨Äú×Ô¼ºµÄÂß¼­¾í£¬ÒÔ¼°ÈçºÎ·¢»Ó LVM µÄÍþÁ¦¡£µ½Ê±ºòÔÙ¼û£¡¡¡¡¡¡¡¡¡²Î¿¼×ÊÁÏ¡¡¡¡¡¡¡¡´Ó Sistina Software ÏÂÔØ LVM tar Îļþ¡£ ¡¡¡¡ÇëÎñ±Ø×Ðϸ²é¿´ Linux LVM FAQ¡£ ¡¡¡¡µÈ²»¼°µÄ¶ÁÕß¿ÉÒԲ鿴 Heinz Mauelshagen µÄ LVM HOWTO£¬Ëü½éÉÜÁËÈçºÎÉèÖÃÎïÀí¾í¡¢¾í×éºÍÂß¼­¾í¡£ÕâÊÇÎÒ½«ÔÚÏÂһƪÎÄÕÂÖÐÉæ¼°µÄÄÚÈÝ¡£ ¡¡¡¡ÁíÍ⻹ÓÐÒ»¸öÓÐÒâ˼µÄ HOWTO£¬¸æËßÄú ÈçºÎÔÚÂß¼­¾íÉÏÉèÖøùÎļþϵͳ¡£ ¡¡¡¡Andreas Dilger ²ÎÓëÁË Linux LVM ÏîÄ¿£¬ËûÓÐÒ»¸ö¿´ÉÏÈ¥²»´íµÄ Áª»ú ext2 Îļþϵͳ´óСµ÷ÕûÆ÷¡£ ¡¡¡¡ReiserFS ÊÇÒ»Öַdz£ºÃµÄÎļþϵͳ£¨ÌرðÔÚÓë LVM ½áºÏʹÓÃʱ£©¡£Èç¹ûʹÓõÄÊÇ ReiserFS£¬ÐèÒª»ñÈ¡ reiserfs-utils tar Îļþ£¬Ëü°üº¬ÁËÒ»¸ö³ÆΪ "reiserfs_resize" µÄ³ÌÐò -- ÔÊÐí¶Ô ReiserFS ÎļþϵͳÁª»úµ÷Õû´óС¡£ ¡¡¡¡ÓйØÉèÖà Linux Software RAID ¾íµÄÏêϸÐÅÏ¢£¬Çë²ÎÔÄ Daniel ÔÚ developerWorks ÉÏÓÐ¹Ø Software RAID ϵÁÐµÄµÚ 1 ²¿·ÖºÍµÚ 2 ²¿·Ö¡£ ¡¡¡¡Èç¹ûÏë½øÐлعˣ¬Çë²ÎÔÄ developerWorks É쵀 Linux Äں˱àÒë½Ì³Ì¡£ ¡¡¡¡


[1] [2] ÏÂÒ»Ò³ 

 

£¨³ö´¦£ºhttp://www.sheup.com£©


ÉÏÒ»Ò³ [1] [2]