³¾­ôªº Linux ¨p©Ðµæ
¬°¨ú±o¸û¨ÎÂsÄýµ²ªG¡A½Ð·R¥Î firefox ÂsÄý¥»ºô­¶
| ÁcÅé¥D¯¸ | ²Åé¥D¯¸ | °ò¦½g | ¦øªA¾¹ | ¥ø·~À³¥Î | ®à­±À³¥Î | ¦w¥þºÞ²z | °Q½×ªO | »Å¾Ç¶é | ®ÑÄy·`»~ | ³¾­ô§Ú | ±X¤s¸ê¶Ç |
¡@ ¡@ ¡@
¡@
³Ìªñ§ó·s¤é´Á¡G2005/11/25
¥»¤å¤w¤£¦AºûÅ@¡A§ó·s¤å³¹½Ð°Ñ¦Ò¦¹³B
½Í§¹¤F Linux ªº¨t²Î¾Þ§@¡A¦A¨Ó±o­nÁA¸Ñ¤@¤U­Y±zªº¥D¾÷µwÅé§ó´«¡A©ÎªÌ¬O·Q­n¶i¦æ¥D¾÷ªº·Å«×°»´ú®É¡A À³¸Ó­n«ç»ò§@¡H¦b³o­Ó³¹¸`·í¤¤¡A§Ú­Ì·|½Í¨ì¦p¦ó¥H Linux kernel ¸Ì­±ªº lm_sensor ¥\¯à¡A ¥H¤Î§Q¥Î LVM ¨Ó»s§@¤@­Ó¤j«¬ªºµwºÐ¡AÅý±zªº filesystem ®e¶q§ó¨ã¦³¼u©Ê³á¡I ·íµM°Õ¡A¦b Linux ¨t²Î¤W­±±µ¤W±zªº¦Lªí¾÷¡A¤]¬O¤@­Ó«Ü¦nª±ªº¤u§@³á¡I¨º´N¨ÓŪ¤@Ū§a¡I


¤j¼ÐÃDªº¹Ï¥Ü·Ç³Æ¦n§AªºµwÅé¡G
§Ú­Ì³o­Ó³¹¸`ªº¥D­n¥Øªº¦b©ó§ó²`¤JªºÁA¸Ñ§Ú­Ì Linux ¥D¾÷ªºµwÅé¡A¨Ã¶i¤@¨Bªº±N³o¨ÇµwÅé¸ê°T·J¾ã¡A ³Ì¦n¬OÁÙ¯à°÷¶i¦æ¤@¨Ç°»´ú»P±±ºÞ°Õ¡I³o¼Ë¤~¥i¥H¦b³Ìµuªº®É¶¡¤ºÁA¸Ñ§Ú­Ì Linux ¥D¾÷¬O§_¥i¯àµo¥Í°ÝÃD°Ú¡I ³o¥]¬A¥D¾÷ªº¹qÀ£­È¬O§_¥¿½T¡H¥D¾÷»P CPU ·Å«×¬O§_¹L°ªµ¥µ¥¡C¦Ó¬°¤F³o¨Ç¥Øªº¡A·íµM°Õ¡A §Ú­Ì´N±o­n¥ý·Ç³Æ¦n¦Û¤vªº Linux ¥D¾÷ªºµwÅé°Ú¡A¦Ü¤Ö±o­n¥ýÁA¸Ñ§Aªº Linux ¥D¾÷¬OÔ£µwÅé°t³Æ°Ú¡A §_«h¡A°²¦p§AªºµwÅ饻¨­´N¬O¤£¤ä´©·Å«×°»´ú¡A¨ºªá¦A¦h®É¶¡¦b·Å«×¼Æ­Èªº¨ú±o¡A¼K¼K¡I¬O¨S¦³·N¸qªº°Õ¡I ¨Óµ¹¥L¶i¦æ¤U¥hÅo¡I ^_^


¤p¼ÐÃDªº¹Ï¥ÜµwÅé¸ê°Tªº¦¬¶°¡G lspci, iostat...
ÁÙ°O±o§Ú­Ì¦b ¶}¾÷»PÃö¾÷¬yµ{¤ÀªR ·í¤¤´£¨ìªº®Ö¤ß¥\¯à§a¡H §Ú­Ìªº Linux kernel ·|¦b¶}¾÷®É¡A¥H®Ö¤ß¤º«Øªº¥\¯à¥h°»´ú¥D¾÷ªººØºØµwÅé¡A ¨Ã¹Á¸Õ¸ü¤J¾A·íªºÅX°Êµ{¦¡ (¼Ò²Õ, modules) ¨ÓÅýµwÅ饿½Tªº±Ò°Ê»P¹B§@¡C ¦Ó®Ö¤ß©Ò°»´ú¨ìªº¦U¶µµwÅé¸Ë¸m¡A«á¨Ó´N·|³Q°O¿ý¦b /proc ·í¤¤¤F¡C ¥]¬A /proc/cpuinfo, /proc/partitions, /proc/interrupts µ¥µ¥¡C §ó¦hªº /proc ¤º®e¤¶²Ð¡A¥ý¦^¨ì µ{§Ç»P¸ê·½ºÞ²z ¨º¤@½g¥hÁ@¤@Á@¥ý¡I
Tips:
·íµMÁÙ¬O±o­n¦A´£¨ì¡A®Ö¤ß©Ò°»´ú¨ìªºµwÅé¥i¯à¨Ã«D§¹¥þ¥¿½T³á¡I ¥L¶È¬O¡y¨Ï¥Î³Ì¾A·íªº¼Ò²Õ¨ÓÅX°Ê³o­ÓµwÅé¡z¦Ó¤w¡A©Ò¥H¦³®É­ÔÃø§K·|»~§P°Õ¡I ©Ò¥HÅo¡A¦pªG§A¹ï©ó¨t²ÎªºÃ­©w©Ê¬O¤ç¤ç­p¸ûªº¡A¨º»ò©ÎªÌ­«·s½sĶ¤@¦¸§Aªº®Ö¤ß¡A À³¸Ó¤]¬O­Ó¤£¿ùªº¥D·N¡C¦ý¬O¡A¤@¯ë¨Ó»¡¡A§Ú­Ì¨S¦³«Ü«Øij§A¤@©w­n­«·s½sĶ®Ö¤ß´N¬O¤F¡C Ãö©ó®Ö¤ßªº½sĶ¡AÁ@¤@Á@¤U­Ó³¹¸`§a¡I ^_^
³¾­ôªº¹Ï¥Ü
§Ú­Ìªº Linux °ò¥»¤W¦³´£¨Ñ´X­Ó²³æªº«ü¥O¨Ó±N®Ö¤ß©Ò°»´ú¨ìªºµwÅé¥s¥X¨Óªº¡ã ³o¥]¬A§Ú­Ì¤§«e´£¨ìªº¡G
  • hdparm¡GÆ[¹îµwºÐªººØºØ¸ê°T¡F
  • lspci¡GÀˬd¾ã­Ó¨t²Î PCI ¤¶­±ªº¦U¶µ¸Ë¸m¡I«Ü¦³¥Îªº«ü¥O¡F
  • dmesg¡GÆ[¹î®Ö¤ß¹B§@¹Lµ{·í¤¤©ÒÅã¥Üªº¦U¶µ°T®§°O¿ý¡F
  • iostat¡GÀˬd¾ã­Ó CPU »P©PÃä³]³Æªº Input/Output ª¬ºA¡C
µL½×¦p¦ó¡A¨º­Ó lspci ¯uªº¬O¤@­Ó«Ü¤£¿ù¥Îªº«ü¥O¡A¥L¥i¥Hª½±µ±N /proc ©³¤UªºÃö©ó PCI ¤¶­±ªº¦U¶µ¸ê®Æ¤@¤f®ðªº±N¥L§¹¾ãªº§e²{¦b§A­±«e¡A¥i¥HÅý±z«Ü§Ö³tªºÁA¸Ñ¨ì®Ö¤ß©Ò°»´ú¨ìªº§Aªº¥D¾÷µwÅé©O¡I ¨º»ò´N»°ºò¨Ó¬Ý¤@¬Ý§Aªº¥D¾÷µwÅé°t³Æ§a¡I ^_^

°ò¥»¤W¡A·Q­nª¾¹D±z Linux ¥D¾÷ªºµwÅé°t³Æ¡A³Ì¦nªº¤èªkÁÙ¬Oª½±µ©î¶}¾÷´ß¥h¹î¬Ý¤W­±ªº¸ê°T¡A ¦pªGÀô¹Ò¦]¯À¾É­P±zµLªkª½±µ©î¶}¥D¾÷ªº¸Ü¡A¨º»òª½±µ lspci ¬O«Ü´Îªº¤@ªº¤èªk¡G


  • lspci
  • [root@linux ~]# lspci [-vvn]
    °Ñ¼Æ¡G
    -v  ¡GÆ[¹î§ó¦hªº PCI ¸Ë¸mªº¸ê°T¡F
    -vv ¡G¤ñ -v ÁÙ­n§ó¸Ô²Óªº²Ó³¡¸ê°T¡F
    -n  ¡Gª½±µÆ[¹î PCI ªº ID ¦Ó¤£¬O¼t°Ó¦WºÙ
    ½d¨Ò¡G
    
    ½d¨Ò¤@¡G¬d¾\±z¨t²Î¤ºªº PCI ¸Ë¸m¡G
    [root@linux ~]# lspci
    00:00.0 Host bridge: VIA Technologies, Inc. VT82C693A/694x [Apollo PRO133x] (rev c4)
    00:01.0 PCI bridge: VIA Technologies, Inc. VT82C598/694x [Apollo MVP3/Pro133x AGP]
    .....(¤¤¶¡¬Ù²¤).....
    00:0c.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
    01:00.0 VGA compatible controller: nVidia Corporation NV17 [GeForce4 MX 440] (rev a3)
    # ¤£¥²¥[¥ô¦óªº°Ñ¼Æ¡A´N¯à°÷Åã¥Ü¥X¥Ø«e¥D¾÷¤W­±ªº¦U­Ó PCI ¤¶­±ªº¸Ë¸m©O¡I
    # ±q¤W­±ªº¸ê®Æ¥i¥H¬Ý¥X§ÚªºÅã¥Ü¥d¬O Nvidia ªº¡A¥D¾÷´¹¤ù«h¬O VIA ªº¡A
    # ºô¸ô¥d«h¬O Realtek ªº 8139 (¥ç§Y¬O¿ÀÃÉ¥d°Ú¡I)¡C
    
    °ò¥»¤W¡A§Ú­Ì¥i¥H¥Ñ lspci ¥ß¨è±o¨ì¥D¾÷¤W­±ªº¦U¶µ³]³Æ¡A¦pªGÁÙ·Q­nª¾¹D¥L©Ò¦û¥Îªº IRQ »P I/O port ®É¡A¥i¥H¥[¤W¡y lspci -vv ¡z¨Ó¬d¾\°Ú¡I²³æ±o¤£±o¤F§a¡I ¥t¥~¡A±z·|µo²{¤Wªí·í¤¤ªº¨C¤@¦æ³Ì«e­±³£¦³¤@²Õ©Ç©Çªº¼Æ¦r¡A¨º¬O¤°»ò¡H ¨ä¹ê¨º´N¬O§Ú­ÌªºµwÅé°»´úªº¼Æ¾Ú°Õ¡I±z¥i¥H¹ï·ÓµÛ©³¤U³o­ÓÀɮרӬd¾\¡G
    • /usr/share/hwdata/pci.ids
    ¨º­Ó´N¬O PCI ªº¼Ð·Ç ID »P¼tµP¦WºÙªº¹ïÀ³ªí°Õ¡I ¦¹¥~¡A­è­è§Ú­Ì¨Ï¥Î lspci ®É¡A¨ä¹ê©Ò¦³ªº¸ê®Æ³£¬O¥Ñ /proc/bus/pci/ ¥Ø¿ý¤Uªº¸ê®Æ©Ò¨ú¥Xªº©O¡IÁA¸Ñ¤F§a¡I ^_^


  • iostat
  • ­è­è¨º­Ó lspci §ä¨ìªº¬O¥Ø«e¥D¾÷¤W­±ªºµwÅé°t³Æ¡A¨º»ò¾ã³¡¾÷¾¹ªºÀx¦s³]³Æ¡A ¥D­n¬OµwºÐ¹ï§a¡I½Ð°Ý¡A±zµwºÐ¥Ñ¶}¾÷¨ì²{¦b¡A¤w¸g¦s¡B¨ú¦h¤Ö¸ê®Æ©O¡H ³o­Ó®É­Ô´N±o­n iostat ³o­Ó«ü¥OªºÀ°¦£¤F¡I
    [root@linux ~]# iostat [-c|-d] [-k] [-t] [¶¡¹j¬í¼Æ] [°»´ú¦¸¼Æ]
    °Ñ¼Æ¡G
    -c  ¡G¶ÈÅã¥Ü CPU ªºª¬ºA¡F
    -d  ¡G¶ÈÅã¥ÜÀx¦s³]³Æªºª¬ºA¡A¤£¥i»P -c ¤@°_¥Î¡F
    -k  ¡G¹w³]Åã¥Üªº¬O block ¡A³o¸Ì¥i¥H§ï¦¨ K bytes ªº¤j¤p¨ÓÅã¥Ü¡F
    -t  ¡GÅã¥Ü¤é´Á¥X¨Ó¡F
    ½d¨Ò¡G
    
    ½d¨Ò¤@¡GÅã¥Ü¤@¤U¥Ø«e¾ã­Ó¨t²Îªº CPU »PÀx¦s³]³Æªºª¬ºA
    [root@linux ~]# iostat
    Linux 2.6.12-1.1456_FC4 (localhost.localdomain)    10/27/05
    
    avg-cpu:  %user   %nice    %sys %iowait   %idle
               0.34    0.01    0.34    0.20   99.11
    
    Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
    hda               0.55         2.64         3.28    6631507    8230880
    hdb               0.21         4.52         9.10   11342022   22855752
    # Á@¡I¤W­±¼Æ¾ÚÁ`¦@¤À¬°¤W¤U¨â³¡¤À¡A¤W¥b³¡Åã¥Üªº¬O CPU ªº·í¤U¸ê°T¡F
    # ¤U­±¼Æ¾Ú«h¬OÅã¥ÜÀx¦s¸Ë¸m /dev/hda, /dev/hdb ªº¬ÛÃö¼Æ¾Ú¡A¥Lªº¼Æ¾Ú·N¸q¡G
    # tps       ¡G¥­§¡¨C¬íÄÁªº¶Ç°e¦¸¼Æ¡I»P¸ê®Æ¶Ç¿é¡y¦¸¼Æ¡z¦³Ãö¡A«D®e¶q¡I
    # kB_read/s ¡G¶}¾÷¨ì²{¦b¥­§¡ªºÅª¨ú³æ¦ì¡F
    # kB_wrtn/s ¡G¶}¾÷¨ì²{¦b¥­§¡ªº¼g¤J³æ¦ì¡F
    # kB_read   ¡G¶}¾÷¨ì²{¦b¡AÁ`¦@Ū¥X¨ÓªºÀɮ׳æ¦ì¡F
    # kB_wrtn   ¡G¶}¾÷¨ì²{¦b¡AÁ`¦@¼g¤JªºÀɮ׳æ¦ì¡F
    
    ½d¨Ò¤G¡G¨C¨â¬íÄÁ°»´ú¤@¦¸¡A¨Ã¥B¦@°»´ú¤T¦¸Àx¦s¸Ë¸m
    [root@linux ~]# iostat -d 2 3
    Linux 2.6.12-1.1456_FC4 (localhost.localdomain)    10/27/05
    
    Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
    hda               0.55         2.64         3.28    6631507    8231496
    hdb               0.21         4.51         9.10   11342022   22855752
    
    Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
    hda               0.00         0.00         0.00          0          0
    hdb               0.00         0.00         0.00          0          0
    
    Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
    hda               0.00         0.00         0.00          0          0
    hdb               0.00         0.00         0.00          0          0
    # ¥J²Ó¬Ý¤@¤U¡A¦pªG¬O¦³°»´ú¦¸¼Æªº±¡ªp¡A¨º»ò²Ä¤G¦¸¥H«á©ÒÅã¥Üªº¸ê®Æ¡A
    # «h¥Nªí¨â¦¸°»´ú¤§¶¡ªº¨t²Î¶Ç¿é­È¡IÁ|¨Ò¨Ó»¡¡A¤W­±ªº¸ê°T·í¤¤¡A
    # ²Ä¤G¦¸Åã¥Üªº¸ê®Æ¡A«h¬O¨â¬íÄÁ¤º(¥»®×¨Ò)¨t²ÎªºÁ`¶Ç¿é¶q»P¥­§¡­È¡C
    
    ³z¹L lspci ¤Î iostat ¥i¥H¬ù²¤ªºÁA¸Ñ¨ì¥Ø«e¨t²Îªºª¬ºA°Ú¡I ÁÙ¦³¥Ø«eªº¥D¾÷µwÅé¸ê®Æ©O¡Iª¾¹D³o¨Ç¸ê°T«á¡A§Ú­Ì´N¥i¥H¨Óª±¤@¨Ç¤ñ¸û¤£¤@¼ËªºªF¦èÅo¡I ^_^

    ¤p¼ÐÃDªº¹Ï¥ÜÅX°Ê USB ¸Ë¸m¡G
    ¦b²{¦bªº¹q¸£¸Ì­±¡A§A©Î³\¯uªºµLªk·Q¹³¨S¦³ USB ¤¶­±¸Ë¸mªº¥D¾÷¡ã ¦]¬°¤£½×§Ú­ÌªºÁä½L¡B·Æ¹«¡B¦Lªí¾÷¡B±½´y¾¹¡BÀH¨­ºÐµ¥µ¥¡A´X¥G³£¬O¨Ï¥Î¨ì USB ¨Ó§@¬°¶Ç¿éªº¤¶­±ªº¡C ©Ò¿×³o USB (Universal Serial Bus) ³Ì¦­¬O¦b 1994 ¦~³Qµo®i¥X¨Ó¡A ¨ì 1996 ¦~«e«áµo®i¥X version 1.0 ¡A·í®Éªº³t«×¤j¬ù¦b 12Mbit/second¡A ¨ì¤F 1999 ¦~µo®i¥X version 2.0 ¡A³o¤@ª©ªº³t«×«h´£°ª¨ì 480Mbit/second¡C

    USB ¦³«Ü¦hªºÀuÂI°Õ¡A¥]¬A¥L¬O¥i¥H©µ¦ùªº¡A¨C­Ó USB port ³£¥i¥H³Ì¦h±µ¨ì 127 ­Ó¸Ë¸m¡I ³t«×¤S§Ö¡A¤S¨ã¦³ Plug and Play (ÀH´¡§Y¥Î) ªºÀuÂI¡A©Ò¥Hªñ´Á¥H¨Ó³Q¥Î¨Ó§@¬°Äâ±a¦¡¸Ë¸mªº¥D­n¸ê®Æ¶Ç¿é¤¶­±©O¡I

  • Ãö©ó USB ªº´¹¤ùª©¥»¡G
  • ¥Ø«e USB ªº±±¨î¾¹¥D­n¦³¨âºØ³W®æ¡A¤À§O¬O¡G
    • OHCI (Open Host Controller Interface)¡G¥D­n¥Ñ Compaq ©Òµo®i¡A¥]¬A Compaq, SiS, ALi µ¥µ¥¼t°Óµo®iªº´¹¤ù³£¬O¥Î³o­Ó¼Ò²Õ¡F
    • UHCI (Universal Host Controller Interface)¡G¥D­n¥Ñ Intel ©Òµo®i¡A ¥]¬A Intel, VIA µ¥µ¥¼t°Óµo®iªº´¹¤ù³£¬O¨Ï¥Î³o­Ó¼Ò²Õ¡C
    ¦ý¤£½×¬O­þ¤@ºØ USB ªº¸Ë¸m¡A³o¨âºØ´¹¤ù³£¯à°÷±Ò°Ê¨Ã¥B¤ä´©ªº¡C ¤£¹L¡A¥H¨Ï¥Î¤W¨Ó»¡¡A UHCI ¤ñ¸û®e©ö¨Ï¥Î¡A¦ý¬O¥LªºÅX°Êµ{¦¡¤ñ¸û½ÆÂø¤@¨Ç¡A ¥i¯à¤]·|®ø¯Ó¤ñ¸û¦hªº CPU ¸ê·½´N¬O¤F¡C

    ¤]´N¬O»¡¡A°ò¥»¤W¡A¦pªG§A¨Ï¥Î lsmod ®É¡A·|µo²{¨ì (O|U)HCI ¤§Ãþªº¼Ò²Õ®É¡A ¨º´Nªí¥Ü±zªº Linux ¥D¾÷¤w¸g¦³¸ü¤J USB ªºÅX°Êµ{¦¡¤F°Õ¡I ³o¤]¬O¥Ø«e FC4 ¹w³]¸ü¤Jªº¼Ò²Õ¤§¤@°Ú¡I¤£¹L¡A¦pªG±zªº USB ¸Ë¸m¤ñ¸û¦h¡A ¥]¬AÁä½L¡B·Æ¹«¡B·n±ìµ¥µ¥ªº USB ¸Ë¸m®É¡A¨º»ò¥i¯àÁٻݭn¸ü¤J USB Human Interface Device (HID) ¼Ò²Õ¤~¦æ©O¡I¥H³¾­ôªº FC4 ´ú¸Õ¾÷¨Ó»¡¡A§Úªº¥D¾÷¬O Intel 815 ´¹¤ùªº (P-III ªº CPU)¡A ¥Ñ©ó¨S¦³´£¨Ñ USB 2.0 ¡A©Ò¥H¡A³¾­ô¦Û¤v¶R¤F¤@±i USB 2.0 ªºÂX¥R¥d¡CµM«á¡A¨Ï¥Î lsmod ¥X²{¦p¤Uªºµe­±Åo¡I
    [root@linux ~]# lsmod
    Module                  Size  Used by
    uhci_hcd               43345  0
    ehci_hcd               48333  0
    # §Ú¶È¦C¥X³o¨â­Ó¼Ò²Õ¦Ó¤w¡ã¤W­±ªº¬O UHCI ¼Ò²Õ¡A©³¤U«h¬O USB ¼W±j¼Ò²Õ¡C
    
    [root@linux ~]# modinfo ehci_hcd
    ....¬Ù²¤.....
    description:    10 Dec 2004 USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    author:         David Brownell
    license:        GPL
    ....¬Ù²¤.....
    # «Ü¦³½ì§a¡I»¡ªº¬O Enhanced Host Controller ©O¡I
    
    Tips:
    ¨Æ¹ê¤W¡A§ó¦hªº USB ¸Ë¸mªº¸ê°T³£©ñ¸m¨ì hotplug ³o­Ó®M¥ó¸Ì­±©O¡ã §A¥i¥H¨ì /etc/hotplug.d/ ¥Ø¿ý¤U¥h¬d¾\¤@¤U¬ÛÃöªº»¡©ú³á¡I
    ³¾­ôªº¹Ï¥Ü
  • ±Ò°Ê USB ÀH¨­ºÐ¡G
  • §Ú­Ì¤§«e½Í¹L USB ªººÏºÐ¥N¸¹¬O¡G /dev/sd[a-p] ¤§Ãþªº¡AÃþ¦ü SCSI µwºÐªº¥N¸¹¡A ³o¬O¦]¬° USB ªººÏºÐ¸Ë¸m¨Ï¥Î SCSI ¬ÛÃöªº¸Ë¸m¥N¸¹¡A¦]¦¹¡A¦pªG±z­n¨Ï¥Î USB ÀH¨­ºÐªº¸Ü¡A¼K¼K¡I¨º»ò±zªº Linux ¥D¾÷´N±o­n¤ä´© SCSI ¸Ë¸m¤~¦æ¡ã

    ¦¹¥~¡A¬°¤FÅý USB ºÏºÐ¸Ë¸m¶¶§Qªº³Q¨Ï¥Î¡A¦]¦¹¡A¦³®É­ÔÁÙ±o­n±Ò°Ê usb-storage ¼Ò²Õ¤~¦æ¡ã ©Ò¥HÅo¡A¥ú¬O¦³ USB ªº uhci ¼Ò²ÕÁÙ¤£¦æ¡AÁÙ±o­n°t¦X usb-storage °Õ¡ã ¦Ó¤@¯ë USB ªº¸Ë¸m³£·|³Q¥D°Êªº°»´ú¡A®Ö¤ß¤]·|¥D°Êªº¸ü¤J USB ¸Ë¸mªºÅX°Ê¼Ò²Õ¡A ©Ò¥H±zÀ³¸Ó¤£»Ý­n¤â°Ê¸ü¤J usb-storage ¤~¬O¡C¤£¹L¡A¦pªG¦Ñ¬OµLªkÅX°Ê®É¡A ¨º»ò¤£§«¤â°Ê¸ü¤J usb-storage ¸Õ¬Ý¬Ý¡C

    ¶¶§Q¸ü¤J¦U­Ó»Ý­nªº¼Ò²Õ¤§«á¡Aª½±µ¤U¹F fdisk -l À³¸Ó´N¥i¥H¬Ý¨ì±zªº USB ÀH¨­ºÐªº¸Ë¸m¥N¸¹¤~¬O¡I¤@¯ë¨Ó»¡¡A¦pªG¬O²Ä¤@­Ó USB ºÏºÐ¸Ë¸mªº¸Ü¡A À³¸Ó¥i¥H¬Ý¨ì¤@­Ó¦W¬° /dev/sda1 ªº¸Ë¸m¡A¨Ï¥Î mount ±N¥L±¾¸ü°_¨Ó§Y¥i°Ú¡I ¸Ô²Óªº±¾¸ü (mount) »P±¾¸üÂIÁÙ¦³Àɮרt²Î®æ¦¡ (filesystem) ³¾­ô¦b³o¸Ì´N¤£½Í¤F¡A ½½²Ä¤G½gªº¤º®e¥h¡I ^_^

  • ±Ò°Ê USB ¦Lªí¾÷¡G
  • ­nÅX°Ê USB ¦Lªí¾÷¤]«Ü²³æ°Ú¡I ¥u­n°µ¦n USB ¦Lªí¾÷ªº¸Ë¸m¥N¸¹§Y¥i¡I¤Ï¥¿§Ú­Ìªº usb ¼Ò²Õ¤w¸g¸ü¤J¤F¹À¡I ­n«Ø¥ß USB ¦Lªí¾÷ªº¸Ë¸m¥N¸¹±o¨Ï¥Î mknod ³o­Ó«ü¥O¤~¦æ¡C ¦¹¥~¡A USB ¦Lªí¾÷¸Ë¸mªº major, minor ¥N¸¹¤À§O¬O 180 0¡A ©Ò¥H¡A«Ø¥ßªº¤èªk¬°¡G
    [root@linux ~]# mkdir -p /dev/usb
    [root@linux ~]# mknod /dev/usb/lp0 c 180 0
    [root@linux ~]# chown root:lp /dev/usb/lp0
    [root@linux ~]# chmod 660 /dev/usb/lp0
    [root@linux ~]# ls -l /dev/usb/lp0
    crw-rw----  1 root lp 180, 0 Nov  7 16:03 /dev/usb/lp0
    [root@linux ~]# echo "testing" > /dev/usb/lp0
    
    ³¾­ô³o¸Ì¬O¥H FC4 ¬°½d¨Ò¡A­nª`·N¡A /dev/usb/lp0 ªºÅv­­¥²¶·­n»P /dev/lp0 ¬Û¦P¡A ©Ò¥H¡A§Ú³o¸ÌÁÙ±o­n¨Ï¥Î chown »P chmod ¨ÓÅÜ´«¸Ó¸Ë¸mÀɮתºÅv­­¤~¦æ¡C «Ø¥ß¦n¤§«á¡A´N¥i¥H¨Ï¥Î cups ¤§Ãþªº³nÅé¨ÓºÞ²z³o¤@³¡¦Lªí¾÷Åo¡I ^_^¡C ¨Æ¹ê¤W¡A°£¤F¤ñ¸û¦­´Áªº Linux distributions ¤§¥~¡A¸û·sªº distributions ¤w¸gÀ°§Ú­Ì«Ø¥ß¦n /dev/usb/lp0 µ¥Àɮ׸˸m¤F©O¡I¯u¬O¤è«K¡I

    ¦b§Ú­Ì¤@¯ëªº¥Í¬¡·í¤¤¡A³Ì±`¨£ªº¨âºØ USB ¸Ë¸m¡A´N¬OÀH¨­ºÐ»P¦Lªí¾÷¤F¡A ©Ò¥H³¾­ô¦b³o¸Ì¶È´N³o¨âºØ¸Ë¸m¨Ó¤¶²Ð±Ò°Êªº¤èªk¡A¦pªG±zÁÙ¦³¨ä¥Lªº USB ¸Ë¸m­nÅX°Êªº¸Ü¡A ½Ð°Ñ¦Ò©³¤U³o¤@½gªº¤º®e°Ú¡I ¦Ü©ó USB ¦Lªí¾÷ªº¹ê»ÚÅX°Ê¡A§Ú­ÌÁÙ±o­nÄ~Äò CUPS ³¹¸`ªº¤º®e¤~¦æ³á¡I


    ¤p¼ÐÃDªº¹Ï¥Ü¨Ï¥Î lm_sensors ¨ú±o·Å«×¡B¹qÀ£µ¥¸ê°T
    ª±¹q¸£µwÅ骺ªB¤Í­Ì¤@©w³£Å¥¹L©Ò¿×ªº¡y¶WÀW¡z³oª±·N¨à¡A©Ò¿×ªº¡y¶WÀW¡z´N¬OÅý¨t²Î­ì¦³ªº¹B§@®É¯ß¼W¥[¡A Åý CPU/PCI/AGI «eºÝ¶×¬y±Æ³t«×´£¤É¨ì«D¥¿³WªºÀW²v¡A¥H¨ú±o¸û°ªªº¹q¸£®Ä¯à¡C ³o¦b¦­´Á¹ï©ó³æ»ùÁÙ¬O«Ü¶Qªº¹q¸£¨Ó»¡¡A¥i¥HÅý§Ú­Ìªá¤ñ¸û¤Öªº¿ú¥hÀò±o¤ñ¸û°ª®Ä¯àªº¹q¸£­ù¡I ¤£¹L¡A¶WÀW­nª`·Nªº¦a¤è¥i¤£¤Ö¡A¥]¬A¹qÀ£¤£¥i°ª¥X CPU ªº­t²ü¡BCPU ­·®°¥²¶·­n±j¦³¤O¡A ÁקK¦]¬°·Å«×¹L°ª¾É­P¨t²Î·í¾÷µ¥µ¥¡C

    ¤£¹L²{¤µªº¹q¸£³t«×¤w¸g°÷§Ö¤F¡A§Ú­Ìªº Linux ¥D¾÷¤]¹ê¦b¤£«Øij±z¶WÀW¡A ¦]¬°¾ãÅé®Ä¯à¥i¯à¼W¥[¤£¤F¦h¤Ö¡A¦ý¬O«o·|Åý±zªº¥D¾÷¹Ø©R´î¤Ö¡B¨t²Î¤£Ã­©w©O¡I ¦Ó¥Ñ¦­´Á¶WÀWªº¡y§Þ³N°ö¾i¡z¹Lµ{·í¤¤¡A§Ú­Ìª¾¹D¡yCPU ªº·Å«×¡B¨t²Îªº¬ÛÃö¹qÀ£¡z ¬O¼vÅT¥D¾÷¬O§_í©wªº¤@¶µ­«­n«ü¼Ð³á¡I©Ò¥HÅo¡A¦pªG¯à°÷ÀH®É´x´¤·Å«×¡B¹qÀ£¡A ¨ä¹ê¹ï©ó¨t²ÎÁÙ¬O¦³¤@©wµ{«×ªººÊ±±°Õ¡C

    ¨ä¹ê¦U¤j¥D­n¥D¾÷ªO°Ó»P´¹¤ù²Õ¡A³£·|¦³·Å«×¡BÀ£¤Oªº°»´ú¾¹¦b¥D¾÷¤º¡A ³o­Ó§Ú­Ì¥i¥H¦b¥D¾÷ªO¾Þ§@¤â¥U©ÎªÌ¬O¦b BIOS ¤ºªº¡y Monitor ¡z¶µ¥Ø§ä¨ì¬ÛÃöªº·Å«×¡BÀ£¤O¸ê®Æ¡C ¦b Windows ¨t²Î·í¤¤¡A¼t°Ó¦³±À¥X¬ÛÃöªº³nÅé¨Ó°»´ú¡A¨º»ò¦b Linux ·í¤¤©O¡H¨þ¨þ¡I¤]¬O¦³°Ú¡I¨º´N¬O lm_sensors ³o®M¦n¥ÎªºªF¦è¤F¡I

    »P¤§«eª©¥»¤£¦Pªº¬O¡AFC4 ¤w¸g¤º«Ø¤F³o­Ó lm_sensors ®M¥ó¤F¡A©Ò¥H§Ú­Ì¤£»Ý­n¤â°Ê¥h¦w¸Ë¥L¡I ¯u¬O¦n°ª¿³°Ú¡ãÀˬd¬Ý¬Ý±zªº¥D¾÷¬O§_¦³³o­Óª±·N¨à§a¡I
    [root@linux ~]# rpm -qa | grep lm_sensors
    lm_sensors-2.9.1-3.FC4.2
    
    ¦pªG±zªº Linux distributions ¬O¤ñ¸û¦­´Áªºª©¥»¡A¨º»ò´N¥u¦n½Ð±z¦Û¦æ«e©¹ http://www2.lm-sensors.nu/~lm78/ ©x¤èºô¯¸ª½±µ¤U¸ü tarball ¨Ã¥B¦w¸Ë¥LÅo¡ã¦pªG±z¨Ï¥Îªº¬O FC3 ©Î FC4 ¡A¨º»ò§Ú­Ì´Nª½±µ¨Ó³B²z§a¡I

    ¥Ñ©ó lm_sensors ¥D­n¬O¨Ì¾Ú¡y¥D¾÷ªO´¹¤ù²Õªº«¬¸¹¡A±a¤J¬ÛÃöªº¼Ò²Õ«á¡A¦A°»´ú¨ä·Å«×¡BÀ£¤O¡zªº¡A ¦pªG¸Ó¥D¾÷ªO´¹¤ù²Õ¨Ã¤£¬O lm_sensors ©Ò¤ä´©ªº¼Ò²Õ¡A¨º¦ÛµM´NµLªk§ä¥X¸Ó´¹¤ù²Õªº·ÅÀ£Åo¡ã ©Ò¥H°Õ¡A§Ú­Ì¦b¨Ï¥Î lm_sensors ¤§«e¡A¥²¶·­n½T©w¥D¾÷ªO¬O¦³´£¨Ñ·Å«×¡B¹qÀ£ªº¡A ¦A¨Ó¡A¥²¶·­n¸ü¤J¥D¾÷ªOªºÅX°Ê¼Ò²Õ¡AµM«á¤~¦³¿ìªk¨Ï¥Î lm_sensors ¨Ó¶i¦æ°»´ú¡C

    ¦Ó¡A¦n®ø®§¬O¡A lm_sensors ¥»¨Ó´N´£¨Ñ§Ú­Ì¤@­Ó¤£¿ùªº¥D¾÷ªO´¹¤ù²Õ°»´úµ{¦¡¡A ¨º´N¬O sensors-detect ³o­Ó«ü¥O¡C°»´ú¨ì¥D¾÷ªO´¹¤ù²Õ«á¡A±N¸Ó¸ê°T¼g¤J³]©wÀÉ·í¤¤¡A ´N¥i¥H¨Ï¥Î sensors «ü¥Oª½±µÅª¨ú¥Ø«eªº CPU¡B¾÷´ß¡B¹q·½¡B­·®°µ¥µ¥ªº¸ê°T¤F¡I ª½±µ¨Ó§@¬Ý¬Ý§a¡I
    1. ¥ý°»´ú¥D¾÷ªOªº´¹¤ù²Õ°Ú¡I
    [root@linux ~]# sensors-detect
    # ¶}ÀY·|¦³¤@¨Ç²³æªº»¡©ú¡A¬Ý¬Ý´N¦n¡I
    It is generally safe and recommended to accept the default answers to all
    questions, unless you know what you're doing.
    
     We can start with probing for (PCI) I2C or SMBus adapters.
     You do not need any special privileges for this.
     Do you want to probe now? (YES/no): y
    Probing for PCI bus adapters...
    Use driver `rivatv' for device 01:00.0: GeForce2 MX
    Use driver `i2c-viapro' for device 00:07.4: VIA Technologies VT82C686 Apollo ACPI
    Probe succesfully concluded.
    # ±µ¤U¨Óªº¦æ¬°·í¤¤¡A¤Ï¥¿§A´N¤@ª½«ö Enter  ´N¥i¥H¤F¡IÅý¥L¦Û°Ê¥h°»´ú¡I
    
     I will now generate the commands needed to load the I2C modules.
     Sometimes, a chip is available both through the ISA bus and an I2C bus.
     ISA bus access is faster, but you need to load an additional driver module
     for it. If you have the choice, do you want to use the ISA bus or the
     I2C/SMBus (ISA/smbus)?
    
    To make the sensors modules behave correctly, add these lines to
    /etc/modules.conf:
    
    #----cut here----
    # I2C module options
    alias char-major-89 i2c-dev
    #----cut here----
    
    To load everything that is needed, add this to some /etc/rc* file:
    
    #----cut here----
    # I2C adapter drivers
    modprobe i2c-viapro
    modprobe i2c-isa
    # I2C chip drivers
    modprobe eeprom
    modprobe via686a
    # sleep 2 # optional
    /usr/bin/sensors -s # recommended
    #----cut here----
    # ¤W­±ªºÃöÁä¬O­«ÂI¡I§i¶D§A­n¦p¦ó¸ü¤J¼Ò²Õªº¤@­Ó²³æªº½d¨Ò°Ú¡I
    
    Do you want to generate /etc/sysconfig/lm_sensors? (YES/no):
    Copy prog/init/lm_sensors.init to /etc/rc.d/init.d/lm_sensors
    for initialization at boot time.
    
    # ¦pªG·Q­n½T»{¤@¤U sensors-detect °»´ú¨ìªºµ²ªG¬O§_¥¿½T¡A
    # ¥i¥H¨Ï¥Î lspci ¬d¾\¤@¤U³á¡I³¾­ôªº¨Ò¤l·í¤¤¡A¬O³o¼Ëªº¡G
    [root@linux ~]# lspci
    00:00.0 Host bridge: VIA Technologies, Inc. VT82C693A/694x [Apollo PRO133x] (rev c4)
    00:01.0 PCI bridge: VIA Technologies, Inc. VT82C598/694x [Apollo MVP3/Pro133x AGP]
    00:07.0 ISA bridge: VIA Technologies, Inc. VT82C686 [Apollo Super South] (rev 22)
    # ½T¹ê§ä¨ìªº¬O VIA ªº´¹¤ù¡I¨S¦³°ÝÃD¡I
    
    
    2. ¶}©l¸ü¤J¼Ò²Õ»P­×§ï¤@¨Ç³]©w¸ê®ÆÀÉ®×°Ú¡I
    [root@linux ~]# vi /etc/modprobe.conf
    alias char-major-89 i2c-dev
    # ±N­è­è°»´ú¨ìªº¼Ò²Õµ¹¥L¼g¤J¨ì³o­ÓÀÉ®×·í¤¤¡I³o¬O kernel 2.6 ª©ªº¡I
    # ¦pªG¬O¦­´Áªº kernel 2.4 ®Ö¤ß¡A¨º´N¼g¨ì /etc/modules.conf ·í¤¤¡I
    
    [root@linux ~]# vi /etc/rc.d/rc.local
    # Adding the sensor for VIA 686A Chip
    /sbin/modprobe i2c-isa
    /sbin/modprobe via686a
    sleep 2
    /usr/bin/sensors -s
    # ÁöµM sensors-detect §Æ±æ§Ú¥i¥H¸ü¤J¥|­Ó¼Ò²Õ¡A¤£¹L¡A³¾­ô¤ÀªRªºµ²ªG¡A
    # µo²{§Ú¥u­n¨â­Ó¼Ò²Õ¸ü¤J§Y¥i¡ã©Ò¥H¡A³o¸Ì§Ú¦³¬Ù¥h¨â­Ó modules ªº¸ü¤J³á¡I
    # ·íµM°Õ¡I«Øij§AÁÙ­n¬Ý¤@¬Ý /etc/sysconfig/lm_sensors Àɮתº¤º®e¡A´N¤ñ¸û§ó²M·¡¤F¡I
    
    [root@linux ~]# sync; sync; reboot
    # ÁöµM¥i¥Hª½±µ§Q¥Î¤W­zªº«ü¥O¦b bash ·í¤¤ª½±µ³B²z¡A¤£¹L§Ú¤£³ßÅw³o¼Ë¡A©Ò¥HÅo¡A
    # ª½±µµ¹¥L­«·s±Ò°Ê¨t²Î¡A´N OK °Õ¡I¥t¥~¡AÆ[¹î¤@¤U¬O§_¶}¾÷§Y±Ò°Ê lm_sensors¡H
    [root@linux ~]# chkconfig --list | grep lm_sensors
    lm_sensors      0:off   1:off   2:on    3:on    4:on    5:on    6:off
    
    
    3. ´ú¸Õ°»´ú¥D¾÷ªºª¬ªp¡I
    [root@linux ~]# sensors
    via686a-isa-6000
    Adapter: ISA adapter
    CPU1 core: +1.73 V  (min =  +1.65 V, max =  +1.90 V)
    CPU2 core: +1.73 V  (min =  +1.65 V, max =  +1.90 V)
    I/O:       +3.42 V  (min =  +3.12 V, max =  +3.45 V)
    +5V:       +5.18 V  (min =  +4.73 V, max =  +5.20 V)
    +12V:     +12.24 V  (min = +11.35 V, max = +12.48 V)
    CPU1 Fan: 4963 RPM  (min = 3000 RPM, div = 2)
    CPU2 Fan: 5232 RPM  (min = 3000 RPM, div = 2)
    CPU1 Temp: +39.7¢XC  (high =   +65¢XC, hyst =   +55¢XC)
    CPU2 Temp: +40.4¢XC  (high =   +65¢XC, hyst =   +55¢XC)
    SBr Temp:  +23.3¢XC  (high =   +65¢XC, hyst =   +60¢XC)
    # ¨þ¨þ¨þ¨þ¡I¤£¦ý¥i¥H¬Ý¨ì·Å«×¡B¹qÀ£¡AÁÙ¦³­·®°Âà³t¡A¹ê¦b¤Ó§¹¬ü¤F¡I
    # «x¡I«ç»ò·|¬OÂù CPU °Ú¡I¨þ¨þ¡I¦]¬°³¾­ôªº¥D¾÷ªO (³o­Ó´ú¸Õªº¥­¥x) ¬OÂù CPU ¥­¥x¡A
    # ¦ý¬O lm_sensors ¨Ã¨S¦³À°§Ú¥D°Êªº¤À¥XÂù CPU ¡A©Ò¥H¡A³¾­ô¬O¦Û¦æ¶i¤J³]©wÀÉ¡A
    # ¥ç§Y¬O /etc/sensors.conf ¥h¶i¦æ­×­qªº¤u§@¡I
    
    °ò¥»¤W¡A¥u­n³o¼Ëªº¨BÆJ¡A±zªº¥D¾÷´N¥i¥H¥D°Êªº°»´ú·Å«×»P¹qÀ£¡AÁÙ¦³­·®°Âà³tµ¥µ¥¸ê°T¡C ¤£¹L¡A¨Æ¹ê¤W¡A¥Ñ©ó¥D¾÷ªO³]­pªº¤£¦P¡A©Ò¥H°»´úªºµ²ªG«Ü¦³¥i¯à¬O¦³»~®tªº¡C¥H³¾­ôªº±¡ªp¨Ó»¡¡A VIA 694D ¬O¾A¥ÎÂù CPU ªº¥D¾÷ªO¡A¦ý¬O lm_sensors °²©w«h¬O¶È¦³³æÁû CPU ªºÅã¥Üª¬ªp¡A ©Ò¥H¡AÅã¥Üªºµ²ªG»P¹ê»Úªº¼Æ¾Ú¬O¦³®t²§ªº¡ã¦¹®É©Î³\´N»Ý­n¶i¦æ½Õ®Õ¤F¡C ½Õ®Õªº¨BÆJ«Ü²³æ¡A¥ý½T©w¨Ï¥Î sensors Åã¥Üªºµ²ªG¨C­Ó¶µ¥Ø¥Nªíªº·N¸q (¥i¥H°Ñ¦Ò BIOS µwÅé°»´úµ²ªGªº¶¶§Ç¨Ó±Æ¦C) ¡AµM«á¶i¤J /etc/sensors.conf ¶i¦æ­×§ï§Y¥i¡C ³¾­ô¥H¦Û¤vªº via686a ³o­Ó´¹¤ù²Õ¨Ó»¡©ú¡I
    [root@linux ~]# vi /etc/sensors.conf
    # ¦b³o­ÓÀÉ®×·í¤¤¡A¥ý§ä¨ì§Aªº¥D¾÷ªO´¹¤ù²Õ¡A°Ñ¦Ò¨ä¤º®e³á¡I
    # ¦Ü©ó°£¤F chip «á­±±µªº¬O´¹¤ù²Õ¥~¡A¨ä¥Lªº«h¥H©³¤Uªº®æ¦¡¨Ó®Ñ¼gªº¡G
    # label  '¹ê»Ú°»´úªº¿é¥X©ÎªÌ¬O¥N¸¹'  '¨Ï¥Î lm_sensors ¿é¥Xªº¸ê°T'
    # Á|¨Ò¨Ó»¡¡A²Ä¤@Áû CPU ªº°»´ú¶µ¥Ø¨ä¹ê¬O "2.0V" ¡A¨º­Ó¬O¹ê»Ú¦s¦b
    # ¥D¾÷ªO·í¤¤ªº¤@­Ó¶µ¥Ø¡A¦Ü©ó«á­±ªº CPU1 core «h¬O§Ú­Ì¦Û¤v¥[¤W¥hªº¡A
    # ³o¼Ë¤~¥i¥H¦b¨Ï¥Î sensors ®É¡A¬Ý¨ì¿é¥Xªºµ²ªG°Ú¡I¦]¦¹¡A
    # ¨º­Ó "2.0V" ¤£­n°Ê¡ã°Êªº¬O¨º­Ó "CPU1 core" ³á¡I
    
    chip "via686a-*"
        label "2.0V" "CPU1 core"
        label "2.5V" "CPU2 core"
        label "3.3V" "I/O"
        label "5.0V" "+5V"
        label "12V" "+12V"
        label fan1  "CPU1 Fan"
        label fan2  "CPU2 Fan"
        label temp1 "CPU1 Temp"
        label temp2 "CPU2 Temp"
        label temp3 "SBr Temp"
    
    # ¦Ü©ó©³¤Uªº set «h¬O¦b³]©w¡y³Ì¤j¡B³Ì¤p­­¨î­È¡z´N¬O¤F¡ã
    # ¨ä¤¤¡A©³¤U¨º­Ó in0 ¤Î in1 ¤À§O¥Nªí²Ä¤@¡B²Ä¤G­Ó label ªº·N«ä¡A¥ç§Y¬O
    # CPU1 core ¤Î CPU2 core °Õ¡ã¦A¨Ó¡A«h¬O temp1~3 ¡A
    # ª`·N¡A¦pªG¶µ¥Ø¤£¬O "2.0V" ³oºØ¥HÂù¤Þ¸¹¨ú¥Xªº¡A«h¥²¶·­n¨Ï¥Î­ì¥»ªº¦WºÙ¡A
    # ¥ç¦p fan1, fan2 µ¥µ¥¡A³o­Ó°È¥²ÁA¸Ñ¤~¦æ¡I
        set in0_min 1.65
        set in0_max 1.90
        set in1_min 1.65
        set in1_max 1.90
        set temp1_hyst 55
        set temp1_over 65
        set temp2_hyst 55
        set temp2_over 65
        set temp3_hyst 60
        set temp3_over 65
        set fan1_min 3000
        set fan2_min 3000
    
    ­×§ï§¹²¦¤§«á¡A´N¥i¥H·Ç³Æ·Ç³Æ¥[¤J§ó·sÅo¡ã¨º´N¬O¨Ï¥Î¡G
    [root@linux ~]# sensors -s
    
    ½T©w§ó·s¤F³o­Ó¸ê°T¤§«á¡A¦A¤U¹F sensors ¡A¼K¼K¼K¼K¡I´N¥i¥H¶¶§Qªº¨ú±oÄݩ󥿽Tªº¸ê°T°Õ¡I ·íµM¡A¦pªG·Q­n¥H¹Ïªí¿é¥Xªº¸Ü¡A¨º»ò¤£§«·f°t MRTG ¨Ó¶i¦æºô­¶Ã¸¹Ï¡ã ³o³¡¤Àºô¸ô¤W­±¤å³¹´N¤ñ¸û¦h¤@ÂI¡A¤]¥i¥H¥ý°Ñ¦Ò³¾­ôªº¤@½g¤峹¡G ¥[ªoÅo¡I ^_^

    ¤j¼ÐÃDªº¹Ï¥ÜFC4 ªº¨t²Î¾Þ§@¡G setup ¥\¯à
    §Ú­Ì¦b°ò¦½g½Í¨ì«Ü¦hªº·§©À°ÝÃD¡A¥]¬A¾ã­Ó¶}¾÷¬yµ{¨ä¹ê¬Ýªº¬O /etc/inittab ªº³W©w¶µ¥Ø¡A ¨C­ÓªA°È±Ò°Êªº scripts ¬O©ñ¦b /etc/init.d/scriptname ¸Ì­±¡A¦ý¬O±Ò°Ê³]©wÀÉ«h¥i¯à·|¥]§t¦b /etc/sysconfig ¤º¡C Á|¨Ò¨Ó»¡¡A­è­è¤W­±´£¨ìªº lm_sensors ¡A¥Lªº¼Ò²Õ¦WºÙ´N©ñ¸m¦b /etc/sysconfig/lm_sensors ©O¡ã ·íµM¡A±z¤]¥i¥H¦Û¦æ§ó§ï /etc/init.d/lm_sensors ªº¤º®e¡AÅý¥L¤£­n¥hŪ¨ú /etc/sysconfig/lm_sensors¡A ¦ý²¦³º¬O¨t²Î¹w³]ªºª¬ºA¤ñ¸û¦n±±¨î°Ú¡ã

    ¦b§Ú­ÌÁA¸Ñ¨ì³o¨Ç°ò¥»ªº³]©w¸ê°T«á¡A¨þ¨þ¡ã²×©ó¥i¥H¥Î¤@¤U¨t²Î´£¨Ñµ¹§Ú­ÌªºÂ²³æªº¾Þ§@¤¶­±°Õ¡ã ¦b Fedora ¸Ì­±¡A¦³­Ó Red Hat ¨t²ÎÁ`¬O¦³´£¨Ñªº¤u¨ã¡A®M¥ó¦WºÙ¬° setuptool ¡A ¾ã­Ó°õ¦æªº¹Lµ{«hª½±µ¤U¹F setup ´N¯à°÷³B²z­ù¡ã¯u¬O¦n¤è«K§o¡I ¦³ÂIÃþ¦üµøµ¡´N¬O¤F¡C¤£¹L¡A¨S¦³«Ü«Øij±z¨Ï¥Î¡A¦]¬°¨ä¹êª½±µ¨Ï¥Î«ü¥O©Î vi ¤]¥i¥H¹F¦¨ setup ©Ò´£¨Ñªº¥\¯à°Õ¡I ^_^¡C·í§A¥H root ªº¨­¥÷¤U¹F¡y setup ¡z«á¡A·|¥X²{³o¼Ëªº©N©N¡G( ·íµM°Õ¡I±z¥²¶·­n¦w¸Ë setuptool ®M¥ó¤~¦æ¡I ¦Ó¥B¡A§Ú¬O¨Ï¥Î LANG=en_US ¨Ó¶i¦æµe­±Â^¨úªº¡A¦pªG±z¬O¦b¥i¥HÅã¥Ü¤¤¤åªºÀô¹Ò¤U¡A ¥i¥H¨Ï¥Î zh_TW.big5 )

    Red Hat ¨t²Îªº setup «ü¥O
    ¹Ï¡BRed Hat ¨t²Îªº setup «ü¥O

    ¥D­nªº¶µ¥Ø¨ä¹ê´N¬O©³¤U³o¨Ç¸ê®Æ°Õ¡G
    • Authentication configuration¡G
      ³o¬O»P¨Ï¥ÎªÌ»{ÃÒ¾÷¨î¸û¦³¬ÛÃöªº³]©w¸ê®Æ¡A ¥]¬A»{ÃÒ¨Ó·½ªº¥D¾÷½T»{»P¥»¾÷¸ê®Æªº¨M©wµ¥µ¥¡F

    • Firewall configuration ¡G
      ³o­Ó¬OÃö©ó¨t²Îªº¨¾¤õÀð³]©w¡C¤@¯ë¨Ó»¡¡A¤â°Ê³]©w¤ñ¸û¦n¡A¥Î³o­ÓªF¦è³]©w¡A ±`±`·|·d¤£À´¥L¨ì©³¦b­þ¨Ç¦a¤è§@¤F­þ¨Ç¨Æ±¡¡ã¤£®e©ö·d©w°Õ¡I

    • Keyboard configuration ¡G
      ¥]¬AÁä½Lªº§Î¦¡»P³Ì­«­nªºÁä½Lªº«öÁä¹ïÀ³ªí¡Cª`·N¡A ³o­Ó³]©w¶È»P tty ¤¶­±¦³Ãö¡A¦Ü©ó X Window «h¤£¬O¥H³o­Ó¬°³]©w­È¡C

    • Mouse configuration ¡G
      ³]©w·Æ¹«ªº«¬ºAªº¦a¤è°Õ¡F

    • Network configuration ¡G
      ³]©wºô¸ô°Ñ¼Æªº¦a¤è¡A¥]¬A IP, network, netmask, dns µ¥µ¥¡A¤£¹L¡A Áٻݭn¬Ý§¹¦øªA¾¹½gÃö©óºô¸ô°ò¦ªº¤¶²Ð«á¡A¤~¯à°÷¤ñ¸ûÁA¸Ñ³]©w­Èªº·N¸q°Õ¡I

    • System services ¡G
      ¨ä¹ê´N¬O¨Ï¥Î ntsysv ªº¤º®e³á¡ã¥ç§Y³]©w¤@¨Ç¨t²ÎªA°Èªº¦a¤è¡F

    • Printer configuration ¡G
      ³]©w¦Lªí¾÷Åo¡F

    • Sound card configuration ¡G
      ­Y±zªº¥D¾÷¤W­±¦³­µ®Ä¥d¡A³o­Ó¶µ¥Ø¤~·|¥X²{¡I´N¬O³]©w­µ®Ä¥d°Õ¡I
    • Timezone configuration ¡G
      ³]©w®É°Ï¡F

    • X configuration ¡G
      ³]©w X-Window ¬ÛÃöªºµwÅé³]©w¡I¥ç§Y¬O³]©w X server °Õ¡I ¤]¥i¥H¤â°Ê­×§ï /etc/X11/xorg.conf ©Î XF86Config °Ú¡I
    ©³¤U§Ú­Ì´N¤@­Ó¤@­Ó¨Ó¤¶²Ð³oª±·N¨à§a¡I¨Ã¥B½Ðª`·N¡A§A¥i¥H§Q¥Î <tab> «öÁä²¾°Ê¡A ¤]¥i¥H§Q¥Î¤W¤U«öÁä²¾°Ê¡A§Q¥ÎªÅ¥ÕÁä©ÎªÌ¬O [enter] «öÁä¨Ó¨M©w¬O§_»Ý­n¡I


  • Authentication configuration
  • ¦b«ö¤U¤F Authentication configuration «á¡A·|¥X²{¦p¤Uµe­±¡G

    Setup ªº»{ÃÒ¾÷¨î³¡¤À
    ¹Ï¡BSetup ªº»{ÃÒ¾÷¨î³¡¤À

    Ãö©ó¨Ï¥ÎªÌ¨­¥÷»{ÃÒ¤W­±¡ALinux ´£¨Ñ¤F¬Û·í¦hªº¾÷¨î³á¡I¥]¬A Linux ¥»¾÷¨t²Î¤W­±ªº MD5 ±K½X½s½X¡A¥H¤Î§Q¥Î shadow ±N±K½X²¾°Ê¨ì /etc/shadow ÀÉ®×·í¤¤µ¥µ¥¡C·íµM°Õ¡A §Ú­Ì¤]¥i¥H§Q¥Îºô¸ô¤W­±ªº¨­¥÷»{ÃÒ¥D¾÷¡A¥]¬A NIS, LDAP ¥H¤Î Windows ¨t²Î´£¨Ñªº»{ÃÒ¥D¾÷µ¥µ¥¡A ¥u¤£¹L³o¨Çºô¸ô¥D¾÷´£¨ÑªºªA°È©O¡A§Ú­Ì³£±o­n¶i¦æ¥Î¤áºÝ³s½uªº³]©w¡A¨Ã¤£¬O±Ò°Ê´N·|¥Í®Äªº¡I ©Ò¥H°Õ¡A§Ú­Ì¶È¦³¥»¾÷±K½XÀɮצӤw¡A·íµM¥u­n¿ï¾Ü³o¨â­Ó¸ê®Æ´N°÷¤F¡C¥t¥~¡A ³o­Ó³]©w¸ê®Æ¥D­n¬O­×§ï /etc/sysconfig/authconfig ÀÉ®×­ù¡I §A¤]¥i¥H¦Û¦æ¤â°Ê­×§ï¸ÓÀɮקY¥i¡C


  • Firewall configuration
  • «ö¤U Firewall configuration «á¡A·|¥X²{¦p¤Uµe­±¡G

    Setup ªº¨¾¤õÀ𳡤À
    ¹Ï¡BSetup ªº¨¾¤õÀ𳡤À

    ª`·N¤@¤U¡A¥Ñ©ó§Ú­Ì¦b¦w¸Ëªº®É­Ô¡A¨Ã¨S¦³¿ï¾Ü¨¾¤õÀð¡A¦]¦¹¡A³o¸Ì¹w³]·|¬O (Disabled) ¨º¤@¶µ¡A ¦pªG§A·Q­n±Ò°Ê¨¾¤õÀð¡A¨º»ò´N±o­n¥ý¿ï¾Ü Enabled «á¡A±N´å¼Ð²¾°Ê¨ì Customize «á¡A ¤~¯à°÷¨M©w§A·Q­nªA°È¶µ¥Ø¡C«ö¤U Customize «á¡A·|¥X²{¦p¤Uµe­±¡G

    Setup ªº¨¾¤õÀ𳡤À
    ¹Ï¡BSetup ªº¨¾¤õÀ𳡤À

    ³o­Ó¦a¤è¤£¬O¤T¨¥¨â»yÁ¿ªº§¹ªº¡I¥]¬A«H¥ôºô°ì¡A¥H¤Î¤¹³\¶i¤Jªº¦øªA¾¹«Ê¥]¡ã «Ü¬O³Â·Ð¡C°ò¥»¤W¡A§A¥u­n³o¼Ë·Q´N¦n¤F¡G
    • Trusted Devices¡G³o¬O«H¥ôºô°ì¡A ¦pªG§A¦³¨â±iºô¸ô¥d¡A¤@±i¬O eth0 ¹ï¤º¡A¤@±i¬O¹ï¥~¡A°²³]¬O eth1 ¡A¨º»ò¦pªG§A·Q­nÅý eth0 ªº¶i¥X«Ê¥]³£¬O¬°«H¥ô¡A¨º»ò³o¸Ì´N¥i¥H±N eth0 ¤Ä¿ï¡C¤£¹L¡A­n«D±`«D±`ª`·N¡A ±µ¨ì¥~³¡ºô°ì (Internet) ªº¨º±iºô¸ô¥d¡A¤d¸U¤£¯à¤Ä¿ï¡A§_«h´N±¾¤F¡I

    • MASQUERADE Devices¡G³o­Ó¬O¡y«Ê¥]°°¸Ë¡zªº¥\¯à¡A ¥ç§Y¬O¶i¦æ IP ¤À¨É¾¹ªº¥\¯à°Õ¡I¦pªG§Aªº Linux ¥D¾÷¬O§@¬°Ãþ¦ü IP ¤À¨É¾¹ªº¥\¯à¡A ¨º»ò¹ï¥~¨º±iºô¸ô¥d´N±o­n±Ò°Ê MASQUERADE ¤~¦æ¡I¥H¤W­±ªº¨Ò¤l¨Ó»¡¡A´N¬O¤Ä¿ï eth1 °Õ¡I

    • Allow incoming¡G³o¸Ì´£¨ìªº´N¬O¦U­ÓªA°Èªº¤º³¡¶µ¥Ø¡A Á|¨Ò¨Ó»¡¡A§Aªº Linux ¦³´£¨Ñ WWW ªA°È¡A¤S§Æ±æ¤j®a³£¯à°÷¨Ó¬d¾\¡A ¨º»ò³o­Ó®É­Ô´N¥i¥H¦b WWW ¨º­Ó¶µ¥Ø«e­±¤Ä¿ï°Õ¡I
    °ò¥»¤W¡A³o­Ó°Ê§@¶È¬O¦b«Ø¥ß /etc/sysconfig/iptables ³o­ÓÀɮצӤw¡C ¦Ó³o­ÓÀÉ®×¹w³]¬O¤£¦s¦bªº (¦]¬°§Ú­Ì¨S¦³±Ò°Ê¨¾¤õÀð°Ú¡I) ¡C ³o¸Ì§A¥ý¦³­Ó·§©À§Y¥i¡A¦]¬°¡A§Ú­Ì¥¼¨Ó·|¤¶²Ð¥H shell script ªº¤è¦¡«Ø¥ßÄÝ©ó±z¦Û¤vªº¨¾¤õÀð¨t²Î¡A ²Ó¸`§Ú­Ì·|¦b¦øªA¾¹½gºCºC§@¤¶²Ðªº°Ú¡I


  • Keyboard configuration
  • ³o­Óµe­±¦p¤U¡G°ò¥»¤W¡A¨ä¹ê´N¬O¿ï¾ÜÁä½L«ö¶sªº¹ïÀ³ªí¦Ó¤w°Õ¡I ³o­Ó³]©w·|­×§ï /etc/sysconfig/keyboard ´N¬O¤F¡C

    Setup ªºÁä½L¿ï¾Ü³¡¤À
    ¹Ï¡BSetup ªºÁä½L¿ï¾Ü³¡¤À


  • Mouse configuration
  • ½Ð¿ï¾Ü±zªº·Æ¹«Ãþ«¬°Ú¡I¨ä¹êª½±µ­×§ï /etc/sysconfig/mouse ¤]¬O¥i¥H°Õ¡I

    Setup ªº·Æ¹«¿ï¾Ü³¡¤À
    ¹Ï¡BSetup ªº·Æ¹«¿ï¾Ü³¡¤À


  • Network configuration
  • ¦bºô¸ôªº³¡¤À¡A¥Ñ©ó§Ú­Ìªº Linux ¤ä´©ªººô¸ô³s½u¤è¦¡²³¦h¡A¦Ó§Ú­Ì¥xÆW¦a°Ï¤ñ¸û±`¨Ï¥Î¤A¤Óºô¸ô (Ethernet) ªº¬[ºc¡A¦pªG§A¦³ºô¸ô¥d¡A¨º»ò§OÃhºÃ¡A·íµM¬O¿ï¾Ü Ethernet Åo¡ã ¦p¤U¹Ï©Ò¥Ü°Õ¡I

    Setup ªººô¸ô¿ï¾Ü³¡¤À
    ¹Ï¡BSetup ªººô¸ô¿ï¾Ü³¡¤À

    ¿ï¾Ü§¹²¦¤§«á¡A·|¥X²{¦p¤Uµøµ¡¡A³o­Ó´N¤ñ¸û³Â·Ð¤F¡ã°ò¥»¤W¡A¶È¦³¨âºØ®æ¦¡¡C ²Ä¤@ºØ¡A§A¥i¥Hª½±µ¤Ä¿ï¡yUse DHCP¡z¨º­Ó¶µ¥Ø¡AÅýÃþ¦ü IP ¤À¨É¾¹¦Û°ÊªºÀ°§A³]©w¦n IP¡F ¥t¤@ºØ¡A´N¦p¦P¤U¦C¹Ï¼Ë¡A¤£­n¤Ä¿ï DHCP¡Aª½±µµ¹¤©¤@­Ó IP ¥H¤Î¬ÛÃöºô¸ô°Ñ¼Æ§Y¥i¡C ³o¨Çºô¸ô°Ñ¼Æªº³]©w§Ú­Ì·|¦b¦øªA¾¹½g¦A¤¶²Ðªº°Õ¡I

    Setup ªººô¸ô¿ï¾Ü³¡¤À
    ¹Ï¡BSetup ªººô¸ô¿ï¾Ü³¡¤À


  • Printer configuration
  • ³o­Ó¶µ¥Ø¦b¨M©w§Aªº¦Lªí¾÷Ãþ«¬°Õ¡I°ò¥»¤W¡A¥L§ó°Êªº´N¬O FC4 ´£¨Ñªº CUPS ¦Lªí¾÷¦î¦C¬ÛÃö¸ê°T¡ã ¦Ó¥B§Ú­Ìµ¥¤@¤U¾ã­Ó³]©wªº¶µ¥Ø¡A¨ä¹ê³£·|¼g¤J /etc/cups/ ¥Ø¿ý¤Uªº³\¦hÀÉ®×·í¤¤­ù¡ã ³o­Ó¥\¯à¹ï©ó«Ø¥ß¦Lªí¾÷ªº°Ê§@¨Ó»¡¡A¹ê¦b¬O¬Û·íªº¤£¿ù³á¡I ¾ã­Ó°Ê§@«ÜÁcº¾¡A§Ú­Ì¤@­Ó¤@­Ó¨Ó»¡©ú§a¡I«ö¤U printer configuration «á¡A¥X²{³o¼Ë¡G

    Setup ªº Printer ¿ï¾Ü³¡¤À
    ¹Ï¡BSetup ªº Printer ¿ï¾Ü³¡¤À

    ¥Ñ©ó§Ú­Ì»Ý­n·s¼W¦Lªí¾÷¡A¦]¦¹¡A·íµM¿ï¾Ü¨º­Ó new °Ú¡ã³o¸Ì½Ðª`·N¤@¤U¡A §Ú­Ì¶È¬O§@­Ó´ú¸Õ¦Ó¤w¡A©Ò¥H³]©w¿ù»~¤]¨SÃö«Yªº°Õ¡ã§Ú³o¸Ì°²³]§Ú¦³¤@³¡ HP 2300 Laserjet ªº¦Lªí¾÷¡A ¦Ó¥B¬O±µ¦b¥»¾÷¤W­±ªº USB port ¡A©Ò¥H´N¶i¦æ³o­Ó°Ê§@¡G

    Setup ªº Printer ¿ï¾Ü³¡¤À
    ¹Ï¡BSetup ªº Printer ¿ï¾Ü³¡¤À

    ¤W­±ªº°Ê§@¶È¬O¦b³]©w¤@­Ó¦Lªí¾÷ªº©R¦W¦Ó¤w¡A¨º­Ó hp2300 ¬OÀH«K¦Û¤v©R¦Wªº¡A µL©Ò¿×¡A¦ý¬O¤U¤è¨º¤­­Ó¿ï¶µ´N­«­n¤F¡I¥Ñ©ó§Ú­Ì¨Ï¥Îªº¬O¥»¾÷¸Ë¸m¡A¦]¦¹¡A´N±o¿ï LOCAL ¨º¤@¶µ¤~¦æ¡C ¦pªG§A¦³¯S®í»Ý¨D¡A¨º»ò¤~¦Û¦æ³]©w§a¡I¸U¤@¬Oºô¸ô¦Lªí¾÷©O¡H¦³ IP ªº¦Lªí¾÷¡A ¨º»ò³o¸Ì¨Ì¿ï¾Ü LOCAL ³á¡I¤£­n·d¿ù¤F¡ã

    ±µ¤U¨Ó¡A«ö¤U Next ¤§«á¡A¥X²{©³¤Uªºµe­±¡A¨Æ¹ê¤W¡A¦pªG Linux ¥D¾÷®Ö¤ß¦³°»´ú¨ì¦Lªí¾÷¡A ¨º»ò©³¤Uµe­±ªº¤¤¶¡³¡¤À´N·|Åã¥Ü¥X¸Ó¦Lªí¾÷ªº¬ÛÃö¸Ë¸m¶µ¥Ø¡C¤£¹L¡A§Ú­Ì¬O´ú¸Õ¹À¡I ·íµM¤]·|°»´ú¤£¨ì°Ú¡I¦]¦¹¡A³o¸Ì§Ú­Ì­n¿ï¾Ü Custom ¨º­Ó¶µ¥Ø(¦Û­qªº·N«ä)¡C

    Setup ªº Printer ¿ï¾Ü³¡¤À
    ¹Ï¡BSetup ªº Printer ¿ï¾Ü³¡¤À

    µM«á´N¬O¶ñ¼g¦Lªí¾÷±µ¦b¥D¾÷ªº¨º­Ó³s±µ°ð¤WÀY°Õ¡I§Ú³o¸Ì°²³]¬O USB ¦Lªí¾÷¡A©Ò¥H¦ÛµM´N¬O /dev/usb/lp0 ¡A¦pªG¬O 25 °w§Ç¦C°ðªº¦Lªí¾÷¡A´N¶ñ /dev/lp0 ¡C¦pªG§A¨S¦³ /dev/usb/lp0 ³o­Ó¸Ë¸mÀɮסA °Ñ¦Ò¤W­±§Ú­Ì´£¨ìªº USB ªº¸Ë¸m«Ø¥ß¤èªk§a¡I

    Setup ªº Printer ¿ï¾Ü³¡¤À
    ¹Ï¡BSetup ªº Printer ¿ï¾Ü³¡¤À

    ±µ¤U¨Ó¤~¬O¿ï¾Ü¦Lªí¾÷ªº«¬¸¹°Ú¡I§A¥i¥H«ö¤W¤UÁä¡A°t¦X enter «öÁä¨Ó¿ï¾Ü¨ì§Aªº¦Lªí¾÷¡C §Ú­Ì³o¸Ì¨Ï¥Î Postscript ¦C¦L®æ¦¡¨Ó°µ¬°¦Lªí¾÷ªº¥D­n¦C¦L¼Ò¦¡°Ú¡I

    Setup ªº Printer ¿ï¾Ü³¡¤À
    ¹Ï¡BSetup ªº Printer ¿ï¾Ü³¡¤À

    ³Ì«á¦³­ÓÁ`µ²ªº³¡¤À¡A¬Ý¬Ý´N¦n¡ã³Ì«á´N·|±o¨ì¤@­Ó¦W¬° hp2300 ªº¦Lªí¾÷¤F¡I

    Setup ªº Printer ¿ï¾Ü³¡¤À
    ¹Ï¡BSetup ªº Printer ¿ï¾Ü³¡¤À

    Setup ªº Printer ¿ï¾Ü³¡¤À
    ¹Ï¡BSetup ªº Printer ¿ï¾Ü³¡¤À

    ³Ì«á¡A·í§A­nÂ÷¶}¦Lªí¾÷ªº³]©w®É¡A¥L·|Åã¥Ü¬O§_­nÀx¦sªº°Ê§@¡A·íµM¿ï¾Ü¡yYes¡z°Ú¡I ¤£µM³]©w¥i¤£·|³Q°O¿ý¤U¨Óªº³á¡I

    Setup ªº Printer ¿ï¾Ü³¡¤À
    ¹Ï¡BSetup ªº Printer ¿ï¾Ü³¡¤À

    ¨ä¹ê¦Lªí¾÷¦b Linux ¤W­±³]©w¬O®¼³Â·Ðªº¡A¤×¨ä¬O±z¥²¶·­n²M·¡ªºÁA¸Ñ¨ì¦Lªí¾÷¨Ï¥Îªº¼Ò²Õ¬°¦ó¡H ©Ò¥H¡A°ò¥»¤W¡A¨Ï¥Î³o­Ó¶µ¥Ø¨Ó³]©w¦n§Aªº¦Lªí¾÷¡A¹ê¦b¬O¤@­Ó¤£¿ùªº¤èªk¡C ¦Ó­è­èªº°Ê§@°µ§¹«á¡A¨ä¹ê·|¦³´X­Ó¸ê®Æ³Q§ó°Ê¡A¤À§O¬O¡G
    • /etc/cups/printers.conf¡G¥D­n¬O¦Lªí¾÷ªº¬ÛÃö³]©w¶µ¥Ø¡F
    • /etc/cups/cupsd.conf¡G¨Ï¥Î printer Åv­­ªº³]©w¶µ¥Ø¡F
    • /etc/cups/ppd/hp2300.ppd¡G´N¬O­è­è§Ú­Ì¿ï¾Üªº¦Lªí¾÷«¬¸¹ªº¼Ò²Õ¡C
    §ó¦h»P¦Lªí¾÷¦³¬ÛÃöªº¸ê®Æ¡A§Ú­Ì¦b©³¤Uªº CUPS ³¹¸`¦A¨Ó°Q½×Åo¡ã


  • System services
  • °ò¥»¤W¡A³o­Ó´N¬O ntsysv °Õ¡ã³o­Ó§Ú­Ì¤w¸g¦b »{ÃѨt²ÎªA°È ·í¤¤´£¹L¤F¡A©Ò¥H´N¤£¦A®ö¶O³¹¸`°Õ¡I


  • Timezone configuration
  • ®É°Ïªº³]©w¡A¨ä¹ê´N¬O§ä¥X»P /etc/sysconfig/clock ¦³Ãöªº³]©w¶µ¥Ø¦Ó¤w¡C ¹ê»Ú¤W¡A¤U­±¹Ï¥Ü¥X²{ªº©N©N¡A´N¬O¦b /usr/share/zoneinfo/ ¦³Ãö¦Ó¤w¡C

    Setup ªº®É°Ï¿ï¾Ü³¡¤À
    ¹Ï¡BSetup ªº®É°Ï¿ï¾Ü³¡¤À


  • X configuration
  • »¡¬ï¤F¡A¨ä¹ê´N¬Oª½±µ³]©w X Server ªº³]©wÀÉ¡A¦b Xorg ´N¬O /etc/X11/xorg.conf °Õ¡I ¦Ü©ó¾ã­Óµ²ªG¦³¨S¦³¦¨¥\¡AÁÙ±o­nÆ[¹î /var/log/Xorg.setup.log ³o­ÓÀɮתº¿é¥Xµ²ªG¤~¯àÁA¸Ñ³á¡I

    ³¾­ô­Ó¤H»{¬°¡A³o­Ó setup ªº¤u¨ã¬O«Ü¦n¥Îªº¡ã¥u¬O¡A¦pªG¯à°÷§¹¥þ²M·¡¾ã­Ó¨t²Î¬[ºcªº¸Ü¡A ¦A¨Óª±³o­Ó¤pµ{¦¡·|¤ñ¸û¦n°Õ¡I ^_^¡C·íµMÅo¡A¦Lªí¾÷ªº¤u¨ã¹ê¦b«Ü¤£¿ù¡ã ¥i¥H´£¨Ñµ¹±z°Ñ¦Ò°Ñ¦Ò¡I


    ¤j¼ÐÃDªº¹Ï¥Ü§Q¥Î CUPS ¬[ºc±zªº¦Lªí¾÷¡G
    ¦Lªí¾÷¹ï©ó¤é±`¥Í¬¡¨Ó»¡¡A«Ü­«­n§a¡I¨þ¨þ¡ã¨S¿ù°Ú¡I¤×¨ä§Ú­Ìªº Linux ¥D¾÷¦pªG¥¼¨ÓÁÙ­n§@¬° Printer server ªº¸Ü¡A¨º»ò¦ÛµM´N±o­n¥ý«Ø¥ß¦n¦Lªí¾÷ªº³s½u°Õ¡I­è­è«e¤@­Ó¤p¸`§Ú­Ì¶È¬O²³æªº§Q¥Î setup ¨Ó«Ø¥ß¤@³¡¤£¦s¦bªº¦Lªí¾÷¦Ó¤w¡ã°ò¥»¤W¡A§A¥²¶·­nÁA¸Ñ¨ì¾ã­Ó Linux °w¹ï¦C¦Lªº°Ê§@¬O¦p¦ó¡A ¤~¯à°÷²M·¡ªºÁA¸Ñ¨ì§Ú­Ì­n¦p¦óºÞ²z¦Lªí¾÷°Ú¡I ^_^


  • BIOS ·í¤¤¡A°w¹ï¦Lªí¾÷ªº³]©w¶µ¥Ø¡G
  • ¦b¦Lªí¾÷ªº³]©w·í¤¤¡A³¾­ô´¿¸gµo¥Í¹L¤@¥ó¬Û·íêɪº¨Æ±¡¡A§Ú«÷¤F¦Ñ©Rªº³]©w LPRng ¥H¤Î CUPS ´N¬OµLªk³]©w¦n Printer ¡AÁöµM¤w¸g³s¤W¦Lªí¾÷¤F¡A¦ý¬O´N¬O¦L¥X¨Ó³£¬O¶Ã½X¡A «Ü¶Ë¸£µ¬¡ãµ¥¨ì§Úªá¤F¤@¾ã¤Ñ¥h´c·d¤§«á¡A³Ì«á³ºµMµo²{¡A¿ù»~ªº¦a¤è¦b©ó¡yBIOS ªº¥­¦æ°ð³]©w¡z­ü¡I ¶Ë¸£µ¬ªº«Ü¡ãÁÙ°O±o¨C¦¸¶}¾÷ªº®É­Ô¨t²Î³£·|¥hŪ¨ú BIOS ªº³]©w¶Ü¡H¤@¯ë¨Ó»¡¡A«ö¤U DEL «öÁä«á¡A·|¶i¤J BIOS ªº³]©wµe­±¡A¦b¸Óµe­±·í¤¤¡A¿ï¾Ü¬ÛÃöªº³]©w°Ñ¼Æ¡A»P Parallel ¦³Ãöªº¶µ¥Ø¡A±N¡y¼Ò²Õ¡z§ï¦¨ EPP/SPP §a¡I³o¼Ë´N¥i¥H¤ä´©±zªº¦Lªí¾÷¤F¡I¤Ñ§o¡I ´N¦]¬°³o­Ó³]©w­È¡AÅý³¾­ôªá¤F¤@¨â¤Ñªº®É¶¡¡AÁÙ®t¤@ÂI±N¥D¾÷¯{±¼....


  • Linux printer ªº¦C¦L¤u§@¤§¶i¦æ¡G
  • ¦b Linux Àô¹Ò¤U¡A¦p¦ó¶}©l¤@­Ó¦C¦L¤u§@©O¡H°ò¥»¤W¡A¦C¦L¤u§@·íµM¬O¥Ñµ{¦¡©Ò²£¥Íªº°Õ¡ã ¤£½×¬O Open Office ¤§Ãþªº¿ì¤½³nÅé¡A©ÎªÌ¬Oª½±µ¥H lpr ¨Ó¶i¦æ¦C¦Lªº¤u§@¡A¤Ï¥¿¡AÁ`¬O»Ý­n¦³¦C¦Lªº«ü¥O«á¡A ²£¥Í¤@¨Ç¸ê°T¡A¥æµ¹¦Lªí¾÷¨Ó³B²z´N¬O¤F¡C¦b¶i¤J¦Lªí¾÷ªº¹ê»Ú¦C¦L¤§«e¡A Linux ·|¥ý±N¸Ó¶µ¦C¦L¤u§@©ñ¸m¨ì¦î¦C (queue) ·í¤¤¡A¦Ó¨C¤@¶µ¤u§@³£·|³Q¤À¬°¨â­ÓÀɮסA ¤À§O¬O¹ê»Ú­n¦C¦Lªº¸ê®Æ¡A¥H¤Î¸Ó¦C¦L¤u§@ªºÅv­­°Ú¡I¡C ³Ì«á¥Ñ Linux ©Ò¤ä´©ªº¦C¦L¼Ò¦¡ (LPRng ©Î CUPS) ¨Ó±N¸Ó¸ê®ÆÂন¦Lªí¾÷»{ÃѪº®æ¦¡«á¡A ´N¥i¥H¥Ñ¦Lªí¾÷¿é¥X¤F¡Cµ¥¨ì¦C¦L§¹²¦¡A¸Ó¤u§@´N·|³Q queue ©Ò²¾°£¡C

    ´N¬O¦]¬°¦p¦¹¡A¦]¦¹¡A§Ú­ÌÁöµM«Ø¥ß¤F¤@­Ó¤£¦s¦b¡A©ÎªÌ¬O¦Lªí¾÷¼È®ÉµLªk¨Ï¥Îªº±¡ªp¤U¡A ¨Ì¬O¥i¥H¨Ï¥Î¦C¦L³nÅé¨Ó¦C¦L¸ê®Æªº¡A¥u¬O¸Ó¦C¦L¤u§@·|³Q¼È®É¦s©ñ¦b queue ·í¤¤´N¬O¤F¡C ¥t¥~¡A¨º­Ó¦C¦L¼Ò¦¡¬O«Ü­«­nªº¤@­Ó·§©À³á¡I ¦Lªí¾÷³q±`¶È»{ÃѦۤvªº¸ê®Æ®æ¦¡¡A©Ò¥H¡A§Ú­Ì¥²¶·­nÅý Linux ±N¸ê®Æ³B²z¦¨¦Lªí¾÷¯à°÷Ū¨úªº¸ê®Æ®æ¦¡°Ú¡I ¤@¯ë¨Ó»¡¡ALinux ¸Ì­±¦³­Ó«Ü³q¥Îªº¦C¦L¸ê°T¡A¥ç§Y¬O Postscript ¦C¦L®æ¦¡¡A ¦ý¬O±zªº¦Lªí¾÷¥i¤£¨£±o·|¤ä´©³oºØ®æ¦¡¡CªG¯u¦p¦¹®É¡A´N±o­n¨Ï¥Î©Ò¿×ªºÂoÃè (filter) ¨Ó³B²z¸ê®Æ¦¨¬°¦Lªí¾÷»{ÃѪº®æ¦¡¤F¡C

    ¥Ñ©ó postscript ªº¦C¦L¤ñ¸û¦n¡A¦]¦¹¡A¹ê¦b«Ü«Øij±z¡A ª½±µÁʶR¤ä´© postscript ¦C¦L®æ¦¡ªº¦Lªí¾÷´N¦n¤F¡C¨º»ò¦p¦ó±oª¾±zªº¦Lªí¾÷¬O§_¤ä´©¸Ó®æ¦¡¡H «Øij±z¥i¥H«e©¹³o¸Ì¬d¾\¤@¤UÅo¡G Á|¨Ò¨Ó»¡¡A§Ú­Ì¬ã¨s«Ç¨Ï¥Îªº¬O HP Laserjet 2300 ªº¾÷«¬¡A©Ò¥H³¾­ô¿ï¾Ü¤F¤W­±ºô­¶·í¤¤ªº Printer list¡A¥ç§Y¬O¡Ghttp://www.linuxprinting.org/printer_list.cgi ¡AµM«á¿ï¾Ü ¡yHP¡z»P¡yLaserJet 2300¡z«á¡A¥X²{¦p¤Uºô­¶ªº³sµ²¡G http://www.linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_2300 ¡A ¦b¸Óºô­¶·í¤¤¡A¥L¦³´£¨ì Postscript ªº®æ¦¡¦b³o³¡¦Lªí¾÷¤W­±¥i¬O¤u§@ªº«Ü§¹¬ü³á¡I ¨þ¨þ¡I³o¼Ë´N¹ï°Õ¡I ^_^


  • Linux Printer ªº daemon
  • Linux ºÞ²z¦Lªí¾÷ªº daemon ¥D­n¤À¬°¨âºØ¡A¤@ºØ¬O LPRng ¡A¤@ºØ«h¬O¸û·sªº CUPS ( Common Unix Printing System )¡C§Ú­Ì³o¸Ì¶È´N CUPS ¨Ó¶i¦æ»¡©úÅo¡C

    ­è­è´£¨ì¡A§Ú­Ìªº¦C¦L¤u§@¬O¥Ñµ{¦¡¹F¦¨ªº¡A¨Ò¦p lpr µ¥«ü¥O¡C ¦Ó¦C¦L¤u§@³Q«Ø¥ß«á¡A«h³Q©ñ¸m¨ì¦î¦C·í¤¤µ¥«Ý Linux print daemon ªº¤ÀªR»PÂà´«¡C ³o­Ó CUPS ªº daemon ´N¬O¦b¶i¦æ³o­Ó¸ê®ÆÂà´«ªº¤u§@°Õ¡I

    CUPS °£¤F¥i¥H§Q¥Î /etc/cups/mime.types ¿ëÃÑ«ÝÂà´«¦C¦L¸ê®Æªº®æ¦¡¤§¥~¡A ¥LÁÙ¥i¥H¨Ï¥Î¤£¦PªºÂoÃè (filter) ¨ÓÂà´«®æ¦¡¡A¬ÛÃöªºÂoÃè³£©ñ¸m¨ì /usr/lib/cups/filter/ ¥Ø¿ý¤U¡C ·íµM°Õ¡A§Ú­Ì´£¨ì¦³­Ó postscript ¦C¦L®æ¦¡§a¡A¬O§_¬° postscript ®æ¦¡¦³¤£¦PªºÂà´«¤èªk³á¡G
    • Postscript ®æ¦¡
      ¥Ñ©ó Linux ¹ï©ó¦Lªí¾÷®æ¦¡³Ì¼ô±xªº´N¬O postscript ¤F¡A¦]¦¹¡A¦pªG¬O postscript ªº¦Lªí¾÷¡A¨º»ò¦C¦L¸ê®Æ±N·|³Q /etc/cups/mime.conves ¤Î /usr/lib/cups/filter/pstops Âà´«»P¤ÀªR­¶¼Æ¡AµM«áª½±µ¥æµ¹¦Lªí¾÷±N¸ê®Æ¿é¥X¡I

    • «D postscript ®æ¦¡
      ·í±zªº¦Lªí¾÷¹ï postscript ®æ¦¡¨Ã¤£¤ä´©®É¡A¨º»ò¸Ó¸ê®Æ«K·|¥H¨ä¥LªºÂoÃè¶i¦æ¸ê®Æ®æ¦¡ªºÂà´«¡C Âà´«ªº¸ê®Æ¥i¯à¬O Ghostscript ®æ¦¡¡A©ÎªÌ¬Oª½±µ¥H¦Lªí¾÷ªº®æ¦¡¨Óª½±µ¦C¦L¡C µL½×¦p¦ó¡A±zÁÙ¬O±o­nÁA¸Ñ¤@¤U¦Lªí¾÷ªº¦C¦L®æ¦¡¤~¦æ°Ú¡I
    ¬°¤F­nÅý¸ê®ÆÅܦ¨ postscript ¡A¦nÅý¦Lªí¾÷¯à°÷¶¶§Qªº¦C¦L¡A¦]¦¹¡A §Ú­Ìªº cups ·|¥h°Ñ·Ó©Ò¿×ªº Postscript Printer Discription (PPD)¡A ¥ç§Y¬O postscript ªº¦Lªí¾÷´y­z©w¸q¸ê®Æ¡A¨Ã¥B¨Ì¾Ú¸Ó©w¸q¨Ó±N¸ê®ÆÂà´«¦¨¬° postscript ªº®æ¦¡°Ú¡I

    ¨Æ¹ê¤W¡A CUPS ¤w¸gÀ°§Ú­Ì«Ø¥ß¤F«Ü¦h PPD ©w¸qÀɤF¡A³z¹L³o¨Ç PPD Àɮתº´y­z¡A §Ú­Ìªº CUPS ¥i¥H¦Û¦æ¨ú±o¾A¥ÎªºÂoÃè¡A¤£¦A»Ý­n¹³¥H«eªº LPRng ¡AÁÙ±o­n¦Û¦æ´ú¸ÕÂoÃè¬O§_¤u§@¦¨¥\»¡¡I ³o¨Ç¾A¥Îªº PPD ³£³Q©ñ¸m¨ì©³¤Uªº¥Ø¿ý·í¤¤¤F¡G
    • /usr/share/cups/model
    ¦ý¬O¡A¥Ñ©ó³o¨Ç©w¸q¸ê®Æ³£¥i¯à¤@ª½¦b§ó·s¡A¦]¦¹¡A§Ú­Ìªº FC4 ¨Ï¥Îªº¬O§Q¥Î foomatic ³o­Ó®M¥ó¨Ó»²§U¶i¦æ½u¤WÅX°Êµ{¦¡ªº¤U¸ü©O¡I©Ò¥H°Ú¡A¦pªG±zªº Linux ¨S¦³³s±µ¤W Internet ªº¸Ü¡A¨º»ò¥i¯à´NµLªk¨ú±o³Ì¥¿½Tªº¦Lªí¾÷´y­z©w¸qÀÉ (PPD) ¤F¡C ¥t¥~¡A¦b³¾­ô¬Ý¹Lªº Distributions ·í¤¤¡A SuSE server 9 ´Nª½±µ±N¾ã­Ó¦Lªí¾÷ªº PPD ¥Ñ http://www.linuxprinting.org/download/PPD/ ®»¤U¨Ó¡A ¨þ¨þ¡I¤]¬O¥i¥H°Õ¡I©Ò¥H»¡¡A¦pªG±z·Q­n¦Û¦æ¤U¸ü³Ì·sªº¦C¦L®æ¦¡©w¸qÀɮסA ¨º´N¦Û¦æ¨ì http://www.linuxprinting.org/ ¥h·j´MÄÝ©ó±zªº¦Lªí¾÷ ppd ÀɮסA µM«á±N¥L©ñ¸m¨ì /usr/share/cups/model/ ·í¤¤§Y¥i¡I


  • CUPS ¤ä´©ªº³s½u¼Ò¦¡
  • ¦b¤@¯ë¤º³¡°Ï°ìºô¸ô·í¤¤¡A¸û±`¨£ªº¦Lªí¾÷³sµ²¤è¦¡»P¤À¨É¤è¦¡¦³©³¤U³o´XºØ¡G
    • socket
      ¸ê®Æ³z¹L internet socket(°ð¤f)¨Ó¶Ç°e¡A¤@¯ë¬° port 9100 ©Î 35¡C ¦pªG·Q­n¶i¦æ¸ê®Æªº¶Ç¿é»P¦C¦L¡A¥i¥H³z¹L¦bÂsÄý¾¹¤W­±¿é¤J¡G socket://host-printer:9100/ ¨Ó¶i¦æ¡C¤£¹L¡A³oºØ¼Ò¦¡¤£±`¥Î´N¬O¤F¡C

    • LPD (Line Pritner Daemon)
      ´N¬O§Ú­Ì¤§«e´£¨ìªº LPRng ©Ò¤ä´©ªº¥D­n daemon °Õ¡ã¥L¬O¸û¦­ªº¦C¦L¨ó©w°Ú¡A ¥D­n¬O§Q¥Î§Ç¦C°ð¨Ó¹F¦¨¦C¦Lªº»Ý¨D¡A¦Lªí¾÷¦WºÙ´N¬O LPT1/LPT2... µ¥µ¥¡C ¥Ø«eÁÙ¬O¥i¥H¦b¤ñ¸û¦­´Áªº Linux distributions ¬Ý¨ì³oºØ¦C¦L¤è¦¡¡C

    • IPP (Internet Printing Protocol)
      ³o¬O¥Ø«e¤ñ¸û¬y¦æªº¦Lªí¾÷¦C¦L¨ó©w¡A§Ú­Ìªº CUPS ¹w³]¤]¬O¤ä´©³oºØ¨ó©w°Ú¡I ·í±Ò°Ê IPP ®É¡A¦Lªí¾÷·|±Ò°Ê port 631 ¡A¦C¦Lªº¸ê®Æ´N¬O³z¹L³o­Ó port ¨Ó¶i¦æ¶Ç°eªº¡C¥t¥~¡A¦pªG±zªº¦Lªí¾÷©ÎªÌ Linux ¥D¾÷±Ò°Ê¤F ipp ¤§«á¡A ¼K¼K¡I§A¥i¥Hª½±µ¨Ï¥ÎÂsÄý¾¹¡A¿é¤J¡G ipp://printer_IP/printername ´N¯à°÷ª½±µ½u¤W³B²z¦Lªí¾÷ªº³]©w¤F¡I¤è«Kªº«Ü°Ú¡I

    • SMB (Standard Message Block)
      ¤]¦³ºÙ¬° Server Message Block ªº¡A¨º¬O¤°»ò°Ú¡H»¡¬ï¤F¡A¤£´N¬Oºô¸ô¤WªºªÚ¾F¶Ü¡H ¨S¿ù°Õ¡I´N¬O§Q¥ÎºôªÚ´£¨Ñªº¦Lªí¾÷¨Ó¶i¦æ¦C¦Lªº·N«ä¡I ¨ó©w¨Ï¥Îªº¬O¡G smb://user:password@host/printer ¡C
    §Ú­Ì FC4 ¹w³]ªº CUPS ¨Ï¥Îªº´N¬O IPP ³o­Ó¨ó©w»¡¡ã¤]´N¬O»¡¡A§Ú­Ìªº Linux ¦pªG¯à°÷¶¶§Qªº±µ¤W printer ªº¸Ü¡A ¨º»ò¥L´N¬O¤@³¡ºô¸ô¦Lªí¾÷¤F°Õ¡I´N³o»ò²³æ°Ú¡ã¨º»ò§Ú­Ìªº CUPS ¹w³]¥i¥H¤ä´©­þ¨Ç³s±µ¤¶­±©O¡H ¦³©³¤U³o¨Ç°Õ¡G
    • parallel ¡G¥­¦æ§Ç¦C°ð°Ú¡A´N¬O 25 °w¨ººØª±·N¨à¡I¥L¬O³s±µ¨ì /dev/lp[0-2] µ¥¸Ë¸m¡C ¦b CUPS ¸Ì­±ªº¸Ë¸m¨Ï¥Î®æ¦¡¬°¡G parallel:/dev/lp0¡F
    • Network Printer ¡Gºô¸ô¦Lªí¾÷¡A¨Ò¦p HP LaserJet 2300 ´N¤º«Ø¦³ºô¸ô¥d¡A ¤]´N¬O»¡¡A³o­Ó¦Lªí¾÷¬O¨ã¦³ IP ªº¡A¨º»ò¦b CUPS ¤ºªº¨Ï¥Î®æ¦¡¬°¡G ipp://hostname_or_ip/printername¡F
    • USB ¡G¤@¯ë¶V¨Ó¶V±`¨£ªº USB ¦Lªí¾÷°Ú¡I CUPS ¨Ï¥Îªº®æ¦¡¬°¡G usb:/dev/usb/lp0 ¡C

  • ¦b FC4 ¤U±Ò°Ê Printer
  • ¦b FC4 ©³¤U­n±Ò°Ê¦Lªí¾÷ªº¸Ü¡A¬Û·íªºÂ²³æ°Ú¡I¨ä¹ê¥u­n·ÓµÛ­è­è§Ú­Ì¤W­±´£¨ìªº setup «ü¥O¤ºªº printer configuration ªº¨BÆJ¡A¤@¨B¤@¨Bªºµ¹¥L³]©w¤U¥h¡A´N OK ¤F°Õ¡ã¦ý¦pªG§Aªº¨t²Î¨Ã¤£¬O FC4 ªº¸Ü¡A «ç»ò¿ì°Ú¡H¨SÃö«Y¡ã§Ú­Ì¥i¥H¤â°Ê¨Ó«Ø¥ß CUPS ©Ò»Ý­nªº©Ò¦³¸ê®Æ°Ú¡ã §ó¦hªº¸Ô²Ó¸ê°T¥i¥H°Ñ¦Ò cups ®M¥ó´£¨Ñªº documents ©ÎªÌ¬O man page »¡¡ã ( rpm -ql cups ) ¡C

    ¦b©³¤U¡A³¾­ô¥H§Ú­Ì¬ã¨s«Çªº HP LaserJet 2300 ³o¤@³¡¦Lªí¾÷§@¬°¤¶²Ð¡A ³o³¡¦Lªí¾÷¥»¨­¨ã¦³ºô¸ô¥d¡A¥Lªº IP °²©w¬° 192.168.10.119 ¡A ±µ¤U¨Ó¡A´N¶}©l¨Ó³]©w§a¡I

    1. ¤U¸ü¾A¦Xªº ppd ©w¸qÀÉ¡G

      «e©¹ http://www.linuxprinting.org/printer_list.cgi ¿é¤J¦Lªí¾÷ªº«¬¸¹¡A µM«á¦b¥X²{ªºµe­±·í¤¤¡A¿ï¾Ü¡yRecommended driver: Postscript (Home page, custom PPD)¡z ¸Ì­±ªº¨º­Ó¡ycustom PPD¡z¡Aµ¹¥LÂI¤U¥h¡A±N¨º­ÓÀÉ®×®»¨ì /usr/share/cups/model ¸Ì­±¥h´N¹ï¤F¡I ¥H³¾­ôªº±¡ªp¨Ó¬Ý¡A­è­è§Q¥Î§Ú¬d¨ìªººô­¶³sµ²¸ê®Æ¡A¥i¥H³o¼Ë°µ¡G
      [root@linux ~]# cd /usr/share/cups/model
      [root@linux model]# wget http://www.linuxprinting.org/foomatic-db/db/
      source/PPD/HP/mono_laser/hp_LaserJet_2300.ppd
      [root@linux model]# ls -l
      -rw-r--r--  1 root root 55288 Oct 24 00:52 hp_LaserJet_2300.ppd
      
      ³o´N¬Oµ¥¤@¤U§Ú­Ì­n¨Ï¥Îªº¼Ò²Õ¡C½Ðª`·N¡A¦b cups ¨Ï¥Îªº¼Ò²Õ¤W­±¡A ³£¬O³Q©ñ¸m¨ì /usr/share/cups/model ¤º¡I¤£­nÀH«KÂ\©ñ¡ã¦]¬°§Ú­Ì«á­±­n¨Ï¥Îªº«ü¥O¡A ·|¥D°ÊŪ¨ú³o­Ó¥Ø¿ý¤ºªº¥D­n PPD ©w¸qÀÉ°Ú¡I


    2. ½T©w CUPS ¤Î¦Lªí¾÷¤w±Ò°Ê¡G

      ³o­Ó³]©w«Ü²³æ°Ú¡I³o¼Ë°µ´N¹ï¤F¡G
      [root@linux ~]# /etc/init.d/cups start
      [root@linux ~]# netstat -tlunp | grep 631
      tcp  0  0 127.0.0.1:631   0.0.0.0:*   LISTEN   7228/cupsd
      udp  0  0 0.0.0.0:631     0.0.0.0:*            7228/cupsd
      [root@linux ~]# nmap 192.168.10.119
      Starting nmap 3.70 ( http://www.insecure.org/nmap/ ) at 2005-11-11 14:15 CST
      Interesting ports on hp2300 (192.168.10.119):
      (The 1652 ports scanned but not shown below are in state: closed)
      PORT     STATE SERVICE
      21/tcp   open  ftp
      23/tcp   open  telnet
      80/tcp   open  http
      280/tcp  open  http-mgmt
      443/tcp  open  https
      515/tcp  open  printer
      631/tcp  open  ipp
      9100/tcp open  jetdirect
      # ¼K¼K¡I»·ºÝªº Printer ½T¹ê¬O¦³´£¨Ñ 631 ³o­Ó port ªº¡I
      # °²¦p±z¨ã¦³ USB ¦Lªí¾÷ªº¸Ü¡A¨º»òÀ³¸Ó´N­nÅܦ¨³o¼Ë¡G
      
      [root@linux ~]# echo "Testing printer" > /dev/usb/lp0
      # ¦pªG¦Lªí¾÷¦³¸ê®Æ¿é¥X¡A¨º»ò´Nªí¥Ü³s½u¨S¦³°ÝÃD°Ú¡I
      
      ¥Ñ©ó¤£¦Pªº¦Lªí¾÷³s½u¼Ò¦¡·|²£¥Í¤£¤@¼Ëªº´ú¸Õ¤èªk¡A ©Ò¥HÅo¡A¦pªG¬O±µ¦b¥»¾÷¤W­±ªº¡Aª½±µ¨Ï¥Î³Ì²³æªº¸ê®Æ¬y­«¾É¦V´N¥i¥H´ú¸Õ¤F¡I ¦pªG¬Oºô¸ô¦Lªí¾÷¡A¨º´Nª½±µ´ú¸Õºô¸ô³s½u»P¨Ï¥Î nmap ¨Ó¶i¦æ´ú¸Õ°Õ¡ã ¨º­Ó nmap §Ú­Ì·|¦b¦øªA¾¹½g¦b¦n¦nªº½Í¡ã²{¦b¥u­nª¾¹D¥L¥i¥H¥Î¨Ó°»´ú¬Y³¡¥D¾÷ªº¶}±Òªº port¡A ºâ¬O¤@­Ó²³æªºÀb«È³nÅé¡ã©Ò¥H¡A¤£­n®³ nmap ¨Ó°»´ú§O¤Hªº¥D¾÷¡I·|¦³¥qªk°ÝÃD³á¡I


    3. ¶}©l¥[¤J¦Lªí¾÷¨ì CUPS ·í¤¤¡G

      ­n¥[¤J¦Lªí¾÷Åý CUPS ¨ÓºÞ²z¡A¥i¥H¨Ï¥Î­è­è´£¨ìªº setup ¡A¤£¹L¡A³o­Ó¤u¨ã¦ü¥GµLªk¥[¤Jºô¸ô¦Lªí¾÷ªº¼Ë¤l¡I ©Ò¥H¡A¦pªG¹³³¾­ô³oºØºô¸ô¦Lªí¾÷ªº¸Ü¡A¥i¯à´N¤£¥i¥H¨Ï¥Î setup °Õ¡ã³o­Ó®É­Ô¡A´N¨Ï¥Î¨º­Ó¦n¥Îªº lpadmin ¨Ó¶i¦æºÞ²zÅo¡I
      1. ¥[¤J¦Lªí¾÷¨ì CUPS ·í¤¤¡G
      [root@linux ~]# lpadmin -p [pritner¦î¦C] -v [¸Ë¸m¥N¸¹] -m [model] -E
      °Ñ¼Æ¡G
      -p  ¡G«á­±±µ¦Lªí¾÷ªº¦WºÙ¡Aª`·N¡A³o­Ó¦WºÙ¬O§A¦Û­qªº¡A¥i¥HÀH«K¨ú¤@­Ó§A°O±o¦íªº¦W¦r
      -v  ¡G«á­±±µªº¬O¸Ë¸m¥N¸¹¡A¥i¥H¬O¥»¾÷ªº§Ç¦C°ð©ÎªÌ¬O USB ¡A·íµM¤]¥i¥H¬Oºô¸ô¦Lªí¾÷
            §Ç¦C°ð    ¡G   parallel:/dev/lp0
            USB       ¡G   usb:/dev/usb/lp0
            ºô¸ô¦Lªí¾÷¡G   ipp://192.168.10.119/
      -m  ¡G´N¬O­è­è´£¨ìªº¨º­Ó ppd ©w¸qÀÉ¡C³o­ÓÀÉ®×¥²¶·­n³Q©ñ¸m¨ì
            /usr/share/cups/model ·í¤¤¡AµM«á¥H¸Ó¥Ø¿ý§@¬°¬Û¹ï¸ô®|¨Ó®Ñ¼gÀɦW³á¡I
      -E  ¡G§@¬°±µ¨ü (enable) ¦C¦L¤u§@ªº·N«ä
      
      2. ³]©w¹w³]©Î§R°£¦Lªí¾÷
      [root@linux ~]# lpadmin [-xd] [printer¦î¦C]
      °Ñ¼Æ¡G
      ª`·N¡A -x »P -d ¤£¯à¦P®É¨Ï¥Î¡A¥t¥~¡A printer¦î¦C ¥²¶·¬O¤w¦s¦bªº¦Lªí¾÷¦WºÙ
      -x  ¡G§R°£¤@­Ó¦b CUPS ºÞ²zªº¦Lªí¾÷
      -d  ¡G­Y¦³¦h³¡¦Lªí¾÷¦s¦b CUPS ·í¤¤¡A¨Ï¥Î -d ¥i¥H«ü©w¤@³¡¹w³]ªº¦Lªí¾÷¡C
            «h·í§Ú­Ì¦b¦C¦L®É¡A§Ñ°O¿ï¾Ü¦Lªí¾÷«¬¦¡¡A«h¥H¦¹³¡¹w³]¦Lªí¾÷¨Ó¦C¦L¡C
      
      ½d¨Ò¤@¡G¦b¥»¨Ò¤¤¡A¥[¤J¤@³¡ºô¸ô¦Lªí¾÷¡A§Úªº¦Lªí¾÷¦î¦C¶ñ¤J laserjet2300
      [root@linux ~]# lpadmin -p laserjet2300 -v \
      > ipp://192.168.10.119/ -m hp_LaserJet_2300.ppd -E
      # ¨º­Ó laserjet2300 ¬O¦Û¤v³]©wªº¡A«ç»ò³]©w³£¨SÃö«Y°Õ¡I
      # ¦Ü©ó hp_LaserJet_2300.ppd «h¬O§Ú­Ì­è­è¥Ñºô¯¸¤U¸üªºÀɮסA
      # ª`·N¡A¤@©w­n©ñ¦b /usr/share/cups/model/ ¥Ø¿ý·í¤¤³á¡Iª`·Nª`·N¡I
      
      ½d¨Ò¤G¡G¥[¤J¤@­Ó usb ªº¦Lªí¾÷³á¡I
      [root@linux ~]# lpadmin -p laserjet2300 -v \
      > /dev/usb/lp0 -m hp_LaserJet_2300.ppd -E
      
      ½d¨Ò¤T¡GÅý laserjet2300 ³o³¡¦Lªí¾÷¦¨¬°¹w³]¦Lªí¾÷¡I
      [root@linux ~]# lpadmin -d laserjet2300 
      
      ½d¨Ò¥|¡G§R°£ laserjet2300 ³o³¡¦Lªí¾÷¡G
      [root@linux ~]# lpadmin -x laserjet2300 
      
      ¨ä¹ê­è­è³o­Ó lpadmin ªº°Ê§@¡A¥u¬O¦b§ó·s /etc/cups/ ¥Ø¿ý¸Ì­±ªº¨â­Ó¸ê®Æ¦Ó¤w¡A ¤@­Ó¬O /etc/cups/printers.conf ¡A³o­ÓÀÉ®×¥D­n¬O³W½d¤F¦Lªí¾÷ªº¬ÛÃö¸Ë¸m¡B¬O§_±µ¨ü¦C¦L¤u§@¡B ¦Lªí¾÷ªº¦î¦C¦WºÙ¡B­¶­±ªº­­¨îµ¥µ¥¡A¤Ï¥¿´N¬O¾ã­Ó¦Lªí¾÷ªº³W½d´N¬O¤F¡C ¦Ü©ó³o­Ó¦Lªí¾÷¬ÛÃöªº PPD Àɮ׫h¬O¥H¦Lªí¾÷ªº¦î¦C¦WºÙ³sµ²¨ì /etc/cups/ppd/ ¥Ø¿ý¤U¡A ¥H¤Wªíªº½d¨Ò¤@¤¤¡A§Ú­Ì©w¸q¥X laserjet2300 ³o­Ó¦î¦C¡A¨Ï¥Îªº¬O hp_LaserJet_2300.ppd ³o­Ó©w¸qÀÉ¡A«h§A·|µo²{¡A /etc/cups/ppd/laserjet2300 »P /usr/share/cups/model/hp_LaserJet_2300.ppd ¬O¬Û¦Pªº³á¡I¦]¬°¥u¬O­n§@¬°¤@­Ó¦î¦C¦Lªí¾÷ªº¹ïÀ³¤§¥Î¹À¡I
      [root@linux ~]# cat /etc/cups/printers.conf
      # Printer configuration file for CUPS v1.1.22rc1
      # Written by cupsd on Fri 11 Nov 2005 02:40:01 PM CST
      <DefaultPrinter laserjet2300>
      Info laserjet2300
      DeviceURI ipp://192.168.10.119/
      State Idle
      Accepting Yes
      JobSheets none none
      QuotaPeriod 0
      PageLimit 0
      KLimit 0
      </Printer>
      # ¬Ý¨ì§_¡H­è­è§Ú­Ì¨Ï¥Î lpadmin ¡A¼W¥[ªº¸ê°T³£¦b³o¸Ì°Ú¡I
      # ­«ÂI¨ä¹ê¬O¨º­Ó DeviceURI ¤Î Info ³o¨â­Óª±·N¨à°Õ¡I­«­nªº«Ü¡I
      


    4. ¶}©l¦C¦L´ú¸Õ

      §Ú­Ì¥i¥H¨Ï¥Î lp ©ÎªÌ¬O lpr ¨Ó¶i¦æ¦C¦Lªº¤u§@¡ã¸Õ¬Ý¬Ý¥ý¡I
      [root@linux ~]# lpr [-E] -P [printer¦î¦C] -# [¦C¦L¥÷¼Æ] -U [username] file
      °Ñ¼Æ¡G
      -E  ¡G¬O§_¥[±Kªº·N«ä¡ã¤@¯ë¤£»Ý­n³o­Ó°Ñ¼Æ¡F
      -P  ¡G¦pªG§A¦³¨â³¡¥H¤Wªº¦Lªí¾÷¡A·Q­n¦b¤£¦Pªº¦Lªí¾÷¤W­±¦C¦L¡A
            ´N»Ý­n¨Ï¥Î -P ¨Ó¿ï¾Ü°Ú¡I
      -#  ¡G¦pªG§A­n¤@¦¸¦C¦L¦h¥÷¤å¥ó¡A¥Î³o­Ó -# ¥[¤W¥÷¼Æ´N¹ï¤F¡I
      -U  ¡G¦³¨Ç¦Lªí¾÷¦³­­¦Ü¨Ï¥ÎªÌ¡A¦¹®É´N±o­n¨Ï¥Î³o­Ó°Ñ¼Æ¡F
      ½d¨Ò¡G
      
      ½d¨Ò¤@¡G
      [root@linux ~]# lpr -P laserjet2300 /etc/passwd
      
      ¯à¤£¯à¦C¦L°£¤F cups ªº³]©w¤§¥~¡A¦Lªí¾÷¬O§_¦³³]©w¨¾¤õÀð¤]¬O¦³Ãö«Yªº³á¡I ³¾­ô³Ìªñ¤@¦¸¦b¶i¦æ´ú¸Õ®É¡A¤£ª¾¹D¬°¤F¤°»ò¡A¦Lªí¾÷¬ðµMµLªk±µ¨ü§Ú Linux ºÝªº«Ê¥]­n¨D¡A ³¾­ô´Nµ¹ Printer ¾ã­Ó­«·s¶}¾÷¡A«x¡I¬ðµM¤S¦n¤F¡ã ¥i¯à¬O....¦Lªí¾÷¤]»Ý­n¥ð®§§a¡H¡H @_@

      [root@linux ~]# lp -d [printer¦î¦C] -n [¦C¦L¥÷¼Æ] file
      °Ñ¼Æ¡G
      -d  ¡G«á­±±µªº¬O¦Lªí¾÷ªº¦î¦C¦WºÙ¡C¦pªG¦³¦h³¡¦Lªí¾÷¤~»Ý­n«ü©w¡F
      -n  ¡G´N¬O¦C¦Lªº¥÷¼Æ°Ú¡I
      ½d¨Ò¡G
      
      ½d¨Ò¤@¡G¦C¦L¥X 2 ¥÷ /etc/issue ¸ê®Æ
      [root@linux ~]# lp -d laserjet2300 -n 2 /etc/issue
      
      ¦pªG·Q­nÁA¸Ñ¾ã­Ó¦C¦Lªº¸ê°T¡A»P¾ã­Ó¦Lªí¾÷ªºª¬ºA¡A¥i¥H¨Ï¥Î©³¤Uªº«ü¥O°Ú¡ã
      1. ÁA¸Ñ¦Lªí¾÷ªº¥Ø«eª¬ºA
      [root@linux ~]# lpstat [-adprt]
      °Ñ¼Æ¡G
      -a  ¡G¦C¥X¥Ø«e¥i¥H±µ¨ü¦C¦L¤u§@ªº¦Lªí¾÷¦î¦C¦WºÙ¡F
      -d  ¡G¦C¥X¥Ø«e¨t²Îªº¹w³]¦Lªí¾÷¡F
      -p  ¡G¦C¥X¨C³¡¦Lªí¾÷ªº±µ¨ü¤u§@ªºª¬ºA¡A¥]§t¤u§@ªº ID¡F
      -r  ¡G¦C¥X¥Ø«e CUPS ¬O§_¦³¦b¹B§@¡H
      -t  ¡G¦C¥X¸û¬°¸Ô²Óªº¦Lªí¾÷¸ê°T°Ú¡I
      ½d¨Ò¡G
      
      ½d¨Ò¤@¡G¥Ø«eªº¹w³]¦Lªí¾÷¡A»P¨t²Î¤W­±¥i¥H±µ¨ü¦C¦Lªº¦Lªí¾÷¬°¡G
      [root@linux ~]# lpstat -a
      laserjet2300 accepting requests since Jan 01 00:00
      [root@linux ~]# lpstat -d
      system default destination: laserjet2300
      
      ½d¨Ò¤G¡G¦C¥X¥Ø«e¨t²Î¤W­±©Ò¦³»P¦Lªí¾÷¦³Ãöªº¸ê°T¡H
      [root@linux ~]# lpstat -t
      scheduler is running
      system default destination: laserjet2300
      device for laserjet2300: ipp://192.168.10.119/
      laserjet2300 accepting requests since Jan 01 00:00
      printer laserjet2300 is idle.  enabled since Jan 01 00:00
              Print file accepted - job ID 3.
      
      
      2. ¦C¦L¤u§@ªºÆ[¹î
      [root@linux ~]# lpq [-al]
      °Ñ¼Æ¡G
      -a  ¡G¦C¥X©Ò¦³¦Lªí¾÷¤W­±¦b¦î¦C·í¤¤ªº¤u§@±¡ªp¡F
      -l  ¡G¥Î¨ä¥L¸ûªø®æ¦¡¨Ó¿é¥X¦C¦Lªº¬ÛÃö¸ê°T (¾Ö¦³ªÌ»PÀɮפj¤pµ¥µ¥)
      ½d¨Ò¡G
      
      ½d¨Ò¤T¡GÅã¥Ü¥X¥Ø«e©Ò¦³¦Lªí¾÷ªº¤u§@¦î¦Cª¬ªp
      [root@linux ~]# lpq -a
      Rank    Owner   Job     File(s)                         Total Size
      1st     root    3       passwd                          4096 bytes
      # ¤W­±ªº·N«ä¬O¡A¦³¤@¥÷¤u§@¡A¸Ó¤u§@¬O¦C¦L¥X passwd ¨º­ÓÀɮסA
      # ³o­Ó¤u§@ªº¸¹½X¬O 3 ¸¹  (Job) ¡A¸Ó¤u§@ªº«Ø¥ßªÌ¬° root ¡C
      # ³o¬O­Ó«Ü­«­nªº¦a¤è¡A¦]¬°¸Ó¶µ¥Ø¶È¦³ root ¥i¥H±±¨î¡ã
      # ¤@¯ë¨­¥÷¨Ï¥ÎªÌ¡A·íµM¤£¯à§R°£¸Ó¶µ¤u§@°Õ¡I
      
      
      3. §R°£¦b¦î¦C·í¤¤ªº¦C¦L¤u§@
      [root@linux ~]# lprm -P [printer¦î¦C] job_id
      °Ñ¼Æ¡G
      -P  ¡G«á­±ª½±µ«ü©w¬Y³¡¦Lªí¾÷ªº¬Y­Ó¤u§@¸¹½X¡Cª`·N¡A¨º­Ó job_id
            ´N¬O­è­è§Ú­Ì¨Ï¥Î lpq ¬d¬Ý¨ìªº¨º­Ó Job ªº¸¹½X°Õ¡I
      
      ½d¨Ò¥|¡G±N­è­èªº¬Ý¨ìªº¨º­Ó job 3 ¤u§@§R°£¡I
      [root@linux ~]# lprm 3
      [root@linux ~]# lpq -a
      no entries
      # Á@¡I·íµM¤£¨£¥h°Õ¡I¦]¬°¤u§@³Q§Ú§R°£¤F¹À¡I
      
      4. ¥H cancel §R°£¦b¦î¦C·í¤¤ªº¦C¦L¤u§@
      [root@linux ~]# cancel [-a] job_id
      °Ñ¼Æ¡G
      -a  ¡G¤£½×¦î¦C¸Ì­±¦³¦h¤Öµ¥«Ý¦C¦Lªº¤u§@¡A¥þ³¡²¾°£¡I
      [root@linux ~]# cancel 3
      [root@linux ~]# cancel -a
      
      ¨ä¹ê¡A¾ã­Ó Linux ¥»¾÷¤W­±ªº¦C¦L¸ê°T¡A¨ì³o­Ó®É­Ô´N¤w¸g§¹¦¨°Õ¡I ¤£¹L¡A¦pªG§AÁÙ·Q­n§@ÃB¥~ªº±±¨î¡A©ÎªÌ¬O·Q­n¶i¦æºô¸ô¤À¨É³o³¡¦Lªí¾÷®É¡A¼K¼K¡I ÁÙ±oÃB¥~ªº¥[¤u¡A§@¤@¨Ç¤â¸}¤~¦æ³á¡I©³¤U´N§i¶D§A«ç»ò§@§a¡I


    5. Åv­­±±¨î (¦C¦L¤À¨É°Õ¡I)

      §Ú­Ì«e­±´£¨ìªº´X­Ó«ü¥O³£¥i¥Hª½±µ¦b CUPS ¤W­±±N¦C¦Lªº¤u§@¦C¦L¥X¨Ó¡ã ¤£¹L¡A¦³ªº®É­Ô§Ú­Ì¥Ñ©ó¦b¶i¦æ¦Lªí¾÷ºûÅ@ªº§@·~¡A¥i¯à¼È®É¤£¤¹³\¤H®a¨Ï¥Î§Ú­Ìªº¦Lªí¾÷¡A ¤S¤£·QÅý¤H®aµo²{¦Lªí¾÷¥Ø«e¦³°ÝÃD¡ã«ç»ò¿ì¡H¨þ¨þ¡I³o­Ó´N»P disable ³o­Ó«ü¥O¦³Ãö°Õ¡I
      1. ¼È®ÉÃö³¬/±Ò°Ê¦Lªí¾÷¬O§_¶}©l¦C¦L(¦ý¤@©w³£¥i¥H±µ¨ü¤u§@¨ì¦î¦C)
      [root@linux ~]# /usr/bin/disable [-c] [printer¦î¦C]
      [root@linux ~]# /usr/bin/enable [printer¦î¦C]
      °Ñ¼Æ¡G
      -c  ¡G±N«á­±±µªº¨º­Ó¦Lªí¾÷¦î¦C©Òµ¥«Ýªº¤u§@¡A¥þ³¡³£§R°£¡C¤@¯ë¤£·|¥[¤W³o­Ó°Ñ¼Æ¡I
      disable = cupsdisable
      enable  = cupsenable
      ½d¨Ò¡G
      
      ½d¨Ò¤@¡G¼È®É¨ú®ø­è­è«Ø¥ßªº laserjet2300 ³o³¡¦Lªí¾÷ªº¦C¦L¤u§@
      [root@linux ~]# disable laserjet2300
      [root@linux ~]# lpstat -t
      scheduler is running
      system default destination: laserjet2300
      device for laserjet2300: ipp://192.168.10.119/
      laserjet2300 accepting requests since Jan 01 00:00
      printer laserjet2300 disabled since Jan 01 00:00 -
              Paused
      # µo²{§_¡H¥Ø«eªº¤u§@¬O¼È°±ªº¡I¤£¹L¡A scheduler ¨Ì¬O¦b¶i¦æ¡I
      # ©Ò¥H¡A·íµMÁÙ¥i¥HÄ~Äò±µ¨ü¦î¦Cªº»Ý¨D³á¡IÅý§Ú­Ì¨Ó´ú¸Õ¬Ý¬Ý¡I
      
      [root@linux ~]# lpr /etc/passwd
      [root@linux ~]# lpq
      laserjet2300 is not ready
      Rank    Owner   Job     File(s)                         Total Size
      1st     root    5       passwd                          4096 bytes
      # ¼K¼K¼K¼K¡I¬O not ready ¡ãÁÙ¨S¦³·Ç³Æ¦n¹À¡I
      [root@linux ~]# cancel 5
      
      ½d¨Ò¤G¡G¶}©l­«·sÅý laserjet2300 ¥i¥H¶}©l¦C¦L°Ú¡I
      [root@linux ~]# /usr/bin/enable laserjet2300
      [root@linux ~]# lpstat -t
      scheduler is running
      system default destination: laserjet2300
      device for laserjet2300: ipp://192.168.10.119/
      laserjet2300 accepting requests since Jan 01 00:00
      printer laserjet2300 is idle.  enabled since Jan 01 00:00
      # ª`·N¤@¤U¡A¦]¬° bash ¥»¨­´N§t¦³¤@­Ó enable ªº¤º³¡«ü¥O¡A
      # ©Ò¥H¡A«Øij±z¿é¤Jµ´¹ï¸ô®|¨Ó°õ¦æ enable ¡A©ÎªÌª½±µ§ï¥H cupsenable ¨Ó°õ¦æ¡I
      
      ³o­Ó cupsdisable »P cupsenable ¥i¥H¤ä´©ÅýºÞ²z­û¾Ö¦³¤@¬q¦Lªí¾÷ºûÅ@ªº®É¶¡¡A ¦P®É¤SÁÙ¥i¥HÄ~Äò±µ¨ü¨Ó¦Û¨Ï¥ÎªÌªº¦C¦L»Ý¨D¡A¯u¬O¤£¿ù°Ú¡I¤£¹L¡A ¸U¤@§Ú´N¬O©ú½Tªº¤£­n±µ¨ü¨Ó¦Û¨Ï¥ÎªÌªº¦C¦L¤u§@©O¡H¤]´N¬O»¡¡A§Ú³sµ¥«Ýªº¤u§@³£¤£¶}©ñ¡A ¥u­n¦³¦C¦L¤u§@»Ý¨D®É¡A´N¦^³ø¡y¤£¯à¨Ï¥Î¡z¡C¨þ¨þ¡I´N¬O accept/reject ªº¤u§@°Õ¡I
      2. ¼È®É°±¤î/¶}±Ò¦Lªí¾÷¦î¦Cªº¥\¯à
      [root@linux ~]# reject [printer¦î¦C]
      [root@linux ~]# accept [printer¦î¦C]
      
      ½d¨Ò¤@¡G¼È®ÉÃö³¬ laserjet2300 §a¡I
      [root@linux ~]# reject laserjet2300
      [root@linux ~]# lpstat -t
      scheduler is running
      system default destination: laserjet2300
      device for laserjet2300: ipp://192.168.10.119/
      laserjet2300 not accepting requests since Jan 01 00:00 -
              Rejecting Jobs
      printer laserjet2300 is idle.  enabled since Jan 01 00:00
              Rejecting Jobs
      
      [root@linux ~]# lp /etc/passwd
      lp: unable to print file: server-error-not-accepting-jobs
      # ÁA¸Ñ¤F¶Ü¡H¦p¦¹¤@¨Ó¡A³s¤u§@¶i¤J¦C¦Lµ¥«Ý³£¤£¦æ³á¡I
      
      ½d¨Ò¤G¡G±Ò°Ê laserjet2300 §a¡I
      [root@linux ~]# accept laserjet2300
      
      «Ü¦nª±§a¡I³z¹L³o¥|­Ó¤pªF¦è¡A§Ú­Ì´N¥i¥H¾Ö¦³¤@¬qºÞ²zºûÅ@¦Lªí¾÷ªº®É¶¡°Õ¡ã ^_^

    ³z¹L³o¨Ç²³æªº«ü¥O¡AÁÙ¦³¤@¨Ç²³æªº½s¿è°Ê§@¡A±zªº¦Lªí¾÷´N¥i¥H¦b Linux ¤WÀY¶¶§Qªº¹B§@¤F©O¡I ¦Ó¥BÁÙ¥i¥H¤ä´©¦h³¡¦Lªí¾÷¦P®É¦s¦b¡A¯u¬O¦n¤è«K°Ú¡I^_^


  • ¤@­Ó²³æªº½m²ß
  • °²³]§A¥Ø«eªº FC4 ¥D¾÷¤W­±±µµÛ¤@¥x USB ¤¶­±ªº¦Lªí¾÷¡A §Aªº¨t²Î¨Ã¤£¤¹³\¨Ï¥Î setup ªº Printer configuration ³]©w¡A ³o¥x USB ¤¶­±ªº¦Lªí¾÷¬O Samsung ªº ML-1210 ¦Lªí¾÷¡A ½Ð°Ý¡A±z¥i¥H¦p¦ó¦b FC4 ¤W­±¦w¸Ë³o³¡¦Lªí¾÷¡H
    • ¥ý¤U¸ü PPD ©w¸qÀÉ¡AÀɦW¬°¡G Samsung-ML-1210-gdi.ppd ¨ì /usr/share/cups/model/ ·í¤¤¡F
    • ¥[¤J¦Lªí¾÷¡A¨Ï¥Î¤U¦C¤èªk¡G
      [root@linux ~]# lpadmin -p samsung -v usb:/dev/usb/lp0 \
      > -m Samsung-ML-1210-gdi.ppd -E
      
    • ¶}©lµ¹¥L´ú¸Õ½m²ß¤@¤U¡G¡y lp /etc/passwd ¡z¦pªG¦³ªF¦è¦L¥X¨Ó¡A¨º´N¬O OK °Õ¡I
    Tips:
    ¨Æ¹ê¤W¡A¨Ã¤£¬O©Ò¦³ªº¦Lªí¾÷¼t°Ó³£¦³°w¹ï Linux §@·~¨t²ÎÄÀ¥X¬ÛÃöªºÅX°Êµ{¦¡¡A ©Ò¥H¡A¦pªG±z·Q­nÁʶR¯à°÷Åý Linux ¨Ï¥Îªº¦Lªí¾÷®É¡AÁÙ¬O«Øij±z¥ý«e©¹¤W­±´£¨ìªº http://www.linuxprinting.org/printer_list.cgi ³o­Óºô­¶¶i¦æ¬d¸ß¡ã ¤ñ¦p¡A HP µ¥¤j¼tªº¦Lªí¾÷¹ï©ó Linux ªº¤ä´©«×´N«Ü¤£¿ù¡ã¦Ó¦pªG±z¦³Âªº¦Lªí¾÷¡A ¨Ò¦p³¾­ôªº Lexmark X6150 ³o³¡¾÷¾¹¡A¨þ¨þ¡ã¨º´N¤£­n·Q¤Ó¦h¤F¡ã¦w¸Ë¤W­±¡A¹ê¦b«Ü³Â·Ð¡ã @_@ ¦ý³o¨Ã¤£¬O Linux ªº°ÝÃD¡A±z¥i¥Hµo°_¤@¤H¤@«H¡A±H«Hµ¹¦Lªí¾÷¶}µo°Ó¡AÅý¥L­Ì­«µø Linux ¨Ï¥ÎªÌ¸s§a¡I
    ³¾­ôªº¹Ï¥Ü
    ¥t¥~¡A¦pªG¦Ñ¬O¬Ý¨ì¿Ã¹õ«e­±Åã¥Ü¡G¡y Printer not connected; will retry in 30 seconds...¡z¡A «Ü¦³¥i¯à¬O¦]¬°§Ú­Ìªº¸Ë¸m¥N¸¹¿é¤J¿ù»~¡A½Ð¨Ï¥Î¡y lpstat -t ¡z¬d¾\¤@¤U¬O§_¥¿½Tªº³]©w¦n¤F¡H °ò¥»¤W¡A¦w¸Ë¤@³¡ Linux ¦³¤ä´©ªº¦Lªí¾÷¡A¯uªº¬O§Ö³t°Õ¡I


  • §Q¥Î web ¤¶­±ºÞ²z CUPS ¦Lªí¾÷
  • °£¤F¨Ï¥Î¤â°Êªº¤è¦¡¼W¥[¦Lªí¾÷¤§¥~¡A¨ä¹ê¡A§Ú­ÌÁÙ¥i¥H³z¹L web ¤¶­±¨ÓºÞ²z³o³¡¦Lªí¾÷³á¡I ¨ä¹ê¬OºÞ²z CUPS ³o­Ó daemon °Õ¡I¦pªG±z¬O¦b Linux ¥»¾÷«e­±¨Ï¥Î X Window ªº¸Ü¡A ¨º»ò¤°»ò³£¤£¥²·Q¡Aª½±µ¦b X Window ·í¤¤ªºÂsÄý¾¹¿é¤J¡y http://localhost:631 ¡z ´N¥i¥H¶i¤JºÞ²zµe­±¤F¡C¦pªG¹³³¾­ô¤@¼Ë¡A§Úªº Linux ¥D¾÷³£¬O¤£¶} X Window ªº¡A ¨º´N±o­n§@¤@¨Ç¤â¸}°Õ¡I

    ­º¥ý¡A§Ú­Ì¥²¶·­nÅý CUPS ±µ¨ü¨Ó¦Û¤º³¡ºô¬qªº Client ºÝºÞ²z¡A°²³]§Úªº¤º³¡ºô¬q¬O 192.168.1.0/24 ¡A¨º»ò§Ú´N±o­n³o¼Ë°µ¡G
    1. ­×§ï /etc/cups/cupsd.conf ªºÅv­­±±¨î
    [root@linux ~]# vi /etc/cups/cupsd.conf
    # §ä¨ì©³¤Uªº¦r²´¡A·s¼W¯S®í¦rÅ骺³¡¤À¡I
    Port 631 <==½T©w¤@¤U¡A¤j¬ù¦b 434 ¦æ¥ª¥k¡A·|¦³³o­Ó¬q¸¨
    
    <Location />         <==³o­Ó¤j¬ù¦b 773 ¦æ¥ª¥k
    Order Deny,Allow
    Deny From All
    Allow From 127.0.0.1
    Allow From 192.168.1.0/24 <==¥[¤J³o¤@¦æ§a¡I
    </Location>
    
    <Location /admin>  <==³o­Ó¤j¬ù¬O¦b 831 ¦æ¥ª¥k¡C
    AuthType Digest   <==§â³o¸Ì§@­Ó­×§ï¡I
    AuthClass System
    Order Deny,Allow
    Deny From All
    Allow From 127.0.0.1
    Allow From 192.168.1.0/24  <==¥[¤J³o¤@¦æ§a¡I
    </Location>
    
    # ¦pªG§A´¿¸g¨Ï¥Î seutp ¤ºªº Printer configuration ³]©w¹L¦Lªí¾÷ªº¸Ü¡A
    # ¨ºÀ³¸Ó·|¬Ý¨ì©³¤U³o¨Ç¦r²´¡Aª`·N¡A±N³o¨Ç¸ê®Æ³q³q§R°£¡I
    <Location /printers/lexmark>
    Order Deny,Allow
    Deny From All
    Allow From 127.0.0.1
    AuthType None
    </Location>
    # Lines below are automatically generated - DO NOT EDIT
    Browsing On
    BrowseProtocols cups
    BrowseOrder Deny,Allow
    BrowseAllow from @LOCAL
    Listen 127.0.0.1:631
    # ¨Ò¦p¤W­±³o 13 ¦æ¦r¡A¥þ³¡³q³q§R°£§a¡I§_«h·|³y¦¨°ÝÃD¡I
    
    
    2. ­«·s±Ò°Ê cups §a¡I
    [root@linux ~]# /etc/init.d/cups restart
    
    [root@linux ~]# netstat -tlnp
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address  Foreign Address State  PID/Program name
    tcp        0      0 0.0.0.0:631    0.0.0.0:*       LISTEN 28018/cupsd
    # ª`·N°Ú¡I±z¶}±ÒªººÊÅ¥ºô°ì¡A¥²¶·­n¬O 0.0.0.0 ¤~¹ï¡A¦pªG¥X²{ 127.0.0.1 ¡A
    # ¨º´Nªí¥Ü±zªº cupsd.conf ³]©w¿ù»~°Õ¡I
    
    
    3. ³]©wºÞ²z¦Lªí¾÷ªººÞ²z­û±b¸¹±K½X
    [root@linux ~]# lppasswd [-a] [-x] [username]
    °Ñ¼Æ¡G
    -a  ¡G·s¼W¤@­ÓºÞ²z¦Lªí¾÷ªº±b¸¹
    -x  ¡G§R°£¸Ó±b¸¹
    ª`·N¡A¸Ó±b¸¹¬O§Ú­Ì¥i¥HÀH·N¨úªº¡A¤£¤@©w­n¦b /etc/passwd ¸Ì­±¡I
    
    [root@linux ~]# lppasswd -a printermaster
    Enter password:
    Enter password again:
    
    [root@linux ~]# cat /etc/cups/passwd.md5
    printermaster:sys:a22ad518d345467ae72d3eb2cf4cdcc1
    # ³o´N¬O§Ú­Ì§Q¥Î lppasswd «Ø¥ß°_¨Óªº±K½X¸ê®Æ°Ú¡I
    
    ±µ¤U¨Ó©O¡H¨þ¨þ¡Iª½±µ¨ì°Ï°ì¤ºªº¥ô¦ó¤@³¡¹q¸£¤W­±¡A±Ò°ÊÂsÄý¾¹¡Aª½±µ¿é¤J¡G¡y http://192.168.1.2:631 ¡z°²©w§Úªº Linux ¥D¾÷¬° 192.168.1.2 ¡A¨º´N·|¬Ý¨ì¦p¤Uµe­±¡G

    §Q¥Î CUPS ªº Web ¤¶­±ºÞ²z¦Lªí¾÷
    ¹Ï¡B§Q¥Î CUPS ªº Web ¤¶­±ºÞ²z¦Lªí¾÷

    ¦@¦³¤»¤j¿ï¶µ¡A§Ú­Ì¤ñ¸û¸g±`¨Ï¥ÎªºÀ³¸Ó¬O Printers ¥H¤Î Administration ³o¨â¶µ¦Ó¤w¡C ¦b«ö¤U¤F Printer ¶µ¥Ø¤§«á¡A´N·|¥X²{¦p¤Uªºµe­±¡G

    §Q¥Î CUPS ªº Web ¤¶­±ºÞ²z¦Lªí¾÷
    ¹Ï¡B§Q¥Î CUPS ªº Web ¤¶­±ºÞ²z¦Lªí¾÷

    ¬Ý¨ì¤F¶Ü¡H­è­è§Ú­Ì³]©w¦¨¥\ªº¦Lªí¾÷¤w¸g¦b¤WÀY°Õ¡I ¦Ó¥BÁÙ¥i¥H¬Ý¨ì¦U³¡¤À¸Ô²Óªº¸ê®Æ¡A«Ü¤£¿ù§a¡I¦pªG·Q­n¶i¦æ¤@¨ÇÃB¥~ªº°Ñ¼Æ³]©w¡A ¨Ò¦p«ö¤U¤W¹Ï·í¤¤¡A¥ª¤U¨¤ªº Add Printer ¡A´N·|¥X²{¦p¤Uªº»{ÃÒµøµ¡¡G

    §Q¥Î CUPS ªº Web ¤¶­±ºÞ²z¦Lªí¾÷
    ¹Ï¡B§Q¥Î CUPS ªº Web ¤¶­±ºÞ²z¦Lªí¾÷

    ¿é¤J­è­è§Ú­Ì¤~¥H lppasswd «Ø¥ßªº±b¸¹»P±K½X¡A¨º»ò¥ß¨è´N·|¥X²{¦p¤Uªºµe­±¤F¡G

    §Q¥Î CUPS ªº Web ¤¶­±ºÞ²z¦Lªí¾÷
    ¹Ï¡B§Q¥Î CUPS ªº Web ¤¶­±ºÞ²z¦Lªí¾÷

    ¤W¹Ïªºµe­±¨ä¹ê»P setup ¸Ì­±ªº·s¼W¦Lªí¾÷¹Lµ{®t¤£¦h¡A ¥u¬O¤W­±ªºµe­±¬O¥H¹Ï§Î¤¶­±Åã¥Ü¥X¨Óªº¦Ó¤w°Ú¡I ^_^¡C§ó¦hªº¨Ï¥Î¤è¦¡¡A ´N¦³«Ý±z¦Û¤v¥hµo±¸Åo¡I ^_^

    ¥t¥~¡A¦pªG§A¦Ñ¬O¸Õ¤£¥X¨Ó»{ÃÒªº¸Ü¡A¨º»ò°®¯Ü§â /etc/cups/cupsd.conf ¸Ì­±ªº¡yAuthType »P AuthClass¡z ³o¨â­Ó°Ñ¼ÆÃö±¼¡A¦p¦¹¤@¨Ó¡A´N¤£·|­n¨D§A¿é¤J±b¸¹±K½X¡A·|ª½±µÅý±z¶i¤J¦Lªí¾÷ºÞ²z­ûªººÞ²z¤¶­±³á¡I

    ¤j¼ÐÃDªº¹Ï¥Ü¯S®íªº filesystem¡G LVM
    ¦b²Ä¤G½gªº¤º®e¸Ì­±¡A§Ú­Ì¥D­n½Í¨ì¤FºÏºÐÀɮרt²Î¡A¤]¾å±o¤F¡A¦pªG¦b¦w¸Ëªì´Á¡A ¨S¦³°µ¦n¾ã­ÓµwºÐªº³W¹º®É¡A¨º»ò¥¼¨Ó­n·s¼WºÏºÐªÅ¶¡¡A·|«Ü³Â·Ð¡ã¡ã¤£¹L¡A³o­Ó°ÝÃD¦b LVM ­±«e¡A ¦ü¥G¼vÅT´N¤£¤j¤F¡I¬°¤°»ò©O¡H¦]¬° LVM ¥i¥H¾ã¦X¦h­Ó¹êÅé partition ¦b¤@°_¡A Åý³o¨Ç partitions ¬Ý°_¨Ó´N¹³¬O¤@­ÓºÏºÐ¤@¼Ë¡I¦Ó¥B¡AÁÙ¥i¥H¦b¥¼¨Ó·s¼W¨ä¥Lªº¹êÅé partition ¨ì³o­Ó LVM ºÞ²zªººÏºÐ·í¤¤¡C ¦p¦¹¤@¨Ó¡A¾ã­ÓºÏºÐªÅ¶¡ªº¨Ï¥Î¤W¡A¹ê¦b¬O¬Û·íªº¨ã¦³¼u©Ê°Ú¡I


    ¤p¼ÐÃDªº¹Ï¥Ü¤°»ò¬O LVM¡G PV, PE, VG, LV
    ¬JµM­nª± LVM ªº¸Ü¡A¨º´N±o¹ï LVM ¦³ÂIÁA¸Ñ¤~¦æ°Ú¡I¨Æ¹ê¤W¡A LVM ¨ä¹ê´N¬O±N´X­Ó¹êÅ骺 partitions ³z¹L³nÅé²Õ¦X¦¨¤@¶ô¬Ý°_¨Ó¹³¬O¿W¥ßªº¤jºÏºÐ¡A¦Ó­n¥Î³o¶ô¤jºÏºÐ¡A´N±o­n¦A±N¥L¤À³Î¦¨¬°¥i¥H¨Ï¥Îªº partition ¤~¦æ¡I¦Ó§Ú­Ìª¾¹D¨C­Ó partition ¤W­±ªº filesystem ¦]¬° block ¤j¤pªº¤£¦P¦Ó¦³­­¨î¡A ¦P¼Ëªº¡A LVM ªº¤jºÏºÐ¤j¤p¤]¬O¦³­­¨îªº¡A¥D­n¬O¤@­ÓºÙ¬° PE ªº©N©N¡C§Ú­Ì¥ý¨Ó§@¤@¨Ç²³æªº¸ÑÄÀ§a¡I
    • Physical Volume, ²ºÙ PV¡G
      ³o­Ó´N¬O¹êÅéºÏºÐ°Õ¡I§Ú­Ì¥²¶·­n±N­ì¥»ªººÏºÐ¡A¨Ò¦p /dev/hda5, /dev/hda6 µ¥µ¥ªº partition ¡A§Q¥Î fdisk µ¥³nÅé¡A±N¥L­Ìªº ID §ï¬° LVM (8e) ¡A¨Ã¥B­×§ïºÏºÐªº¬ÛÃö¸ê°T¡A Åý¥L¦¨¬° LVM ¥i¥H¨Ï¥ÎªººÏºÐ¤~¦æ¡C¤°»ò¬O ID °Ú¡HÁÙ°O±o¨Ï¥Î fdisk -l ¬Ý¨ìªº¸ê®Æ§a¡H ID 83 ¬O Linux ªº partition ¡A 82 «h¬O Swap ªº¥N¸¹¡I³o¼ËÁA¤F§a¡H ¤@¶ôºÏºÐÅܦ¨ PV «á¡A LVM ¤~¯à°÷§Q¥Î¸Ó partition ³á¡I­«­n­«­n¡I

    • Volume Group, ²ºÙ VG¡G
      ¨ä¹ê§Ú­Ì LVM ¥D­nªº¥Øªº´N¬O­n«Ø¥ß³o­Ó VG °Õ¡I¥L¥D­n´N¬O±N­è­èªº¤@­Ó©Î¦h­Ó PV ²Õ¦X¦¨¬°¤@­Ó¤jºÏºÐ¡ã³o­Ó¤jºÏºÐ¥i¥H§@¬°«áÄòªº¤À³Î¤§¥Î³á¡I ¨º»ò³o­Ó¤jºÏºÐªº®e¶q³Ì¤j¥i¨ì¦h¤j©O¡H³Ì¤j®e¶qªº­È»P©³¤Uªº PE ¦³Ãö¡A ¦pªG§¹¥þ¨Ï¥Î LVM ªº¹w³]°Ñ¼Æ®É¡A¨º»ò¤@­Ó³Ì¤jªº LVM ºÏºÐ¥i¹F¨ì 256 GBytes¡C

    • Physical Extend, ²ºÙ PE¡G
      ¦b«Ø¥ß VG ªº®É­Ô¡A§Ú­Ì¦P®É»Ý­n«ü©w PE ³o­Ó¼Æ­È¡I¦pªG¤£«ü©wªº¸Ü¡A¥L¹w³]¬O 4MB ªº¤j¤p¡C ·í PE ¬° 4MB ®É¡A VG ³Ì¤jªº®e¶q´N¬O 256 GBytes °Õ¡I¨º»ò³o­Ó PE ¬O¤°»òª±·N¨à¡H¡H §Ú­Ì¦b ºÏºÐÀɮרt²Î ¨º­Ó³¹¸`·í¤¤´£¨ìªº inode, block »P filesystem ¤j¤pªº¬ÛÃö©Ê·í¤¤¡A ¦³´£¨ì¦b ext2/ext3 Àɮרt²Îªº®æ¦¡¤Æ¹Lµ{¤¤¡A¤£¦Pªº block ¤j¤p±N·|¼vÅT¨ì¾ã­Ó filesystem ¤j¤pªº¤ä´©«×¡C¨º³o­Ó PE ¨ä¹ê´N¦³ÂI¹³¬O VG ªº block °Õ¡I ©Ò¥H¥Lªº¤j¤p±N·|¼vÅT¨ì VG ªº³Ì¤j­È³á¡I¦pªG§A·Q­nÅý§Aªº VG ¤j©ó¹w³]ªº 256 GB ®É¡A °O±o­n­×§ï³o­Ó¼Æ­È¡I(¨ä¹ê¡A¤@­Ó VG ³Ì¤j¥i¥H®e³\ 65534 ­Ó PE ¡A ©Ò¥H¡A­×§ï PE ­È¡A·íµM´N·|¼vÅT¨ì³Ì¤jªº VG ®e¶q°Õ¡I )

    • Logical Volume, ²ºÙ LV¡G
      ³o­Ó LV ´N¬O³Ì«á³Q±¾¸ü¨ìÀɮרt²Îªº partition Åo¡ã³o­Ó LV ¬O¥Ñ VG ¤À³Î¨Óªº°Õ¡ã ¥L·|«Ø¥ß¤@­Ó¸Ë¸m¥N¸¹¡A¨Ò¦p /dev/vgname/lvname ¦b±zªº¨t²Î·í¤¤°Ú¡I
    ³z¹L PV, VG, LV ªº³W¹º¤§«á¡A¦A§Q¥Î mkfs (mke2fs -j) µ¥µ¥´N¥i¥H±N±zªº¦h­Ó partition ¾ã¦X¦¨¬°¤@­Ó¤jºÏºÐ¡A ¦A§Q¥Î³o­Ó¤jºÏºÐ¨Ó¤À³Î»P®æ¦¡¤Æ¡A´N OK ªº°Õ¡I¦Ó¥B¡A³o­Ó¤jºÏºÐ¥i¥H¶i¦æ¼W¥[¡B´î¤Ö®e¶qªºÅܤơA ¤]´N¬O»¡¡A³o­Ó VG ¤jºÏºÐ¥i¥H©â´« PV ­ù¡I¨Ã¥B­ì¦³ªº¸ê®Æ¡A²z½×¤W¡A¨Ã¤£·|³Q¼vÅT³á¡I¬O§_«Ü´Î°Ú¡I ¾ã­Ó LVM ªº³B²z¬yµ{»P¦U¤¸¥ó¤§¶¡ªº¬ÛÃö©Ê¡A§Ú­Ìª½±µ¥H¤U¹Ï¨Ó¬Ý¬Ý§a¡I

    LVM ¦U¤¸¥ó¤§¶¡ªº¬ÛÃö©Ê
    ¹Ï¡BLVM ¦U¤¸¥ó¤§¶¡ªº¬ÛÃö©Ê

    ¦p¦¹¤@¨Ó¡A§Ú­Ì´N¥i¥H§Q¥Î LV ³o­Óª±·N¨à¨Ó¶i¦æ¨t²Îªº±¾¸ü¤F¡C¤£¹L¡A±zÀ³¸Ó·|ı±o©_©Çªº¬O¡A ¨º»ò§Úªº¸ê®Æ¼g¤J³o­Ó LV ®É¡A¨ì©³¥L¬O«ç»ò¼g¤JµwºÐ·í¤¤ªº¡H ¨þ¨þ¡I¦n°ÝÃD¡ã¨ä¹ê¡A¨Ì¾Ú¼g¤J¾÷¨îªº¤£¦P¡A¦Ó¦³¨âºØ¤è¦¡¡G
    • ½u©Ê¼Ò¦¡ (linear)¡G°²¦p§Ú±N /dev/hda1, /dev/hdb1 ³o¨â­Ó partition ¥[¤J¨ì VG ·í¤¤¡A¨Ã¥B¾ã­Ó VG ¥u¦³¤@­Ó LV ®É¡A¨º»ò©Ò¿×ªº½u©Ê¼Ò¦¡´N¬O¡G·í /dev/hda1 ªº®e¶q¥Î§¹¤§«á¡A /dev/hdb1 ªºµwºÐ¤~·|³Q¨Ï¥Î¨ì¡C

    • ¥æ¿ù¼Ò¦¡ (triped)¡G¨º¤°»ò¬O¥æ¿ù¼Ò¦¡¡H«Ü²³æ°Ú¡A´N¬O§Ú±N¤@µ§¸ê®Æ©î¦¨¨â³¡¤À¡A ¤À§O¼g¤J /dev/hda1 »P /dev/hdb1 ªº·N«ä¡C¦p¦¹¤@¨Ó¡A¤@¥÷¸ê®Æ¥Î¨âÁûµwºÐ¨Ó¼g¤J¡A ²z½×¤W¡AŪ¼gªº®Ä¯à·|¤ñ¸û¦n¡C
    °ò¥»¤W¡ALVM ³Ì¥D­nªº¥Î³B¬O¦b»s³y²£¥Í¤@­Ó¤jºÏºÐ¡A ¦Ó¤£¬O¦b«Ø¥ß¤@­Ó®Ä¯à¬°¥DªººÏºÐ¤W¡A©Ò¥H¡A§Ú­ÌÀ³¸Ó§Q¥Îªº¬O LVM ¥i¥H¼u©ÊºÞ²z¾ã­Ó partition ¤j¤pªº¥Î³~¤W¡A¦Ó¤£¬OµÛ²´¦b®Ä¯à¤Wªº¡C¦]¦¹¡A LVM ¹w³]ªºÅª¼g¼Ò¦¡¬O½u©Ê¼Ò¦¡°Õ¡I ¦pªG±z¨Ï¥Î triped ¼Ò¦¡¡A­nª`·N¡A·í¥ô¦ó¤@­Ó partition ¡yÂk¤Ñ¡z®É¡A©Ò¦³ªº¸ê®Æ³£·|¡y·l·´¡zªº¡I ©Ò¥H°Õ¡A¤£¬O«Ü¾A¦X¨Ï¥Î³oºØ¼Ò¦¡°Õ¡I¦pªG­n±j½Õ®Ä¯à»P³Æ¥÷¡A¨º»ò´Nª½±µ¨Ï¥Î RAID §Y¥i¡A ¤£»Ý­n¥Î¨ì LVM °Ú¡I³o¼Ë»¡¡AÀ³¸Ó¥i¥H±µ¨ü§a¡I

    Á`¤§¡A³¾­ô»{¬°¡A¾ã­Ó LVM ³Ì¤jªº¥Î³~§Y¬O¦b¼u©ÊºÞ²zºÏºÐªº®e¶q¡AÅý§AªººÏºÐ¥i¥HÀH®É©ñ¤j©ÎÁY¤p¡A ¤è«K±z±N³Ñ¾lªººÏºÐªÅ¶¡§@¤@­Ó¸û¬°¨}¦nªºÀ³¥Î¡I


    ¤p¼ÐÃDªº¹Ï¥Ü»s§@¤@­Ó¥i¨Ï¥Îªº LVM ºÏºÐ¬yµ{
    ­nÅý§Aªº Linux ¨Ï¥Î LVM ªº¥\¯à¡A°£¤F®Ö¤ß¥²¶·­n¦³¤ä´©¤§¥~¡A §A¤]¥²¶·­n¦w¸Ë lvm2 ³o­Ó®M¥ó¤~¦æ°Ú¡I¦n¦b¡A FC4 »P¨ä¥L¸û·sªº distributions ¥Ø«eªº¹w³]®Ö¤ß³£¦³¤ä´© LVM ªº¡A³o­Ó´N¤£»Ý­n¾á¤ß¤F¡ã¨þ¨þ¡C¥t¥~¡A lvm2 ¦ü¥G¤]¬O¹w³]¦w¸Ëªº¡A ¤]¤£»Ý­n¾á¤ß¡I¯u¬O¦n´Î°Ú¡I ^_^

    ¾ã­Ó LVM ªº»s§@¬yµ{¡A´N¸ò§Ú­Ì¤W­Ó¤p¸`´£¨ìªº¨º±i¹Ï¤@¼Ë¡A¥ý»s§@ PV¡A¦A²£¥Í VG¡A ³Ì«á¤À³Î¥X LV «á¡A´N¥i¥H®æ¦¡¤Æ»P±¾¸üÅo¡IOK¡I¨º§Ú­Ì©³¤U´N¤@¨B¤@¨B¨Ó¹ê§@¬Ý¬Ý§a¡I ¥ý»¡©ú¤@¤U³¾­ôªºÀô¹Ò¡A§ÚªºÀô¹Ò¬O FC4 ¡A¦³¤@­Ó 30 GB ªºµwºÐ©ñ¦b /dev/hdb ¡A ³oÁûµwºÐ­ì¥»´N¤w¸g³Q¤À³Î¦¨¬°¤T­Ó partition ¡A¤À§O¬° /dev/hdb1, /dev/hdb2, /dev/hdb3¡A ¦U¤j¬ù¦³ 10GB ¥ª¥kªº®e¶q¡C¦pªG¬d¾\¤@¤U¨t²Î¡A¥L·|³o¼ËÅã¥Ü¡G
    [root@linux ~]# fdisk -l /dev/hdb
    Disk /dev/hdb: 30.7 GB, 30738677760 bytes
    16 heads, 63 sectors/track, 59560 cylinders
    Units = cylinders of 1008 * 512 = 516096 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/hdb1               1       19377     9765976+  83  Linux
    /dev/hdb2           19378       38754     9766008   83  Linux
    /dev/hdb3           38755       59560    10486224   83  Linux
    
    ²{¦b¡A§Ú·Q­n»s§@¤@­Ó LVM ªººÏºÐ¥X¨Ó¡A­º¥ý¡A§Ú·Q­n±N /dev/hdb1, /dev/hdb2 ³o¨â­Ó partition ¥[¤J³o­Ó LVM ·í¤¤¡A¨Ó½Í¤@½Í«ç»ò»s§@§a¡I ^_^


  • «Ø¥ß PV »P PV ªº¬d¸ß¡G
  • ­n«Ø¥ß PV ¨ä¹ê«Ü²³æ¡A¥u­nª½±µ¨Ï¥Î pvcreate §Y¥i¡I§Ú­Ì¨Ó½Í¤@½Í»P PV ¦³Ãöªº«ü¥O§a¡I
    • pvcreate ¡G±N¹êÅé partition «Ø¥ß¦¨¬° PV ¡F
    • pvscan ¡G·j´M¥Ø«e¨t²Î¸Ì­±¥ô¦ó¨ã¦³ PV ªººÏºÐ¡F
    • pvdisplay ¡GÅã¥Ü¥X¥Ø«e¨t²Î¤W­±ªº PV ª¬ºA¡F
    • pvremove ¡G±N PV Äݩʲ¾°£¡AÅý¸Ó partition ¤£¨ã¦³ PV ÄÝ©Ê¡C
    • partprobe ¡G³o­Ó«ü¥O¥i¥HÅý®Ö¤ß¥ß¨èŪ¤J³Ì·sªº partition table ¦Ó¤£¥² reboot¡C
    ¨º´Nª½±µ¨ÓÁ@¤@Á@§a¡I
    1. ¥ý«Ø¥ßºÏºÐ¦¨¬° ID ¬° 8e §a¡I
    [root@linux ~]# fdisk /dev/hdb
    Command (m for help): p
    
    Disk /dev/hdb: 30.7 GB, 30738677760 bytes
    16 heads, 63 sectors/track, 59560 cylinders
    Units = cylinders of 1008 * 512 = 516096 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/hdb1               1       19377     9765976+  83  Linux
    /dev/hdb2           19378       38754     9766008   83  Linux
    /dev/hdb3           38755       59560    10486224   83  Linux
    
    Command (m for help): t
    Partition number (1-4): 1
    Hex code (type L to list codes): 8e
    Changed system type of partition 1 to 8e (Linux LVM)
    
    Command (m for help): t
    Partition number (1-4): 2
    Hex code (type L to list codes): 8e
    Changed system type of partition 2 to 8e (Linux LVM)
    
    Command (m for help): p
    
    Disk /dev/hdb: 30.7 GB, 30738677760 bytes
    16 heads, 63 sectors/track, 59560 cylinders
    Units = cylinders of 1008 * 512 = 516096 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/hdb1               1       19377     9765976+  8e  Linux LVM
    /dev/hdb2           19378       38754     9766008   8e  Linux LVM
    /dev/hdb3           38755       59560    10486224   83  Linux
    
    Command (m for help): w
    The partition table has been altered!
    # Á@¨ì¤F¶Ü¡H¨S¿ù¡I¾ã­Ó ID ³Q§ó§ï¤F¡I
    
    [root@linux ~]# partprobe
    # ³o­Ó«ü¥O¦³½ì¤F¡I¥L¥i¥HÅý®Ö¤ß¥ß¨èŪ¨ú³Ì·sªº partition table 
    # ¡A¦Ó¤£»Ý­n­«·s¶}¾÷³á¡I
    
    
    2. ¶}©l±N­ì¥»ªººÏºÐ»s§@¦¨¬° PV ªº®æ¦¡³á¡I
    [root@linux ~]# pvscan
      No matching physical volumes found
    [root@linux ~]# pvcreate /dev/hdb1
      Physical volume "/dev/hdb1" successfully created
    [root@linux ~]# pvcreate /dev/hdb2
      Physical volume "/dev/hdb2" successfully created
    [root@linux ~]# pvscan
      PV /dev/hdb1         lvm2 [9.31 GB]
      PV /dev/hdb2         lvm2 [9.31 GB]
      Total: 2 [18.63 GB] / in use: 0 [0   ] / in no VG: 2 [18.63 GB]
    # ­è­è§Ú­Ì±N¾ã­Ó partition §ï¦¨¬° PV ®æ¦¡«á¡A§Q¥Î pvscan
    # ´N¥i¥H¬Ý¨ì¾ãÅ骺 PV ª¬ºA¤F¡C¦pªG­n¬Ýªº§ó¸Ô²Ó¡A¨º´N¦p¤U©Ò¥Ü¡G
    [root@linux ~]# pvdisplay
      --- NEW Physical volume ---
      PV Name               /dev/hdb1
      VG Name
      PV Size               9.31 GB
      Allocatable           NO
      PE Size (KByte)       0
      Total PE              0
      Free PE               0
      Allocated PE          0
      PV UUID               CW7uAt-ZJa3-BMxe-tfti-16WU-OfNV-BQM6d8
    
      --- NEW Physical volume ---
      PV Name               /dev/hdb2
      VG Name
      PV Size               9.31 GB
      Allocatable           NO
      PE Size (KByte)       0
      Total PE              0
      Free PE               0
      Allocated PE          0
      PV UUID               1lc2SK-tfGN-ReOr-3mNi-nDAp-mpmb-lHUQFG
    # ¨S¿ù§a¡I½T¹ê«Ø¥ß°_¨Ó¤F¡I°ò¥»¤W¡A PV ªº¦WºÙ»P¹ê»Úªº partition ­è¦n¬Û¦P¡I
    # ¤£¹L¡A VG ¥i´N¤£¬O³o»ò¦^¨Æ¤F¡C¥Ñ©ó§Ú­Ì©|¥¼¹ï³o¨â­Ó PV ¤À°t VG¡A
    # ©Ò¥H¤W­±Åã¥Üªº VG Name ´N¨S¦³¥ô¦ó¸ê®Æ°Ú¡I
    
    Á¿¬O«ÜÃø¡A§@¬O«Ü²³æ¡I³o¼Ë´N±N PV «Ø¥ß¤F¨â­ÓÅo¡I²³æ¨ì¤£¦æ§a¡I ^_^


  • ¶}©l«Ø¥ß VG ¡G
  • «Ø¥ß VG ¤Î VG ¬ÛÃöªº«ü¥O¤]¤£¤Ö¡A§Ú­Ì¨Ó¬Ý¬Ý¡G
    • vgcreate ¡G´N¬O¥D­n«Ø¥ß VG ªº«ü¥O°Õ¡I¥Lªº°Ñ¼Æ¤ñ¸û¦h¡Aµ¥¤@¤U¤¶²Ð¡C
    • vgscan ¡G·j´M¨t²Î¤W­±¬O§_¦³ VG ¦s¦b¡H
    • vgdisplay ¡GÅã¥Ü¥Ø«e¨t²Î¤W­±ªº VG ª¬ºA¡F
    • vgextend ¡G¦b VG ¤º¼W¥[ÃB¥~ªº PV ¡F
    • vgreduce ¡G¦b VG ¤º²¾°£ PV¡F
    • vgchange ¡G³]©w VG ¬O§_±Ò°Ê (active)¡F
    • vgremove ¡G§R°£¤@­Ó VG °Ú¡I
    »P PV ¤£¦Pªº¬O¡A VG ªº¦WºÙ¬O¦Û­qªº¡I§Ú­Ìª¾¹D PV ªº¦WºÙ¨ä¹ê´N¬O partition ªº¸Ë¸m¥N¸¹¡A ¦ý¬O³o­Ó VG ¦WºÙ¡A«h¬O¥i¥HÀH«K§A¦Û¤v¨ú°Ú¡I¦b©³¤Uªº¨Ò¤l·í¤¤¡A §Ú±N VG ¦WºÙ¨ú¦W¬° vbirdvg ¡A©Ò¥H«Ø¥ß³o­Ó VG ªº¬yµ{¬O³o¼Ëªº¡G
    1. ¥ý«Ø¥ß VG §a¡I
    [root@linux ~]# vgcreate vbirdvg /dev/hdb1 /dev/hdb2
      Volume group "vbirdvg" successfully created
    # ¾ã­Ó vgcreate ªº»yªk«Ü²³æ¡A´N¬O§Q¥Î vgcreate VGname PVname1 PVname2..
    # ¤£¹L¡A¦pªG·Q­n­×§ï«e­±´£¨ìªº PE °Ñ¼Æ®É¡A´N±o­n¥[¤J -s PE ¼Æ­È¤F¡I
    
    [root@linux ~]# vgscan
      Reading all physical volumes.  This may take a while...
      Found volume group "vbirdvg" using metadata type lvm2
    
    [root@linux ~]# vgdisplay
      --- Volume group ---
      VG Name               vbirdvg
      System ID
      Format                lvm2
      Metadata Areas        2
      Metadata Sequence No  1
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                0
      Open LV               0
      Max PV                0
      Cur PV                2
      Act PV                2
      VG Size               18.62 GB
      PE Size               4.00 MB
      Total PE              4768
      Alloc PE / Size       0 / 0
      Free  PE / Size       4768 / 18.62 GB
      VG UUID               AZRSJx-FWYF-UIlH-NCh5-NqKS-f4gx-ZR049N
    
    
    2. ¹Á¸Õ©â´«¤@¤U PV §a¡I
    [root@linux ~]# vgreduce vbirdvg /dev/hdb2
      Removed "/dev/hdb2" from volume group "vbirdvg"
    [root@linux ~]# vgdisplay
      --- Volume group ---
      VG Name               vbirdvg
      System ID
      Format                lvm2
      Metadata Areas        1
      Metadata Sequence No  2
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                0
      Open LV               0
      Max PV                0
      Cur PV                1
      Act PV                1
      VG Size               9.31 GB
      PE Size               4.00 MB
      Total PE              2384
      Alloc PE / Size       0 / 0
      Free  PE / Size       2384 / 9.31 GB
      VG UUID               AZRSJx-FWYF-UIlH-NCh5-NqKS-f4gx-ZR049N
    
    [root@linux ~]# vgextend vbirdvg /dev/hdb2
      Volume group "vbirdvg" successfully extended
    # °ò¥»¤W¡A¤£Ãø§a¡I³o¼Ë´N¥i¥H©â´«¾ã­Ó VG ªº¤j¤p°Ú¡I
    # ¥t¥~¡A¥i¥H¨Ï¥Î pvscan ¬Ý¤@¤U PV »P VG ªº¬ÛÃö©Ê³á¡I
    
    [root@linux ~]# pvscan
      PV /dev/hdb1   VG vbirdvg   lvm2 [9.31 GB / 9.31 GB free]
      PV /dev/hdb2   VG vbirdvg   lvm2 [9.31 GB / 9.31 GB free]
      Total: 2 [18.62 GB] / in use: 2 [18.62 GB] / in no VG: 0 [0   ]
    
    ¦p¦¹¤@¨Ó¡A§Ú­Ì´N«Ø¥ß¤F¤@­Ó¦n¤j¦n¤jªººÏºÐ¡A¥L¬O¾ã¦X¤F /dev/hdb1 ¤Î /dev/hdb2 °Õ¡I ¥Ñ©ó VG ªº³Ì¤j®e¶q»P PE ¦³Ãö¡APE ³Ì¦h­­¨î¦b 65534 ­Ó¡A¦ý¨C­Ó PE ªº¤j¤p«h¤£©T©w¡C ¹w³] PE ¬O 4 MB ¡A¦pªG§A·Q­n§ï¦¨ 16MB ªº¸Ü¡A¨º´N±o­n³o¼Ë«Ø¥ß¡G
      vgcreate -s 16M vbirdvg /dev/hdb1 /dev/hdb2
    ¨º»ò³Ì¤j VG ªº®e¶q´N·|¥Ñ 256GB ¼W¥[¬° 1TB °Õ¡I¸Ô²Ó»¡©ú½Ð°Ñ¦Ò man vgcreate ³á¡I


  • «Ø¥ß LV §a¡I
  • ³Ð³y¥X VG ³o­Ó¤jºÏºÐ¤§«á¡A¦A¨Ó´N¬O­n«Ø¥ß¤À³Î°Ï°Õ¡I ³o­Ó¤À³Î°Ï´N¬O©Ò¿×ªº LV Åo¡I°²³]§Ú­n±N­è­è¨º­Ó vbirdvg ºÏºÐ¡A¤À³Î¦¨¬° vbirdlv ¡A ¾ã­Ó VG ³£³Q¤À°t¨ì vbirdlv ¸Ì­±¥h¡I¥ý¨Ó¬Ý¬Ý¯à¨Ï¥Îªº«ü¥O«á¡A ´Nª½±µ¤u§@¤F¥ý¡I
    • lvcreate ¡G«Ø¥ß LV °Õ¡I
    • lvscan ¡G¬d¸ß¨t²Î¤W­±ªº LV ¡F
    • lvdisplay ¡GÅã¥Ü¨t²Î¤W­±ªº LV ª¬ºA°Ú¡I
    • lvextend ¡G¦b LV ¸Ì­±¼W¥[®e¶q¡I
    • lvreduce ¡G¦b LV ¸Ì­±´î¤Ö®e¶q¡F
    • lvremove ¡G§R°£¤@­Ó LV ¡I
    • lvresize ¡G¹ï LV ¶i¦æ®e¶q¤j¤pªº½Õ¾ã¡I
    1. ±N¾ã­Ó vbirdvg ³q³q¤À°tµ¹ vbirdlv °Ú¡I
    [root@linux ~]# lvcreate -L [sizeMG] -n [LVname] VGname
    °Ñ¼Æ¡G
    -L  ¡G«á­±±µ®e¶q¡A®e¶qªº³æ¦ì¥i¥H¬O M, G µ¥µ¥¡F
    -n  ¡G«á­±±µªº´N¬O LV ªº¦WºÙ°Õ¡I
    §ó¦hªº»¡©úÀ³¸Ó¥i¥H¦Û¦æ¬d¾\§a¡I man lvcreate 
    
    [root@linux ~]# lvcreate -L 18.62G -n vbirdlv vbirdvg
      Rounding up size to full physical extent 18.62 GB
      Logical volume "vbirdlv" created
    [root@linux ~]# ll /dev/vbirdvg/vbirdlv
    lrwxrwxrwx  1 root root 27 Nov 14 21:10 /dev/vbirdvg/vbirdlv -> 
    /dev/mapper/vbirdvg-vbirdlv
    # ¬Ý¨£¤F¨S¦³°Ú¡I¡H³o´N¬O§Ú­Ì³Ì­«­nªº¤@­Óª±·N¨à¤F¡I
    # ¥¼¨Ó©Ò¦³­n±¾¸üªº¸ê®Æ¡A³q³q¬O³z¹L³o­Ó¸Ë¸mªº¡I
    
    [root@linux ~]# lvscan
      ACTIVE            '/dev/vbirdvg/vbirdlv' [18.62 GB] inherit
    [root@linux ~]# lvdisplay
      --- Logical volume ---
      LV Name                /dev/vbirdvg/vbirdlv
      VG Name                vbirdvg
      LV UUID                B6kSrg-9LMG-gqVy-jjz8-x0gM-ya9S-XLFcZN
      LV Write Access        read/write
      LV Status              available
      # open                 0
      LV Size                18.62 GB
      Current LE             4767
      Segments               2
      Allocation             inherit
      Read ahead sectors     0
      Block device           253:0
    
    ¦p¦¹¤@¨Ó¡A¾ã­Ó partition ¤]·Ç³Æ¦n°Õ¡I


  • partition ªº®æ¦¡¤Æ»P±¾¸ü¡I
  • ³o­Ó³¡¤À³¾­ô§Ú´N¤£¦A¦h¥[¸ÑÄÀ¤F¡Iª½±µ¨Ó¶i¦æ§a¡I
    [root@linux ~]# mke2fs -j /dev/vbirdvg/vbirdlv
    [root@linux ~]# mkdir /mnt/lvm
    [root@linux ~]# mount -t ext3 /dev/vbirdvg/vbirdlv /mnt/lvm
    [root@linux ~]# df
    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/hda2              9920624   3029712   6378844  33% /
    /dev/hda1               101086     16524     79343  18% /boot
    /dev/hda5             19236308    190776  18068380   2% /disk1
    /dev/hda6            161836268     94272 153521136   1% /models
    /dev/shm                192528         0    192528   0% /dev/shm
    /dev/mapper/vbirdvg-vbirdlv
                          19219156    176288  18066588   1% /mnt/lvm
    [root@linux ~]# fdisk -l /dev/hdb
    Disk /dev/hdb: 30.7 GB, 30738677760 bytes
    16 heads, 63 sectors/track, 59560 cylinders
    Units = cylinders of 1008 * 512 = 516096 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/hdb1               1       19377     9765976+  8e  Linux LVM
    /dev/hdb2           19378       38754     9766008   8e  Linux LVM
    /dev/hdb3           38755       59560    10486224   83  Linux
    
    ª¾¹D¨ºÃ䤣¦P¤F¶Ü¡H¨S¿ù¡I­ì©lªº partition ÁÙ¦s¦b¡A¦ý¬O§Ú­Ì«o¥i¥H¨Ï¥ÎÃB¥~ªº LVM ¥\¯à¡A±N¨Ó¦Û¤£¦Pªº partition ªº®e¶q¾ã­Ó¾ã¦X¦b¤@°_¡A¹ê¦b¬Oµ¹¥L¬Û·íªº¦³½ì°Ú¡I ^_^

    ¤p¼ÐÃDªº¹Ï¥ÜÅý­ì¦³ªº LVM ºÏºÐ¥[¤jªº¤èªk¡G resize2fs
    ¦n¤F¡AÁA¸Ñ¤F¦p¦ó»s§@ LVM ¤§«á¡A±µ¤U¨Ó«h¬O¤ñ¸û¶i¶¥ªº¨Ï¥Î°Õ¡I§Ú­Ìª¾¹D vbirdvg ¤w¸g¦³¨â­Ó PV¡A ¦ý¬O¹ê»Ú¤W¡A§Ú­ÌÁÙ¦³­Ó /dev/hdb3 ªº¹êÅé partition °Ú¡I¨º»ò¦p¦ó±N³o­Ó /dev/hdb3 ¥[¤J¨ì vbirdvg ¡A¥BÅý vbirdlv ¼W¥[©O¡H¨ä¹ê¤]¤£Ãø°Õ¡I§A¥²¶·­n¡G
    1. ±N±ý³B²zªº LV ¨ø¸ü¡F
    2. «Ø¥ß PV¡F
    3. ±N«Ø¥ßªº PV ¥H vgextend ¼W¥[¨ì VG ·í¤¤¡F
    4. §Q¥Î lvextend ¼W¥[­è­è VG ©Ò¼W¥[ªº®e¶q¡F
    5. §Q¥Î resize2fs ±N LV ªº®e¶q½T¹ê¼W¥[¡I
    [root@linux ~]# umount /mnt/lvm
    
    [root@linux ~]# fdisk /dev/hdb
    Command (m for help): t
    Partition number (1-4): 3
    Hex code (type L to list codes): 8e
    Changed system type of partition 3 to 8e (Linux LVM)
    
    Command (m for help): w
    The partition table has been altered!
    
    [root@linux ~]# partprobe
    [root@linux ~]# pvcreate /dev/hdb3
      Physical volume "/dev/hdb3" successfully created
    
    [root@linux ~]# vgextend vbirdvg /dev/hdb3
      Volume group "vbirdvg" successfully extended
    [root@linux ~]# vgdisplay
      --- Volume group ---
      VG Name               vbirdvg
      System ID
      Format                lvm2
      Metadata Areas        3
      Metadata Sequence No  5
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                1
      Open LV               1
      Max PV                0
      Cur PV                3
      Act PV                3
      VG Size               28.62 GB
      PE Size               4.00 MB
      Total PE              7327
      Alloc PE / Size       4767 / 18.62 GB
      Free  PE / Size       2560 / 10.00 GB
      VG UUID               AZRSJx-FWYF-UIlH-NCh5-NqKS-f4gx-ZR049N
    # ¨S¿ùªº¡I¬O¼W¥[¤F¡I¤]¥i¥H¨Ï¥Î pvscan ¬d¾\³á¡I
    # ¦Ó¥B³Ñ¾lªº¨S¦³¨Ï¥Îªº VG ®e¶q¬O 10.00 GB ³á¡I¬Ý²M·¡³o­Ó¦a¤è¡I ^_^
    
    [root@linux ~]# pvscan
      PV /dev/hdb1   VG vbirdvg   lvm2 [9.31 GB / 0    free]
      PV /dev/hdb2   VG vbirdvg   lvm2 [9.31 GB / 0    free]
      PV /dev/hdb3   VG vbirdvg   lvm2 [10.00 GB / 10.00 GB free]
      Total: 3 [28.62 GB] / in use: 3 [28.62 GB] / in no VG: 0 [0   ]
    
    [root@linux ~]# lvextend -L +10G /dev/vbirdvg/vbirdlv
      Extending logical volume vbirdlv to 28.62 GB
      Logical volume vbirdlv successfully resized
    
    [root@linux ~]# lvdisplay
      --- Logical volume ---
      LV Name                /dev/vbirdvg/vbirdlv
      VG Name                vbirdvg
      LV UUID                B6kSrg-9LMG-gqVy-jjz8-x0gM-ya9S-XLFcZN
      LV Write Access        read/write
      LV Status              available
      # open                 1
      LV Size                28.62 GB
      Current LE             7327
      Segments               3
      Allocation             inherit
      Read ahead sectors     0
      Block device           253:0
    
    [root@linux ~]# mount -t ext3 /dev/vbirdvg/vbirdlv /mnt/lvm
    [root@linux ~]# df /mnt/lvm
    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/mapper/vbirdvg-vbirdlv
                          19219156    176288  18066588   1% /mnt/lvm
    
    ¬Ý¨ì¤F§a¡H¡H¯u¬O¶Ë¸£µ¬¡ã«ç»ò·| lv ¤w¸g¼W¥[¤F¡A¦ý¬O /dev/vbirdvg/vbirdlv «o¨S¦³¥[¤j©O¡H ³o¬O¦]¬°§Ú­Ìªº ext3 ¥D­n¸ê°T¦b³Ìªì³W¹º®É¡A´N¤w¸g¼g¤J super block ¡A ¦P®É inode »P block ¼Æ¶q¤S¬O©T©wªº¡A©Ò¥H¡A³o­Ó®e¶q¤j¤p·íµM¤£·|¦³ÅܤơI¨º«ç»ò¿ì¡H ¨SÃö«Y¡A§Ú­Ì¥i¥H¨Ï¥Î ext2/ext3 ªº¤u¨ãµ{¦¡¨Ó³B²z¡I
    [root@linux ~]# resize2fs [-f] [device] [size]
    °Ñ¼Æ¡G
    -f      ¡G±j¨î¶i¦æ resize ªº°Ê§@¡I
    [device]¡G¸Ë¸m¥N¸¹°Ú¡I
    [size]  ¡G¥i¥H¥[¤]¥i¥H¤£¥[¡C¦pªG¥[¤W size ªº¸Ü¡A¨º»ò´N¥²¶·­nµ¹¤©¤@­Ó³æ¦ì¡A
              Ä´¦p M, G µ¥µ¥¡C¦pªG¨S¦³ size ªº¸Ü¡A¨º»ò¹w³]¨Ï¥Î¡y¾ã­Ó partition¡z
              ªº®e¶q¨Ó³B²z¡I
    
    [root@linux ~]# umount /mnt/lvm
    [root@linux ~]# resize2fs -f /dev/vbirdvg/vbirdlv
    resize2fs 1.38 (30-Jun-2005)
    Resizing the filesystem on /dev/vbirdvg/vbirdlv to 7502848 (4k) blocks.
    The filesystem on /dev/vbirdvg/vbirdlv is now 7502848 blocks long.
    
    [root@linux ~]# mount -t ext3 /dev/vbirdvg/vbirdlv /mnt/lvm
    [root@linux ~]# df /mnt/lvm
    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/mapper/vbirdvg-vbirdlv
                          29540436    176288  28163696   1% /mnt/lvm
    
    ¼K¼K¡I¯uªº©ñ¤j¤F§a¡I¡I¦Ó¥B¦pªG§A¤w¸g¦³¶ñ¸ê®Æ¦b LVM ºÏ°Ï·í¤¤ªº¸Ü¡I ³o­Ó¸ê®Æ¬O¤£·|¦º±¼ªº³á¡IÁÙ¬OÄ~Äò¦s¦b­ì¥»ªººÏ°Ï·í¤¤°Õ¡I ¾ã­Ó°Ê§@³ºµM³o»ò²³æ´N§¹¦¨¤F¡I­ì¥»ªº¸ê®ÆÁÙ¬O¤@ª½¦s¦b¦Ó¤£·|®ø¥¢¡ã ±z»¡¡A LVM ¦n¤£¦n¥Î°Ú¡I

    ¨Æ¹ê¤W¡A resize2fs ¤]¥i¥H¥Î¨Ó³B²z ext2/ext3 ­ì¥» filesystem ªº¤j¤p¡C ¥i¥H¥ý¥H fdisk ³B²z¤À³Î°Ï¡A¦A¥H³o­Ó resize2fs ¨Ó©ñ¤j©ÎªÌÁY¤p partition °Ú¡I ­nª`·N¡A«Ý³B²zªº partition ¤£¥i±¾¸ü³á¡I


    ¤p¼ÐÃDªº¹Ï¥Üª`·N¨Æ¶µ¡G
    ¥ý¨Ó»¡¤@»¡¡A§A¥²¶·­nª¾¹Dªº¤@¨Ç LVM ªº«ü¥O¾ã²z¡G
    ¥ô°ÈPVVGLV
    ·j´M(scan)pvscanvgscanlvscan
    «Ø¥ß(create)pvcreatevgcreatelvcreate
    ¦C¥X(display)pvdisplayvgdisplaylvdisplay
    ¼W¥[(extend)¡@vgextendlvextend
    ´î¤Ö(reduce)¡@vgreducelvreduce
    §R°£(remove)pvremovevgremovelvremove
    §ïÅÜ®e¶q(resize)¡@¡@lvresize

    ¥t¥~¡AÁٻݭn¥H resize2fs ¨Ó­×­qÀɮרt²Î¹ê»Úªº¤j¤p¤~¦æ°Ú¡I ^_^ ¡C¦Ü©óÁöµM LVM ¥i¥H¼u©ÊªººÞ²z§AªººÏºÐ®e¶q¡A¦ý¬O­nª`·N¡A ¦pªG§A·Q­n¨Ï¥Î LVM ºÞ²z±zªºµwºÐ®É¡A¨º»ò¦b¦w¸Ëªº®É­Ô´N±o­n°µ¦n LVM ªº³W¹º¤F¡A §_«h¥¼¨ÓÁÙ¬O»Ý­n¥ý¥H¶Ç²ÎªººÏºÐ¼W¥[¤è¦¡¨Ó¼W¥[«á¡A²¾°Ê¸ê®Æ«á¡A¤~¯à°÷¶i¦æ LVM ªº¨Ï¥Î°Ú¡I

    µL½×¦p¦óÁÙ¬O­n¸ò¤j®a³ø§iªº¡A³¾­ô­Ó¤H»{¬° LVM ¤ñ¸û¾A¦X¥Î¦b»s§@¤@­Ó¨ã¦³¼u©ÊªººÏºÐ®e¶qªºÀô¹Ò¡A ¨Ã¤£¬O­n»s§@¤@­Ó°ª®Ä¯àªºÀx¦s³]³ÆªºÀô¹Ò¡A©Ò¥H³¾­ô¦b lvcreate ®É¡A ¤~¨S¦³Á¿¨ì¦p¦ó»s§@ triped ¼Ò¦¡ªº°Ñ¼Æ°Ú¡I¦pªG¯uªº·Q­n»s§@¤@­Ó°ª¥i¾a©Ê¡B °ª©Ê¯àªºÀx¦sÀô¹Ò¡A¨ºÁÙ¬O±o­«µwÅé¨ÓµÛ¤â¡AÄ´¦p©³¤U§Ú­Ì­n½Í¤@½Íªº iSCSI ªº RAID Àx¦s¬[ºc¡AÀ³¸Ó´N¬O­Ó¤£¿ùªº¿ï¾Ü³á¡I ^_^

    ¥t¥~¡A¦pªG§A·Q­n±N LVM ²¾°£ªº¸Ü¡A¨º»ò´NÀ³¸Ó­n¡G
    1. ¥ý¨ø¸ü¨t²Î¤W­±ªº LVM ºÏ°Ï¡F
    2. ¨Ï¥Î lvremove ²¾°£ LV ¡F
    3. ¨Ï¥Î vgchange -a n VGname Åý VGname ³o­Ó VG ¤£¨ã¦³ Active ªº¼Ð»x¡F
    4. ¨Ï¥Î vgremove ²¾°£ VG¡G
    5. ¨Ï¥Î pvremove ²¾°£ PV¡F
    6. ³Ì«á¡A¨Ï¥Î fdisk ­×§ï ID ¦^¨Ó°Ú¡I
    ¦n§a¡I¨º´N¹ê»Úªº±N³¾­ô­è­è«Ø¥ßªº LVM µ¹¥L®³±¼§a¡I
    [root@linux ~]# umount /mnt/lvm
    [root@linux ~]# lvremove /dev/vbirdvg/vbirdlv
    Do you really want to remove active logical volume "vbirdlv"? [y/n]: y
      Logical volume "vbirdlv" successfully removed
    [root@linux ~]# vgchange -a n vbirdvg
      0 logical volume(s) in volume group "vbirdvg" now active
    [root@linux ~]# vgremove vbirdvg
      Volume group "vbirdvg" successfully removed
    [root@linux ~]# pvremove /dev/hdb1
      Labels on physical volume "/dev/hdb1" successfully wiped
    [root@linux ~]# pvremove /dev/hdb2
      Labels on physical volume "/dev/hdb2" successfully wiped
    [root@linux ~]# pvremove /dev/hdb3
      Labels on physical volume "/dev/hdb3" successfully wiped
    
    ³Ì«á¦b¥Î fdisk ±NºÏºÐªº ID µ¹¥L§ï¦^¨Ó 82 ´N¦n°Õ¡I¾ã­Ó¹Lµ{´N³o¼Ëªº°Õ¡I ^_^

    ¤j¼ÐÃDªº¹Ï¥ÜÃB¥~ªºÀx¦s³]³Æ iSCSI ¨ó©wªººÏºÐ°}¦C¡G
    ±`±`·|Å¥¨ì©Ò¿×ªº SAN ( Storage Area Networks ) »P NAS ( Network Attached Storage ) ³o¨â­Ó¦r²´¡A NAS ¥D­n¬O¥H¤@³¡±Mªùµ¹Àx¦s¸ê®Æ¥Îªº¥D¾÷¡A¥H²{¦³ªº TCP/IP ¨ó©w¨Ó´£¨Ñ§@¬°Ãþ¦ü file server ªº¥Î³~¡A ¥L¥i¥Hª½±µ©ñ¸m¦bºô¸ô¤W­±¡A´£¨Ñ¨Ï¥ÎªÌ¦s¨ú¸ê®Æ¤§¥Î¡CSAN «hÃþ¦ü¤@³¡Àx¦s³]³Æ¡A ÂǥѥúÅÖ³q¹D´£¨Ñ¬Y´X³¡¥D¾÷¶i¦æ¸ê®Æªº¦s¨ú¤§¥Î¡A»ù®æ©ù¶Q¡AºûÅ@¦¨¥»°ª¡A¦ý¬OÀx¦s®Ä¯à¨Î¡I ¦ý¤£½×¬O­þ¤@ºØ¬[ºc¡A°ò¥»¤W¡A¥L­ÌªºÀx¦sµwºÐ³q±`¬O¥HºÏºÐ°}¦C (RAID) §@¬°°ò¦ªº¡C ©³¤U§Ú­Ì·|¨Ó½Í¤@½Í¤°»ò¬OºÏºÐ°}¦C¡A¨Ã¦P®É¥H¥Ø«e¸û·sªº iSCSI ¬[ºcªºÀx¦s³]³Æ¨Ó¶i¦æ¤@­Ó²³æªººô¸ôÀx¦s³]³Æ¬[³]¡C


    ¤p¼ÐÃDªº¹Ï¥Ü¤°»ò¬OºÏºÐ°}¦C
    ºÏºÐ°}¦C¥þ¦W¬O¡y Redundant Arrays of Inexpensive Disks ¡z¡A²¼g¬° RAID¡A ¥L¬O³z¹L¤@­Ó§Þ³N(³nÅé©ÎµwÅé)¡A±N¦h­Ó¸û¤pªººÏºÐ¾ã¦X¦¨¬°¤@­Ó¸û¤jªººÏºÐ¸Ë¸m¡F ¦Ó³o­Ó¸û¤jªººÏºÐ¥\¯à¥i¤£¤î¬OÀx¦s¦Ó¤w¡A¥LÁÙ«O¦³¸ê®Æ«OÅ@ªº¥\¯à©O¡C ¾ã­Ó RAID ¥Ñ©ó¿ï¾Üªºµ¥¯Å (level) ¤£¦P¡A¦Ó¨Ï±o¾ã¦X«áªººÏºÐ¨ã¦³¤£¦Pªº¥\¯à¡A °ò¥»±`¨£ªº level ¦³³o´XºØ¡G

  • Linear mode (½u©Ê¼Ò¦¡)¡G
    ¨â­Ó¥H¤WªººÏºÐ¾ã¦X¦¨¬°¤@­Ó¹êÅ骺Àx¦s¸Ë¸m¡F³o­Ó¼Ò¦¡ªº¯S¦â¬O¡A ©Ò¦³ªº¸ê®Æ¬O¡y¤@­Ó¤@­Ó¶ñº¡«á¡A¤~±N¸ê®ÆÄ~Äò¼g¨ì¤U¤@­ÓºÏºÐ¤W¡z¡F ¥Ñ©ó¸ê®Æ¬O¤@­Ó¤@­Ó¼g¤J¨ì¤£¦PªºµwºÐ·í¤¤¡A¦]¦¹¡A¾ã­ÓºÏºÐªºÅª¨ú®Ä¯à¨Ã¤£·|¼W¥[¡A ¦¹¥~¡A¥Ñ©ó¸ê®Æ¨ã¦³³sÄò©Ê¡A¦]¦¹¡A­Y¤£¤p¤ß¦³¥ô¦ó¤@­ÓºÏºÐ·l·´®É¡A¼K¼K¡I ±zªº¸ê®Æ¥i¯à³q³q±Ï¤£¦^¨Ó¤F¡ã³oºØ¼Ò¦¡°ß¤@ªº¦n³B¡A ´N¬OºÏºÐªºªÅ¶¡§¹¾ãªº³Q§Q¥Î§¹²¦¡I¤£·|¦³¥ô¦ó«O¯dªÅ¶¡ (redundant)¡C

  • RAID-0 (¥æ¿ù¼Ò¦¡, stripe)¡G
    ³oºØ¼Ò¦¡¥D­n¬O§Q¥Î®e¶q¬Û¦PªººÏºÐ¨Ó¹F¦¨¡A®Ä¯à·|¤ñ¸û¦n¡C ©Ò¿×ªº¥æ¿ù (stripe) ¬O¦]¬°Àɮ׸ê®Æ¬O¦P¨BÅx¨ì¤£¦PªººÏºÐ¤WÀY¥hªº·N«ä¡A ¤]´N¬O»¡¡A°²³]§Ú¦³¨âÁûºÏºÐ³]©w¦¨ RAID-0 ¡A¨º»ò·í§Ú¦³ 100MB ¸ê®Æ­n¼g¤J®É¡A «h 100MB ·|³Q©î¦¨¨â­Ó 50MB ¤À§O¼g¤J¤£¦PªººÏºÐ¤WÀY¥h¡I

    ©Ò¥HÅo¡A¦]¬°¨C¤@­ÓºÏºÐ¼g¤Jªº¸ê®Æ¶q¥u¦³¤@¥b¡A¦]¦¹¡AŪ¼gªº®Ä¯à³£·|¤j¤jªº¼W¥[¡I ¦Ó¥B¶V¦hÁûºÏºÐ©Ò³y¦¨ªº RAID-0 ¸Ë¸m¡A²z½×¤W¡A®Ä¯à¼W¥[ªº¶V©úÅã¡C ¦ý¬O³oºØ¼Ò¦¡¦³­Ó³Ì¤jªº°ÝÃD¡A¨º´N¬O¡A¦]¬°¤@µ§¸ê®Æ³Q©î¦¨´X­Ó³¡¤À¤À§G¦b¤£¦PªººÏºÐ¤WÀY¡A ¦]¦¹¡y¥ô¦ó¤@ÁûºÏºÐªº·l·´¡A³£·|Åý§Aªº¸ê®Æ±Ï¤£¦^¨Ó¡I¡z

    ¥t¥~¡A¦pªG¨Ï¥Î¤£¦P®e¶qªººÏºÐ¨Ó¹F¦¨ RAID-0 ®É¡A«h¦bÀx¦s¸ê®Æªø¤j¨ì¤@©wµ{«×®É¡A RAID-0 ªº®Ä¯à·|ÅÜ®t¡C°²³]§Ú¥Î¤F¤@Áû 20GB ¨âÁû 16GB ªºµwºÐ¦n¤F¡A ¨º»ò·íÁ`¸ê®Æ¶q¤Ö©ó 48GB (16x3) ®É¡A®Ä¯à¬O«Ü¤£¿ùªº¡C ¦ý¬O·í¶W¹L 48GB ®É¡A«h¸ê®Æ¶È¯àÀx¦s¦b 20GB ¨º¤@Áû¤F (¥i¥Î®e¶q³Ñ¤U 4GB °Ú¡I)¡A ©Ò¥HÅo¡A·íµM®Ä¯à´NÅÜ®t¤F°Ú¡I

  • RAID-1 (¬M®g¼Ò¦¡, mirror)¡G
    ³oºØ¼Ò¦¡¤]¬O»Ý­n¬Û¦PªººÏºÐ®e¶qªº¡A³Ì¦n¬O¤@¼Ò¤@¼ËªººÏºÐ°Õ¡I ¦pªG¬O¤£¦P®e¶qªººÏºÐ²Õ¦¨ RAID-1 ®É¡A¨º»òÁ`®e¶q±N¥H³Ì¤pªº¨º¤@ÁûºÏºÐ¬°¥D¡I ³oºØ¼Ò¦¡¥D­n¬O¡yÅý¦P¤@¥÷¸ê®Æ¡A§¹¾ãªº«O¦s¦b¨âÁûºÏºÐ¤WÀY¡z¡A ¤]´N¬O»¡¡A¦pªG§Ú¦³¤@­Ó 100MB ªºÀɮסA¥B§Ú¶È¦³¨âÁûºÏºÐ²Õ¦¨ RAID-1 ®É¡A ¨º»ò³o¨âÁûºÏºÐ±N·|¦P¨B¼g¤J 100MB ¨ì¥L­ÌªºÀx¦sªÅ¶¡¥h¡A ¦]¦¹¡A¾ãÅé®e¶q´X¥G¤Ö¤F 50%¡C¥Ñ©ó¨âÁûµwºÐ¤º®e¤@¼Ò¤@¼Ë¡A¦n¹³Ãè¤l¬M·Ó¥X¨Ó¤@¼Ë¡A ©Ò¥H§Ú­Ì¤]ºÙ¥L¬° mirror ¼Ò¦¡Åo¡ã

    §Ú­Ì¥i¥H»¡¡A³oºØ¼Ò¦¡³Ì¤jªºÀuÂI¤j·§´N¬O¦b¶i¦æ³Æ¥÷§a¡I ¦]¬°©Ò¦³ªº¸ê®Æ³£³Q¦s©ñ¦b¨â­ÓºÏºÐ¤W­±¡A©Ò¥H¡A¥ô¦ó¤@ÁûºÏºÐ·l·´®É¡A¼K¼K¡I ©Ò¦³ªº¸ê®Æ¥i³£ÁÙ¬O«O¦sªº¦n¦nªº©O¡ã

    ¦Ü©ó®Ä¯à¤W­±¡A¥Ñ©ó­n¼g¤Jªº¸ê®ÆÅܦh¤F¡A(¦P¨B¼g¤J¨âÁûµwºÐ¹À¡I)¡A ©Ò¥H¡A®Ä¯à·|¤ñ³æÁûºÏºÐÁÙ­n®t¤@¨Ç¡A¨S¿ìªk¡A¦]¬°§Ú­Ì³£¬O³z¹L¦P¤@­Ó¶×¬y±Æ¦b¶i¦æ¸ê®Æªº³q¦æ°Ú¡ã ¤£¹L¡AŪ¨úªº®Ä¯àÁÙ¤£¿ù¡A¦]¬°¸ê®Æ¦³¨â¥÷¡A¦pªG¦h­Ó processes ¦bŪ¨ú¦P¤@µ§¸ê®Æ®É¡A RAID ·|¦Û¦æ¨ú±o³Ì¨ÎªºÅª¨ú¥­¿Å¡C

    ¨Æ¹ê¤W¡A¬°¤F«O¦³ RAID-1 ªºÀx¦sÀuÂI¡A¤S·Q­n¨ã¦³Ãþ¦ü RAID-0 ªº®Ä¯à¼W±j¡A ©Ò¥H¡A«á¨Ó¤]¦³©Ò¿×ªº RAID 0+1 ¡A¥ç§Y¦P®É¨ã¦³ RAID-0 »P RAID-1 ªº¥\¯à¡F ¥u¬O¡A³o¼Ëªº¥\¯à¦Ü¤Ö»Ý­n¥|Áû¥H¤Wªº¬Û¦P®e¶qªººÏºÐ¤~¦æ¡ã ¦Ó¥BÁ`¥i¥Î®e¶q·|´î¤Ö¤@¥b (¦]¬° RAID-1 °Ú¡I)¡C

  • RAID-5¡G
    ³o­ÓÃþ«¬³Ì¦³½ì¡ã¤]¬O¥Ø«e³Ì±`¨£ªº¤@ºØÃþ«¬¤F¡C RAID-5 ·|¾ã¦X¦h­ÓºÏºÐ (³q±`»Ý­n¤T­Ó¥H¤W)¡AµM«á¨C³¡ºÏºÐ¾÷¤W­±³£·|°O¿ý¤Ö³\ªº¨ä¥L³¡ºÏºÐ¾÷ªº¸ê°T ( parity information )¡A¥Ñ©ó³o­Ó°Ê§@¡A¦]¦¹¡A¹ê»Ú¤W¥i¥H¨Ï¥Îªº®e¶q¨ä¹ê¬O (N-1)*S ¡A¨º­Ó N ¬°¥þ³¡ªººÏºÐ¾÷Á`¼Æ¡AS «h¬O³Ì¤pªº¨º­ÓºÏºÐªº®e¶q¡C ¤Ö±¼ªºªÅ¶¡´N¬O¥Î¨Ó§@¬°¸ê°T°O¿ý¥Îªº¡C

    ¥Ñ©ó³o­Ó¾÷¨îªº¦s¦b¡A¦]¦¹¡A·í¨º N ³¡ºÏºÐ¾÷¦³¥ô¦ó¤@³¡¥X°ÝÃD®É¡A ¥Lªº¸ê®Æ³£·|³Q¥­§¡°O¿ý¨ì¨ä¥L N-1 ³¡ºÏºÐ¾÷¤º¡A©Ò¥H¡A¥u­n§A±NÃa±¼ªº¨º¤@Áû®³±¼¡A ´«¤@Áû¦nªººÏºÐ«á¡A¸ÓºÏºÐ­ì¥»ªº¤º®e´N·|³Q­««Ø (rebuild) °_¨Ó¡A ¨þ¨þ¡ã«Ü´Îªº³Æ¥÷®ÄªG§a¡I

    °£¦¹¤§¥~¡A¦]À³¥Ø«e©Ò¿×ªº¼ö©Þ´¡ RAID ¬[ºc¡A¦]¦¹¡A«Ü¦hªºµwÅé RAID ¦b»s§@³o­Ó RAID-5 ªºÃþ«¬®É¡A¥L·|¨Ï¥Î N+1 ÁûºÏºÐ¡A¨ä¤¤ N Áû¥Î¨Ó§@¬° RAID-5 ¤§¥Î¡A ¥t¥~¨º¤@Áû«h°µ¬°ºÏºÐ·lÃa®Éªº§Y®É³B²z¤§¥Î (spare disk)¡C ©Ò¥H¡A°²³]±z¦³¤QÁûºÏºÐ¦b³o¼Ëªº¬[ºc¤U®É¡A«h¨Æ¹ê¤W¥u¦³¤EÁû¦b¶i¦æ RAID-5 ªº¦s¨ú¡A ¤@Áû§@¬°¿ù»~³B²z¡A©Ò¥HÁ`®e¶qÀ³¸Ó¬O 8xS ¤~¹ï³á¡I¦Ó·í¦³¥ô¦ó¤@ÁûºÏºÐ¥X°ÝÃD®É¡A ¨º¤@Áû spare disk ´N¬£¤W¥Î³õ¤F¡A¥L·|¥ß¨è³Q­««Ø¡A ¦]¦¹¡A±z¥u­n±N¦³°ÝÃDªººÏºÐ©Þ±¼¡A´«¤W¤@Áû·sªº¡A¼K¼K¡I·d©w¡I

    ¤£¹LÁÙ¬O­nª`·N°Õ¡A¦]¬° RAID-5 ¶È¯à³B²z¤@ÁûµwºÐÃa±¼®Éªº³B¸m¡A ­Y¦P®É¦³¨âÁû¥H¤WªººÏºÐ·l·´¡A¨º....©Ò¦³ªº¸ê®ÆÁÙ¬O·|§¹³Jªº¡I ©Ò¥H°Õ¡A¯S­«­nªº¸ê°TÁÙ¬O±o­n½Æ»s¥X¨Ó¤~¦æ¡ãÃö©ó¦Ò¶q¡A¨þ¨þ¡ã½Ð°Ñ¦Ò³Æ¥÷µ¦²¤§a¡I

    ¦Ü©ó¦s¨ú®Ä¯à¤W­±¡AŪ¨úªº®Ä¯à´X¥G¥i¥H·B¬ü RAID-0 ¡A¦ý¬O¼g¤Jªº®Ä¯à´NµLªk¹³ RAID-0 ¨º¼Ë©úÅã¡C¦]¬°ÁÙ±o­n­pºâ¤À§O¼g¤J¨ì©Ò¦³ºÏºÐ·í¤¤ªº¥­¿Å¸ê°T (parity information)¡A ©Ò¥H¼g¤Jªº®Ä¯àÁöµM¬O·|¼W¥[¤£¤Ö¡A¤£¹L¡A¤£®e©ö­pºâ¥X¨Ó¹ê»Úªº¼W¥[ªº®Ä¯à°Õ¡ã

    ¨þ¨þ¡I¸g¹L¤W­±ªº»¡©ú¡A±zÀ³¸Ó·|¾å±o¡A¬°¦ó¥ø·~·|»Ý­n¨Ï¥ÎºÏºÐ°}¦C¤F§a¡H ¨S¿ù¡A¦]¬° RAID ¤£¦ý¥i¥H¼W¥[¸ê®Æ¦s¨úªº®Ä¯à¡A ¦Ó¥B¹ï©ó³Æ¥÷»P¸ê®Æªº¥i¾a©Ê¦Ó¨¥¡A¥L¨ã¦³¬Û·íµ{«×ªºÃþ¦ü³Æ¥÷ªº¥\®Ä¡A¦]¦¹¡A «Ü¾A¦X»Ý­n¤j¶q¦s¨ú¸ê®Æªº¥D¾÷¨t²Î¡C©Ò¥HÅo¡A¥Ø«e«Ü¦hªº½u¤WÀx¦s³]³Æ¡A °ò¥»¤W¡A³£¬O³z¹L RAID ¸Ë¸m¨Ó¹F¦¨ªº¡ã©³¤U§Ú­Ì´N¤j²¤ªº¨Ó¤¶²Ð¤@¤U¥Ø«e®¼¬y¦æªº iSCSI ¤¶­±ªºÀx¦s³]³Æ§a¡I( ¦pªG¹ï©ó Linux ¤W­±ªº RAID ¦³¿³½ì¡A ¥i¥H°Ñ¦Ò³o¤@½g¡Ghttp://www.tldp.org/HOWTO/ Software-RAID-HOWTO-1.html )


  • ¤p¼ÐÃDªº¹Ï¥ÜiSCSI ºÏºÐ°}¦Cªº¬[³]»P¨Ï¥Î
    ¥Ñ©ó¥ø·~ªº¸ê®Æ¶q¶V¨Ó¶V¤j¡A¦Ó¥B­«­n©Ê»P«O±K©Ê¶V¨Ó¶V°ª¡A¤×¨äÃþ¦ü¸ê®Æ®wªº¤º®e¡A «z¡I±`±`®e¶q³æ¦ì¬O¥H TB (1TB = 1024GB) ¦b¶i¦æ­pºâªº¡F¥i©È§a¡I ©Ò¥HÅo¡A¤W¤@­Ó¤p¸`¤º´£¨ìªººÏºÐ°}¦C (RAID) ªºÀ³¥Î´N«Ü­«­n¤F¡C ¤£¹L¡A RAID ²¦³º¥u¬O¦b¤@³¡¥D¾÷¤W­±ªºÀx¦s¸Ë¸m¡A¦pªG·Q­n´£¨Ñµ¹ºô¸ô¤W­±ªº¨ä¥L client ºÝ¨Ó¨Ï¥Î¡A¥i¯àÁٻݭn¥D¾÷´£¨Ñ¬ÛÃöªºªA°È¤~¦æ°Ú¡I¦Ó¥B¡A³z¹Lºô¸ô¥D¾÷¨Ó³s±µ¡A ®Ä¯à¤W¥i¯à¬O¥d¦bºô¸ô¶Ç¿é³t«×¡A¦Ó¤£¬O RAID ªº³t«×»¡¡C¦Ó¥B¡A RAID ¸Ë¦b¤@³¡¥D¾÷¤W­±®É¡A ¯à°÷´£¨Ñµ¹ client ºÝ¨Ï¥Îªº±¡ªp¦³­­°Õ¡ã¤j¦h¶È¬O¸ê®Æ¦Ó¤w¡C

  • NAS
  • ¬°¤F¸Ñ¨Mºô¸ôÀ³¥Î¤W­±ªº¡A«Ü¦h¼t°Ó´£¨Ñ¤F¤@¨Ç¤£¿ùªº·Qªk¡C­º¥ý¡A´N¬O¨º­Ó NAS (Network Attach Storage)¡A°ò¥»¤W¡A NAS ¨ä¹ê´N¬O¤@³¡«È¨î¤Æ¦nªº¥D¾÷¤F¡A ¥u­n±N NAS ³s±µ¤Wºô¸ô¡A¨º»ò¦bºô¸ô¤W­±ªº¨ä¥L¥D¾÷´N¯à°÷¦s¨ú NAS ¤WÀYªº¸ê®Æ¤F¡C ²³æªº»¡¡ANAS ´N¬O¤@³¡ file server (ÀɮצøªA¾¹) Åo¡ã ¤£¹L¡A NAS ¥Ñ©ó¤]¬O±µ¦bºô¸ô¤W­±¡A©Ò¥H¡A¦pªGºô¸ô¤W¦³¬Y­Ó client ¤j¶q¦s¨ú NAS ¤WÀYªº¸ê®Æ®É¡A ¬O«Ü®e©ö³y¦¨ºô¸ô°±¹yªº°ÝÃDªº¡A³o­Ó¤ñ¸û³Â·ÐÂI¡ã
    Tips:
    ¦b³¾­ôªº²z¸Ñ·í¤¤¡A NAS °ò¥»¤W´N¬O¤@³¡§¹¾ãªº¥D¾÷¡A ¥L¦³¿W¥ßªº§@·~¨t²Î»P¹Bºâ¡BÀx¦sµ¥³B²z³æ¤¸¡A¨ä¥Lªº client ºÝ¥u­n¯à°÷»P NAS ªº¨ó©w¬Û®e¡A¨º»ò¥L´N¯à°÷¦s¨ú NAS ¤WÀYªº¸ê®Æ°Ú¡I
    ³¾­ôªº¹Ï¥Ü
  • SAN
  • §Ú­Ì»Ý­n¤j¶qªº¦s¨ú¸Ë¸m¡A¥Øªº´N¬O¬°¤F­n±j¤Æ¦s¨ú®Ä¯à»PÁ`¥i¥Î®e¶q¡A²{¦bª¾¹DÁ`¥i¥Î®e¶q¥i¥H¨Ï¥Î RAID §Þ³N¨Ó¥[±j¡A¦ý¬O¦s¨ú®Ä¯à©O¡H³z¹Lºô¸ô¨Ó¦s¨ú®É¡A½T¹ê¥i¯à¾É­P¦s¨ú®Ä¯àªº§C¸¨°Ú¡C ¬°¤F¸Ñ¨M³o­Ó°ÝÃD¡A¦]¦¹«á¨Ó«Ü¦h¼t°Ó¶}µo¥X©Ò¿×ªº¥úÅÖ³q¹D¡C¥úÅÖ³q¹Dªº³t«×­n§Ö¤W«Ü¦h¡A ¥Ø«e¼Ð·Çªº¥úÅÖ³q¹D¬O 2GB ¡A¥¼¨ÓÁÙ¥i¯à¨ì¹F 10GB ¥H¤W©O¡ã ¤£¹L¡A¨Ï¥Î¥úÅÖµ¥§Þ³N¸û°ªªº³]³Æ¡A·íµM´N¤ñ¸û¶Q¤@¨Ç¡C §Q¥Î¥úÅÖ¡A°t¦X¤@¨ÇµwÅ骺¼Ð·Ç¤Æ¡A«á¨Ó¤@¨Ç¼t°Ó´£¥X¤F SAN (Storage Area Network) ¬[ºc¡F SAN §Q¥Î¸û°ª¶¥ªº¥úÅÖ³q¹D¨Ó¶i¦æ¥D¾÷»PÀx¦s³]³Æªº³s±µ¡A Åý¥D¾÷³z¹L¥úÅÖ¨Ó§Ö³t¦s¨úÀx¦s³]³Æ¤ºªº¸ê®Æ¡A¦Ó¤£¬O³z¹L¸ûºCªººô¸ô¬[ºc¡C ¦ý¬O SAN ¬[ºcªºªì³]¦¨¥»¤Ó¶Q¡A¦Ó¥BºûÅ@¶O¥Î»á°ª¡I

    «ô¤A¤Óºô¸ô²±¦æ¡A¥[¤W§Þ³N¦¨¼ô¤§½ç¡A²{¤µªº¤A¤Óºô¸ô´CÅé (ºô¸ô¥d¡B¥æ´«¾¹¡B¸ô¥Ñ¾¹µ¥µ¥³]³Æ) ¤w¸g¥i¥H¹F¨ì GB ªº³t«×¤F¡AÂ÷ SAN ªº¥úÅÖ³q¹D³t«×¨ä¹ê®t²§¤w¸gÁY¤p«Ü¦h°Õ¡ã ¨º»ò¬O§_§Ú­Ì¥i¥H³z¹L³o­Ó GB ªº¤A¤Óºô¸ô¨Ó¹F¨ìÃþ¦ü SAN ªº¥\®Ä©O¡H ¨S¿ù¡I³o´N¬O§Ú­Ì±µ¤U¨Ó­n´£¨ìªº iSCSI ¬[ºc°Õ¡I ^_^

  • iSCSI
  • ¨ä¹ê¡A¾ã­Ó iSCSI ªº¬[ºc¥D­n¤À¬°Àx¦s³]³Æ»P´£¨Ñ iSCSI ³s½uªº¥D¾÷ºÝ¡A ¦Ó iSCSI «h³z¹L¤A¤Óºô¸ô³sµ²Àx¦s³]³Æ»P¥D¾÷´N¬O¤F¡C ¨âªÌªºÃö«Y¦³ÂI¹³©³¤U³o­Ó¹Ï¥Ü¡G

    iSCSI ¬[ºc¹Ï
    ¹Ï¤@¡B iSCSI ªº¥D¾÷»PÀx¦s³]³ÆªºÃö«Y¡C

    ­º¥ý¡A±z¥²¶·­n¾Ö¦³ iSCSI ¤¶­±ªºÀx¦s³]³Æ (¼o¸Ü¡I¤£µM«ç»òª±¡H) ¡A µM«á¡A±zªº iSCSI Àx¦s³]³Æ¤W­±¥²¶·­n¨ã¦³ IP ¦ì§}¡A¨Ã¥BÀx¦s³]³Æ¥Hºô¸ô½u³sµ²¨ì¾Ö¦³ GB ³t«×ªº Switch ¤W¡C¦A¨Ó¡A±zªº¥D¾÷¥²¶·­n±Ò°Ê iSCSI ªºÅX°Êµ{¦¡¡A ÅX°Ê¥L¤§«á¡A¥L·|¨Ï¥Î TCP/IP ªººô¸ô¨ó©w³sµ²¨ìÀx¦s³]³Æ¤WÀY¡A ¨Ã¥B¡y±N¾ã­ÓÀx¦s³]³Æµø¬°¥D¾÷¤W­±ªº¤@­Ó SCSI µwºÐ¡zªº¼Ò¼Ë¡I ¤]´N¬O»¡¡A°ò¥»¤W¡AiSCSI ªºÀx¦s³]³Æ´N¬O±z¥D¾÷¤W­±ªº¤@­Ó¹êÅéµwºÐ¡A ¥u¬O³o­ÓµwºÐ¬O¥H iSCSI ¨ó©w¤Î TCP/IP ¨ó©w¨Ó¹F¦¨ªº¡C¦Ó¥B¡A¥L¦b¥D¾÷¤W­±ªº¨Ï¥Î¡A ´X¥G´N»P¹êÅé SCSI µwºÐ¨S¦³¨â¼Ë¡IºÏºÐ¥N¸¹«h¬° /dev/sda... ¡C

    ¸g¹L¤W­±ªº»¡©ú¡A§A¥i¥HÁA¸Ñ¨ì¡A¨ä¹ê¾ã­Ó iSCSI ªºÀx¦s³]³Æ¨Ã¤£¬O¤@­Ó§¹¾ãªº¥D¾÷³á¡A¥L¶È¬O¤@­ÓÀx¦s³]³Æ¡A ¸ò¤WÀY´£¨ìªº NAS ¨Ã¤£¬Û¦P¡A¤Ï¦Ó¦³ÂIÃþ¦ü SAN °Õ¡ã¦Ó¥B¡A³o­ÓÀx¦s³]³Æ¥i¥HÅý¥D¾÷§¹¾ã´x±±¡A ´X¥G´N»P¥D¾÷¤WÀYªº SCSI µwºÐ¨S¦³¨â¼Ë´N¬O¤F¡C

    ©³¤U³¾­ô¥H Promise ¤½¥q¥X«~ªº iSCSI ¸Ë¸m¨Ó¶i¦æ»¡©ú¡A ¸Ó iSCSI ¸Ë¸m¸Ì­±¤w¸g¦s¦b 10 Áû 250GB ªº SATA µwºÐ¡A¨ä¤¤¦³¤@Áû°µ¬°³Æ¥÷ (spare disk) ¡A ©Ò¥H¦@¦³¤EÁûµwºÐ§@¬° RAID-5 ªº¬[ºc¡C¦]¦¹¡A¾ã­Ó RAID ªº®e¶q«h¬ù²¤¬O¡G 250*(9-1)=2TB¡A¤£¹L¡A³o¼Ë¥u¬O¬ù²¤¦ô­p°Õ¡A¦]¬° 250GB µwºÐªº­pºâ¬O¥H 10 ¶i¦ì­pºâªº¡A ¸ò§Ú­Ì±`¨£ªººÏºÐ®e¶q­pºâ³æ¦ì¤£¬Û¦P¡C¤£¹L¡A«Ü±µªñ´N¬O¤F¡I ^_^

    ¦A¨Ó¡A¥Ñ©ó Promise ¤½¥q¨Ã¨S¦³´£¨Ñ Linux ¥D¾÷ªº iSCSI ÅX°Êµ{¦¡¡A©Ò¥H¡A ³¾­ô«h¥H Linux-iSCSI project ´£¨Ñªº¬ÛÃö¸ê°T¡A¨Ã¥H©³¤U³o¤@½g¬°°ò©³¡G http://www.cuddletech.com/articles/iscsi/index.html ¦w¸Ë³¾­ôªº Red Hat 9 Linux ªº iSCSI driver ¡C°ò¥»¤W¡A¦b¸Ó½g¤å³¹¤¤¡A Linux ¥D¾÷³QºÙ¬°¬O initiator ªº°Õ¡I
    Tips:
    ¨Æ¹ê¤W¡A¥Ñ©ó iSCSI Àx¦s³]³Æ»P Linux ¥D¾÷¤§¶¡¡A¬O³z¹L TCP/IP ¨ó©w¡A ¥ç§Yºô¸ô¨Ó¶i¦æ¸ê®Æªº¦s©ñ¡A¦]¦¹¡A±z¦Ü¤Ö¥²¶·­n¨ã³Æ°ò¦ªººô¸ô°ò¦ª¾ÃѤ~¦æ¡ã ¤£¹L¡A³o¤@½g¹ê¦b®¼¦³½ìªº¡A¦Ó³æ¿W¼g¤@½g¦øªA¾¹¡A¦ü¥G¤]¨S¦³¨º­Ó¥²­n¡A ©Ò¥H¡A´NÅý³¾­ô©ñ¨ì³o­Ó¦a¤è¨Ó¤F¡ã©Ò¥HÅo¡A¦pªG±z¥Ø«e¬Ý¤£À´¤]¨SÃö«Y°Õ¡F ¦Ó¥B¡A³¾­ô¤]¬O­è¦n¦³¾÷·|±µÄ²¨ì iSCSI ªº³]³Æ¤~¯à°÷ª±³o¤@½g°Ú¡I¨þ¨þ¡ã ¨ä¹êÁÙ®¼°ª¿³ªº¡I ^_^
    ³¾­ôªº¹Ï¥Ü
    °ò¥»¤W¡A³¾­ôªºÀô¹Ò¬[ºc¬O³o¼Ëªº¡G
    • Linux ¥D¾÷¡G

    • iSCSI Àx¦s³]³Æ¬[ºc¡G
      • «¬¸¹¬°PROMISE M500i ¡A¨Ï¥Î iSCSI ¾÷«¬¡F
      • ¨Ï¥Î 10 ÁûµwºÐ¡A1 Áû¬° spare disk¡A¨ä¾l 9 Áû°µ¦¨ RAID-5¡F
      • IP¡GiSCSI Àx¦s³]³Æªº IP ¬° 192.168.10.200
      • ³s±µ¨ìÀx¦s³]³Æªº±b¸¹»P±K½X¤À§O¬°¡G account/iscsipw
    ¬ÛÃöªº iSCSI ¸Ë¸m¡Bºô¸ô±µ½uªº³sµ²¡A¥H¤Î GB switch ªº¿ïÁÊ»P³sµ²µ¥µ¥¡A ½Ð»P¬ÛÃöªºµwÅé¼t°ÓÁpô¡A¥L­Ì·|À°¦£·d©wªº¡ã§Ú­Ì­n§@ªº¡A¶È¬O¦b Linux ¥D¾÷¤W­±¦w¸ËÅX°Êµ{¦¡¡A ¨Ã¥B±N¥L±¾¸ü°_¨Ó´N¬O¤F¡C¨ä¹ê¡A·í iSCSI RAID ¨ì±z©²¤W®É¡A¦w¸Ë¦n¤§«á¡A §Ú­Ì´N¤£»Ý­n°Ê¥Lªº³]©w¤F¡ã¦]¬°¥L¶È´£¨ÑÀx¦sªÅ¶¡¹À¡I¥u­n±±¨î Linux ¥D¾÷ºÝ§Y¥i°Õ¡I ¾ã­Ó¦w¸Ëªº¨BÆJ¦³ÂI¹³³o¼Ë¡G

    1. ¤U¸ü¾A·íªºÅX°Êµ{¦¡¡G

      ¥Ñ©ó³¾­ôªº´ú¸Õ¾÷¨Ï¥Îªº¬O Red Hat 9 ¡A¥Lªº®Ö¤ß¬O 2.4.xx ª©¥»¡A ©Ò¥H¡A§Ú¤U¸üªº¬O 3.6.3 ªºª©¥»¡A·íµM¡A§A¤]¥i¥Hª½±µ¤U¸üµ¹ Red Hat 9 ¨Ï¥Îªº RPM ÀÉ®×°Ú¡I¡G




    2. ¶}©l¦w¸Ë iSCSI ÅX°Êµ{¦¡¡G

      iSCSI ªºÅX°Êµ{¦¡¦w¸Ë¯uªº«Ü²³æ°Ú¡I§Ú­Ì­è­è¤U¸üªºÀɮשñ¸m¨ì /usr/local/src «á¡A µM«áª½±µ¸ÑÀ£ÁY¡A¤§«á±N¥Lª½±µ¶i¦æ make »P make install §Y¥i¡I ³¾­ô³o¸ÌÁ¿±o«Ü²³æ¡A­Y¦³»Ý­n§ó¸Ô²Óªº tarball ¦w¸Ë»¡©ú¡A½Ð°Ñ¦Ò ­ì©l½X»P tarball ¨º­Ó³¹¸`°Ú¡I ¦¹¥~¡A¥Ñ©ó iSCSI ¬O¤@ºØÅX°Êµ{¦¡¡A¦]¦¹¡A¥L·|Ū¨ú Linux kernel ªº¬ÛÃö­ì©l½XÀɮסA ©Ò¥H¡A§A¤]¥²¶·­n½T»{§Aªº¨t²Î¤W­±½T¹ê§t¦³ Linux kernel ¦b /usr/src/linux ¥Ø¿ý¤U¤~¦æ¡I ³o¤]¬O«Ü­«­nªº¤@¶µ·Ç³Æ¤u§@³á¡I
      1. ¥ý¶i¦æ¸ÑÀ£ÁYªº°Ê§@¡G
      [root@linux ~]# cd /usr/local/src
      [root@linux src]# tar -zxvf linux-iscsi-3.6.3.tgz
      [root@linux src]# cd linux-iscsi-3.6.3c
      
      
      2. ¶}©l¶i¦æ½sĶ»P¦w¸Ë
      [root@linux linux-iscsi-3.6.3]# make clean && make
      [root@linux linux-iscsi-3.6.3]# make install
      # ­º¥ý¡A·|¦³¤@¨ÇÃö©ó®Ö¤ß¤è­±ªº¬ÛÃö»¡©ú¡A³o¸Ì¬Ý¬Ý§Y¥i¡I
      Note: using kernel source from /lib/modules/2.4.20-8smp/build containing
      kernel version 2.4.20-8custom
      Note: using kernel config from /boot/config-2.4.20-8smp
      Installing iSCSI driver for Linux 2.4.20-8smp
      
      # ¦A¨Ó¡A«h·|¦w¸Ë±Ò°Ê iSCSI ªº script ¡A¹w³]©ñ¸m¨ì /etc/rc.d/init.d/iscsi ¥h¡I
      # ¦P®Éª`·N¤@¤U¡A³o­Óµ{§Ç·|¦Û°Êªº¥[¤J¨ì chkconfig ªººÞ²z¶µ¥Ø·í¤¤¡A¦]¦¹¡A
      # ¦w¸Ë¦nªº¦P®É¡A³o­Ó iscsi ´N·|¦b¶}¾÷®É¥D°Êªº±Ò°Ê¤F¡C
      The initialization script has been installed as /etc/rc.d/init.d/iscsi.
      iSCSI has been set up to run automatically when you reboot.
      
      # ¦P®É¡A·|±N§Ú­Ìªº Linux ¥D¾÷¼ÒÀÀ¦¨¬° CISCO ªº iSCSI
      # ¨ó©wªº±µ¨ü¾¹¡A¬ÛÃöªº³]©w¸ê®Æ·|³Q¼g¤J¨ì /etc/initiatorname.iscsi ·í¤¤¡C
      InitiatorName iqn.1987-05.com.cisco:01.d1dbb1112d38 has already been
      generated and written to /etc/initiatorname.iscsi.
      
      # ±µ¤U¨Ó³o­ÓÀɮפ~¬O§Ú­Ì©ÒÃö¤ßªº¡I¨º´N¬O³sµ²¨ì iSCSI Àx¦s¸Ë¸mªº³]©wÀÉ¡I
      # §A¥²¶·­n®Ú¾Ú§Aªº¸Ë¸m¨Óµ¹¤©¬ÛÃöªº­×§ï«á¡A¥L¤~·|¶¶§Q¤u§@³á¡I
      Make sure you check and edit the /etc/iscsi.conf file!
      
      
      3. ¶}©l¶i¦æ­×§ïªº¤u§@¡G
      [root@linux ~]# vi /etc/iscsi.conf
      # ¦b³o­ÓÀÉ®×·í¤¤·s¼W©³¤U³o´X¦æ¡Aª`·N¡A±b¸¹¡B±K½X»P IP §¡»Ý½T©w¥¿½T³á¡I
      Username=account
      Password=iscsipw
      DiscoveryAddress=192.168.10.200
        Username=account
        Password=iscsipw
      
      
      4. ¶}©l±Ò°Ê iscsi Åo¡I
      [root@linux ~]# /etc/init.d/iscsi start
      Starting iSCSI: iscsi iscsid fsck/mount
      
      [root@linux ~]# vi /var/log/messages
      iscsid[3208]: version 3.6.3.0 variant (27-Jun-2005)
      iscsid[3208]: root development build created Mon Jun 27 14:34:43 CDT 2005
      iscsid[3209]: INBP boot check returned this_is_inbp_boot = 0
      iscsid[3212]: Connected to Discovery Address 192.168.10.200
      kernel: iSCSI: bus 0 target 0 = iqn.1994-12.com.promise.target.3b.31.
      	4.55.1.0.0.20
      kernel: iSCSI: bus 0 target 0 portal 0 = address 192.168.10.200 port 
      	3260 group 2
      kernel: iSCSI: bus 0 target 0 trying to establish session f5ad6000 to
      	 portal 0, address 192.168.10.200 port 3260 group 2
      kernel: iSCSI: bus 0 target 0 established session f5ad6000 #1 to portal 
      	0, address 192.168.10.200 port 3260 group 2, alias VTrak M500i
      kernel: scsi singledevice 0 0 0 0
      kernel:   Vendor: Promise   Model: VTrak M500i       Rev: 1122
      kernel:   Type:   Direct-Access                      ANSI SCSI revision: 04
      kernel: Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
      kernel: SCSI device sda: 3890624512 512-byte hdwr sectors (1992000 MB)
      kernel:  sda:
      # ¬Ý¨ì¤F¶Ü¡H¨S¿ù¡I½T¹ê¦³³s±µ¨ì¥¿½TªºÀx¦s¦ì¸m¤F¡ã
      # ¦Ó¥B®»¨ìªº¬O sda ³o­Ó¸Ë¸m¥N¸¹³á¡I®e¶q¥i¦³ 1992000MB ³o»ò¤j¡I
      # µM«á§Ú­Ì¨Ó¬Ý¬Ý¨t²Î¬O§_¯à°÷®»¨ì³o­Ó¸Ë¸m©O¡H
      
      [root@linux ~]# fdisk -l
      Disk /dev/sda: 1991.9 GB, 1991999750144 bytes
      64 heads, 32 sectors/track, 1899719 cylinders
      Units = cylinders of 2048 * 512 = 1048576 bytes
      
         Device Boot    Start       End    Blocks   Id  System
      
      [root@linux ~]# iscsi-ls
      *******************************************************************************
              SFNet iSCSI Driver Version ... 3.6.3 (27-Jun-2005 )
      *******************************************************************************
      TARGET NAME             : iqn.1994-12.com.promise.target.3b.31.4.55.1.0.0.20
      TARGET ALIAS            : VTrak M500i
      HOST NO                 : 0
      BUS NO                  : 0
      TARGET ID               : 0
      TARGET ADDRESS          : 192.168.10.200:3260
      SESSION STATUS          : ESTABLISHED AT Thu Nov 10 20:13:43 2005
      NO. OF PORTALS          : 1
      PORTAL ADDRESS 1        : 192.168.10.200:3260,2
      SESSION ID              : ISID 00023d000001 TSIH 04
      *******************************************************************************
      # ¬Ý¨ì¤F§a¡H¨Ï¥Î fdisk -l ¥i¥H¬Ý¨ì¦WºÙ¬° /dev/sda ªº¸Ë¸m¡A¨Ï¥Î iSCSI
      # ´£¨Ñªº iscsi-ls ¤]¥i¥H¬d¸ßªº¨ì¬ÛÃöªº¸ê°T©O¡I¯u¬O«Ü¤£¿ù°Ú¡I
      
      
      5. ¤À³Î /dev/sda »P®æ¦¡¤Æ¡I
      [root@linux ~]# fdisk /dev/sda
      Command (m for help): n
      Command action
         e   extended
         p   primary partition (1-4)
      p
      Partition number (1-4): 1
      First cylinder (1-1899719, default 1):
      Using default value 1
      Last cylinder or +size or +sizeM or +sizeK (1-1899719, default 1899719):
      Using default value 1899719
      Command (m for help): w
      
      [root@linux ~]# mke2fs -j /dev/sda1
      
      ¸g¹L³o­Ó²³æªº°Ê§@¡A§Úªº Linux ¥D¾÷¤w¸g®»¨ì iSCSI Àx¦s¸Ë¸m¡A ¨Ã¥B¡A¥L´N¦n¹³¬O§Ú¦Û¤v Linux ¥»¾÷¤W­±ªº¤@­Ó SCSI µwºÐ¤@¼Ë¡I ¨Ï¥Îªº¤è¦¡´X¥G¤@¼Ò¤@¼Ë¡ã¨S¦³®t²§©O¡I¯u¬O¤Ó¤è«K¤F¡ã±µ¤U¨Ó¡A·íµM´N¬O­n±¾¸ü°Õ¡I


    3. ³]©w±¾¸ü¡G

      °²³]§Úªº³o³¡ iSCSI ¥D¾÷­n±¾¸ü¨ì /cluster/raid ³o­Ó¥Ø¿ý¤U¡A¨º»ò§Ú´N³o¼Ë°µ¡G
      [root@linux ~]# mkdir /cluster/raid
      [root@linux ~]# mount -t ext3 /dev/sda1 /cluster/raid
      [root@linux ~]# df
      Filesystem           1K-blocks      Used Available  Use% Mounted on
      /dev/hda1             10080488   2950408   6618012   31% /
      /dev/hda2              5036316     81172   4699312    2% /var
      /dev/hda3              3020172     33492   2833260    2% /tmp
      none                    773736         0    773736    0% /dev/shm
      /dev/sda1            1914788196  27040372 1790482212  2% /cluster/raid
      
      «Ü¦³½ì§a¡I³o¼Ë´N¯à°÷±N iSCSI ±¾¸ü¨ì§Ú­Ìªº¾÷¾¹¤WÅo¡ã


    4. ³]©w¦Û°Ê±¾¸ü¡G

      ¤£¹L¡A¦pªG§A·Q­nÅý¨t²Î¦Û°Ê±¾¸ü iSCSI ¸Ë¸mªº¸ê®Æ¡A¸Ó¼g¤J­þ¸Ì¡H ·íµM¤£¥i¯à¬O /etc/fstab Åo¡ã¦]¬°¦b¸ü¤J /etc/fstab ¤§«e¡A®Ú¥»´NÁÙ¨S¦³ÅX°Êºô¸ô¡A ©Ò¥H¡A·íµM¤£¥i¯à¼g¤J /etc/fstab ¡C¦n¦b¡A§Ú­Ìªº iSCSI ¦³´£¨Ñ¤£¿ùªº¼Ò²Õ¡A §A¥i¥Hª½±µ­×§ï /etc/fstab.iscsi ³o­ÓÀɮסA±N¥L³]©w¦¨¬°¡G
      [root@linux ~]# vi /etc/fstab.iscsi
      /dev/sda1   /cluster/raid   ext3    defaults     0   0
      
      ¦p¦¹¤@¨Ó¡A¶}¾÷´N·|¦Û°Êªº±¾¸ü¸Ó iSCSI ªº¸Ë¸m°Õ¡I´N¬O³o»ò²³æ°Ú¡I^_^
    ³¾­ô¬O¥Ñ©ó¬ã¨s«Ç¦³¤@³¡ iSCSI ªº Raid ¤~¦³¥i¯à±µÄ²¨ì³o»ò°ªÀɪº³f¦â¡ã ¯u¬Oı±o«Ü¶}¤ß¡I¾ã­Ó iSCSI ªº³]©w¨Ã¤£§xÃø¡A·íµM¡A­n¹F¦¨§ó°ª®Ä²vªºÅª¼g¸ê®Æ¡A ¥i¯àÁÙ¬O»Ý­n¶i¤@¨Bªº¬ã¨s°Õ¡I´£¨Ñµ¹±z§@¬°¤@­Ó³]©wªº°Ñ¦ÒÅo¡I ^_^

    ¤j¼ÐÃDªº¹Ï¥Ü°Ñ¦Ò¤åÄm

    ¤j¼ÐÃDªº¹Ï¥Ü²ßÃD½m²ß
    ( ­n¬Ýµª®×½Ð±N·Æ¹«²¾°Ê¨ì¡yµª¡G¡z©³¤UªºªÅ¥Õ³B¡A«ö¤U¥ªÁä°é¿ïªÅ¥Õ³B§Y¥i¹î¬Ý)
    • ¦p¦ó«Ø¥ß /dev/usb/lp8¡H
    • ­º¥ý¡A¥²¶·­n¬d¾\±o¸Ó¸Ë¸mªº¥D­n¸Ë¸m¥N¸¹¡A¥ç§Y 180¡A¦Ü©ó¦¸­n¥N¸¹«h¬O 8 ¡A ¦A¨Ï¥Î mknod ¨Ó«Ø¥ß¡A¦]¦¹¡A»Ý­n³o¼Ë°µ¡G
      mknod /dev/usb/lp8 c 180 8
      chown root:lp /dev/usb/lp8
      chmod 660 /dev/usb/lp8
    • ¦p¦ó¨Ï¥Î lm_sensors °»´ú¥D¾÷¤ºªº·Å«×¡A¸Ô²Ó»¡©ú¾ã­Ó¨BÆJ¡H
      • ¥ý½T©w±zªº¥D¾÷ªO¨ã¦³·Å«×»P¹qÀ£µ¥°»´ú´¹¤ù¡A¥i¨Ï¥Î lspci Àˬd´¹¤ù²Õ¡F
      • ¶}¾÷¶i¤J BIOS «á¡A¬d¸ß¤@¤U¬O§_¨ã¦³µwÅé°»´ú·Å«×¡B¹qÀ£ªº¶µ¥Ø¡A±N¿é¥Xªº¶µ¥Ø¶¶§Ç°O¤@¤U¡F
      • ½T©w Linux ¤w¸g¦w¸Ë¤F lm_sensors¡A¦A¨Ï¥Î sensors-detect Àˬd©Ò»Ý­nªº³]©w¶µ¥Ø¡F
      • ¨Ì¾Ú¤W­Ó¨BÆJ¡A³]©w /etc/modprobe.conf ¤Î /etc/rc.d/rc.local ¨â­ÓÀɮסF
      • ¨Ï¥Î chkconfig Åý lm_sensors ¶}¾÷±Ò°Ê¡A¨Ã¥B­«·s¶}¾÷ (reboot)¡F
      • ¶}©l¨Ï¥Î sensors ¶i¦æ°»´ú¡A¤]¥i¥H¹Á¸Õ­×§ï /etc/sensors.conf ªº¤º®e¡A¥H²Å¦X¹ê»Úª¬ªp¡C
    • §Ú­ì¥»ªº Linux ¨t²Î¨Ï¥Î 80GB ªºµwºÐ¡A¤À¦¨ /dev/hda1(/), /dev/hda2(/home), /dev/hda3(swap)¡A ²{¦b§Ú·Q­n±N©Ò¦³ªº¸ê®Æ³q³q·h²¾¨ì¥t¤@Áû 250GB ªºµwºÐ¤W­±¥h¡A©Ò¦³ªº¸ê®Æ³£¤£­n§ïÅÜ¡A §Ú·Q­n§Q¥Î dd, fdisk, mke2fs, resize2fs µ¥«ü¥Oªº»²§U¡A¥i¥H¦p¦ó¤u§@¡H
    • ³o­Ó°ÝÃD«Ü¦³½ì³á¡I«Øij§A¥i¥H¥ý°Ñ¦Ò³o¤@½g¡G http://www.l-penguin.idv.tw/article/dd-sys-backup.htm ¡A¥D­nªº¤u§@¥i¥H³o¼Ë°µ¡G
      • ¥ý¥H fdisk ±N 250GB ªºµwºÐ¤À³Î¦¨¬° 3 ­Ó partitions ¡A ­Ó§O¹ïÀ³¨ì /dev/hda1, /dev/hda2, /dev/hda3 ¡A¥²¶·­nª`·N¡A «á¨Óªº·sµwºÐªº partition ¥²¶·­n¤j©ó­ì¥»ªº¡I
      • §Q¥Î mke2fs ±N«á¨Ó·sµwºÐªº 1, 2 partitions ®æ¦¡¤Æ¡I
      • §Q¥Î¡y dd if=/dev/hda1 of=/dev/hdb1 ¡z±N¸ê®Æ¶}©l½Æ»s¡I
      • ¨Ï¥Î fsck Àˬd /dev/hdb1, /dev/hdb2 ¨â­Ó partition¡F
      • §Q¥Î¥»³¹¾Ç¨ìªº resize2fs ¥h®Õ¥¿³Ñ¤UªººÏºÐªÅ¶¡¡G¡yresize2fs /dev/hdb1¡z
      • ¥ÎºÉ¦UºØ¤èªk±N grub ´Ó¤J /dev/hdb ·í¤¤¡I¦¨¥\¡I·d©w¡I ^_^

    2005/10/25¡G·Ç³Æ·Ç³Æ¡ã¼g¤@¨Ç¸òµwÅé¤ñ¸û¦³Ãö«Yªº¸ê®Æ¡I
    2005/11/08¡G·Ç³Æ§¹²¦ USB »P lm_sensors ªº³¡¤À¤F¡ã°Ú¡I©ì¤F¯u¤[¡ãÁÙ¦³ RAID ªº»¡©ú¤]®t¤£¦h­ù¡I
    2005/11/09¡G¥[¤J¤F FC4 ªº setup «ü¥O¡A¤×¨ä¬O¦Lªí¾÷ªº³¡¤À¡A¥i¥H°Ñ¦Ò°Ñ¦Ò¡I
    2005/11/10¡G²×©ó±N iSCSI ªº¸Ë¸m¼g¦n¤F¡ã³o³¡¥÷¯uªº¬O«Ü¦³½ì¡I¤£¹L¡A¤@¯ë¨Ï¥ÎªÌ¥i¯à¸I¤£¨ì´N¬O¤F¡C
    2005/11/13¡G²×©ó±N CUPS ¬[ºc³]©w¦n¦Û¤vªº Printer ³¡¤À¤F¡I
    2005/11/14¡G³s¦P LVM ¤]¤j­Pªºµ¹¥L¼g§¹¤F¡I¨º­Ó resize2fs «ü¥O½T¹ê¦³½ì¡I
    2005/11/25¡G¥[¤J¤@­Ó²³æªº½m²ßÃD¡ã§Q¥Î dd °t¦X resize2fs ¨Ó»s§@³Æ¥÷ªº¸ê®Æ¡I
    ¡@
    ¡@ ¡@ ¡@
    | ÁcÅé¥D¯¸ | ²Åé¥D¯¸ | °ò¦½g | ¦øªA¾¹ | ¥ø·~À³¥Î | ®à­±À³¥Î | ¦w¥þºÞ²z | °Q½×ªO | »Å¾Ç¶é | ®ÑÄy·`»~ | ³¾­ô§Ú | ±X¤s¸ê¶Ç |
    ¥»ºô­¶¥D­n¥H firefox °t¦X¸ÑªR«× 1024x768 §@¬°³]­p¨Ì¾Ú
    http://linux.vbird.org is designed by VBird during 2001-2011. ksu.edu