22.7. ¥Ç¥£¥¹¥¯¥ì¥¹²ÔƯ

¹¹¿·: Jean-François Dockès.

Ìõ: ÎëÌÚ ¹¯½¤

FreeBSD ¥Þ¥·¥ó¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¤òÄ̤¸¤Æµ¯Æ°¤Ç¤­¡¢ ¤½¤·¤Æ NFS ¥µ¡¼¥Ð¤«¤é¥Þ¥¦¥ó¥È¤·¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò»ÈÍѤ·¤Æ¡¢ ¥í¡¼¥«¥ë¥Ç¥£¥¹¥¯¤Ê¤·¤ÇÆ°ºî¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ɸ½à¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤òÊѹ¹¤¹¤ë°Ê¾å¤Î¡¢¥·¥¹¥Æ¥à¤Î½¤Àµ¤ÏɬÍפ¢¤ê¤Þ¤»¤ó¡£ ɬÍפÊÍ×ÁǤΤ¹¤Ù¤Æ¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢ ¤³¤Î¤è¤¦¤Ê¥·¥¹¥Æ¥à¤òÀßÄꤹ¤ë¤Î¤Ï´Êñ¤Ç¤¹¡£

¥Ç¥£¥¹¥¯¥ì¥¹¥ï¡¼¥¯¥¹¥Æ¡¼¥·¥ç¥ó¤òÀßÄꤹ¤ëÊýË¡¤Ï¤¤¤í¤¤¤í¤¢¤ê¤Þ¤¹¡£ ¿¤¯¤ÎÍ×ÁǤ¬´Ø¤ï¤Ã¤Æ¤ª¤ê¡¢ ¤½¤Î¿¤¯¤Ï¥í¡¼¥«¥ë¤Î¾õ¶·¤Ë¹ç¤ï¤»¤Æ¥«¥¹¥¿¥Þ¥¤¥º¤Ç¤­¤Þ¤¹¡£²¼µ­¤Ï¡¢ ñ½ã¤µ¤Èɸ½à¤Î FreeBSD µ¯Æ°¥¹¥¯¥ê¥×¥È¤È¤Î¸ß´¹À­¤ò¶¯Ä´¤·¤¿´°Á´¤Ê¥·¥¹¥Æ¥à¤ÎÀßÄê¤òÀâÌÀ¤·¤Þ¤¹¡£ µ­½Ò¤µ¤ì¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤ÎÆÃħ¤Ï¼¡¤Î¤È¤ª¤ê¤Ç¤¹¡£

注意µ­½Ò¤µ¤ì¤Æ¤¤¤ë¤È¤ª¤ê¡¢ ¤³¤Î¥·¥¹¥Æ¥à¤Ï°ÂÁ´¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ ¥Í¥Ã¥È¥ï¡¼¥¯¤ÎÊݸ¤ì¤¿ÈϰϤǻÈÍѤµ¤ì¤ë¤Ù¤­¤Ç¤¢¤ê¡¢ ¾¤Î¥Û¥¹¥È¤«¤é¿®Íꤵ¤ì¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£

22.7.1. ¥»¥Ã¥È¥¢¥Ã¥×¤Î¼ê½ç

22.7.1.1. DHCP/BOOTP ¤ÎÀßÄê

¥Í¥Ã¥È¥ï¡¼¥¯¤òÄ̤¸¤ÆÀßÄê¤ò¼èÆÀ¤·¡¢ ¥ï¡¼¥¯¥¹¥Æ¡¼¥·¥ç¥ó¤òµ¯Æ°¤¹¤ë¤¿¤á¤Ë°ìÈÌŪ¤Ë»ÈÍѤµ¤ì¤ë¥×¥í¥È¥³¥ë¤Ë¤Ï¡¢ BOOTP ¤È DHCP ¤Î 2 ¤Ä¤¬¤¢¤ê¤Þ¤¹¡£ ¤½¤ì¤é¤Ï¥ï¡¼¥¯¥¹¥Æ¡¼¥·¥ç¥ó¤Î¥Ö¡¼¥È¥¹¥È¥é¥Ã¥×»þ¤Ë²¿¥õ½ê¤«¤Ç»ÈÍѤµ¤ì¤Þ¤¹¡£

  • etherboot ¤Ï¥«¡¼¥Í¥ë¤ò¸«¤Ä¤±¤ë¤¿¤á¤Ë DHCP (¥Ç¥Õ¥©¥ë¥È) ¤Þ¤¿¤Ï BOOTP (ÀßÄꥪ¥×¥·¥ç¥ó¤¬É¬Í×) ¤ò»ÈÍѤ·¤Þ¤¹ (PXE ¤Ï DHCP ¤ò»ÈÍѤ·¤Þ¤¹) ¡£

  • NFS ¥ë¡¼¥È¤Î¾ì½ê¤òÄê¤á¤ë¤¿¤á¤Ë¥«¡¼¥Í¥ë¤Ï BOOTP ¤ò»ÈÍѤ·¤Þ¤¹¡£

BOOTP ¤À¤±¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë¥·¥¹¥Æ¥à¤òÀßÄꤹ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£ bootpd(8) ¥µ¡¼¥Ð¥×¥í¥°¥é¥à¤Ï FreeBSD ¤Î¥Ù¡¼¥¹¥·¥¹¥Æ¥à¤Ë´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£

¤·¤«¤·¤Ê¤¬¤é¡¢DHCP ¤Ë¤Ï BOOTP ¤Ë¾¡¤ëÅÀ¤¬Â¿¡¹¤¢¤ê¤Þ¤¹¡£ (¤è¤ê¤è¤¤ÀßÄê¥Õ¥¡¥¤¥ë¡¢PXE ¤¬»È¤¨¤ë¤³¤È¡¢ ¤½¤·¤Æ¥Ç¥£¥¹¥¯¥ì¥¹²ÔƯ¤Ë¤ÏľÀÜ´Ø·¸¤·¤Ê¤¤Â¿¤¯¤ÎĹ½ê) ¤³¤³¤Ç¤Ï BOOTP ¤À¤±ÍøÍѤ¹¤ë¾ì¹ç¤È¡¢ BOOTP ¤È DHCP ¤òÁȤ߹ç¤ï¤»¤¿ÀßÄê¤ò°·¤¤¤Þ¤¹¡£ÆÃ¤Ë ISC DHCP ¥½¥Õ¥È¥¦¥§¥¢¥Ñ¥Ã¥±¡¼¥¸¤òÍøÍѤ¹¤ë¸å¼Ô¤ÎÊýË¡¤Ë½ÅÅÀ¤ò¤ª¤­¤Þ¤¹¡£

22.7.1.1.1. ISC DHCP ¤ò»ÈÍѤ¹¤ëÀßÄê

isc-dhcp ¥µ¡¼¥Ð¤Ï¡¢ BOOTP ¤ª¤è¤Ó DHCP ¥ê¥¯¥¨¥¹¥È¤ÎξÊý¤ËÅú¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

4.4-RELEASE ¤Î»þÅÀ¤Ç isc-dhcp 3.0 ¤Ï¥Ù¡¼¥¹¥·¥¹¥Æ¥à¤Î°ìÉô¤Ç¤Ï̵¤¯¤Ê¤ê¤Þ¤·¤¿¡£ ¤Þ¤º¤Ï¤¸¤á¤Ë net/isc-dhcp3-server port ¤Þ¤¿¤ÏÂбþ¤¹¤ë package ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ëɬÍפ¬¤¢¤ë¤Ç¤·¤ç¤¦¡£ ports ¤ª¤è¤Ó package ¤Ë´Ø¤¹¤ë°ìÈÌŪ¤Ê¾ðÊó¤Ë¤Ä¤¤¤Æ¤Ï 第5章 ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

isc-dhcp ¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤ë¤È¡¢ Æ°ºî¤¹¤ë¤¿¤á¤ËÀßÄê¥Õ¥¡¥¤¥ë¤òɬÍפȤ·¤Þ¤¹ (Ä̾ï /usr/local/etc/dhcpd.conf ¤¬»ØÄꤵ¤ì¤Þ¤¹) ¡£ ²¼µ­¤Ë¥³¥á¥ó¥È¤ò´Þ¤á¤¿Îã¤ò¼¨¤·¤Þ¤¹¡£


          default-lease-time 600;
          max-lease-time 7200;
          authoritative;

          option domain-name "example.com";
          option domain-name-servers 192.168.4.1;
          option routers 192.168.4.1;

          subnet 192.168.4.0 netmask 255.255.255.0 {
            use-host-decl-names on; (1)
            option subnet-mask 255.255.255.0;
            option broadcast-address 192.168.4.255;

            host margaux {
              hardware ethernet 01:23:45:67:89:ab;
              fixed-address margaux.example.com;
              next-server 192.168.4.4;(2)
              filename "/tftpboot/kernel.diskless";(3)
              option root-path "192.168.4.4:/data/misc/diskless";(4)
            }
          }
(1)
¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï host Àë¸À¤ÎÃͤò¡¢ ¥Ç¥£¥¹¥¯¥ì¥¹¥Û¥¹¥È¤Ø¤Î¥Û¥¹¥È̾¤È¤·¤ÆÁ÷¤ë¤è¤¦¤Ë dhcpd ¤Ë»Ø¼¨¤·¤Þ¤¹¡£ Ê̤ÎÊýË¡¤È¤·¤Æ¡¢¥Û¥¹¥ÈÀë¸ÀÆâ¤Ë option host-name margaux ¤ò²Ã¤¨¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡£
(2)
TFTP ¥µ¡¼¥Ð¤ò next-server ¥Ç¥£¥ì¥¯¥Æ¥£¥Ö¤Ë»ØÄꤷ¤Þ¤¹ (¥Ç¥Õ¥©¥ë¥È¤Ï DHCP ¥µ¡¼¥Ð¤ÈƱ¤¸¥Û¥¹¥È¤ò»È¤¤¤Þ¤¹)¡£
(3)
¥«¡¼¥Í¥ë¤È¤·¤Æ etherboot ¤¬Æɤ߹þ¤à¥Õ¥¡¥¤¥ë¤ò filename ¥Ç¥£¥ì¥¯¥Æ¥£¥Ö¤Ë»ØÄꤷ¤Þ¤¹¡£

注意: PXE ¤ÏÁêÂÐŪ¤Ê¥Õ¥¡¥¤¥ë̾¤ò¹¥¤à¤è¤¦¤Ç¤¹¡£ ¤Þ¤¿¡¢¥«¡¼¥Í¥ë¤Ç¤Ï¤Ê¤¯ pxeboot ¤òÆɤ߹þ¤ß¤Þ¤¹ (option filename "pxeboot")¡£

(4)
¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ø¤Î¥Ñ¥¹¤ò¡¢ Ä̾ï¤Î NFS ½ñ¼°¤Ç root-path ¥ª¥×¥·¥ç¥ó¤Ë»ØÄꤷ¤Þ¤¹¡£

22.7.1.1.2. BOOTP ¤ò»ÈÍѤ¹¤ëÀßÄê

³¤±¤Æ¡¢bootpd ¤ÇƱÅù¤Î¤³¤È¤ò¤¹¤ëÀßÄê¤Ç¤¹¡£ ¤³¤ì¤Ï /etc/bootptab ¤Ë¤ª¤­¤Þ¤¹¡£

BOOTP ¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¤Ê¤¤ NO_DHCP_SUPPORT ¥ª¥×¥·¥ç¥óÉÕ¤­¤Ç etherboot ¤ò¥³¥ó¥Ñ¥¤¥ë¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤È¡¢PXE ¤Ï DHCP ¤ò ɬÍ× ¤È¤¹¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£ bootpd ¤ÎÍ£°ìÌÀÇò¤ÊÍøÅÀ¤Ï¡¢ ¤³¤ì¤¬¥Ù¡¼¥¹¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¤È¤¤¤¦¤³¤È¤Ç¤¹¡£


          .def100:\
            :hn:ht=1:sa=192.168.4.4:vm=rfc1048:\
            :sm=255.255.255.0:\
            :ds=192.168.4.1:\
            :gw=192.168.4.1:\
            :hd="/tftpboot":\
            :bf="/kernel.diskless":\
            :rp="192.168.4.4:/data/misc/diskless":

          margaux:ha=0123456789ab:tc=.def100

22.7.1.2. Etherboot ¤òÍѤ¤¤ë¥Ö¡¼¥È¥×¥í¥°¥é¥à¤Î½àÈ÷

Etherboot ¤Î¥¦¥§¥Ö¥µ¥¤¥È ¤Ë¤Ï¼ç¤Ë Linux ¥·¥¹¥Æ¥à¤Ë¤Ä¤¤¤Æ½Ò¤Ù¤¿ ¹­ÈϰϤÎʸ½ñ ¤¬´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£ ¤·¤«¤·¡¢¤½¤ì¤Ë¤â¤«¤«¤ï¤é¤ºÍ­ÍѤʾðÊó¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£ ²¼µ­¤Ï FreeBSD ¥·¥¹¥Æ¥à¾å¤Ç¤Î etherboot ¤Î»ÈÍÑË¡¤Ë¤Ä¤¤¤Æ¤Î³µ´Ñ¤ò¼¨¤·¤Þ¤¹¡£

¤Þ¤º¤Ï¤¸¤á¤Ë net/etherboot ¤Î package ¤Þ¤¿¤Ï port ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ etherboot port ¤ÏÄ̾ï /usr/ports/net/etherboot ¤Ë¤¢¤ê¤Þ¤¹¡£ ports ¥Ä¥ê¡¼¤¬¥·¥¹¥Æ¥à¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ ¤³¤Î¥Ç¥£¥ì¥¯¥È¥êÆâ¤Ç make ¤ò¼Â¹Ô¤¹¤ì¤Ð¡¢¤è¤­¤Ë·×¤é¤Ã¤Æ¤¯¤ì¤Þ¤¹¡£ ports ¤ª¤è¤Ó packages ¤Ë´Ø¤¹¤ë¾ðÊó¤Ï 第5章 ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

¤³¤³¤ÇÀâÌÀ¤·¤Æ¤¤¤ëÊýË¡¤Ç¤Ï¡¢¥Ö¡¼¥È¥Õ¥í¥Ã¥Ô¡¼¤ò»ÈÍѤ·¤Þ¤¹¡£ ¾¤ÎÊýË¡ (PROM ¤Þ¤¿¤Ï DOS ¥×¥í¥°¥é¥à) ¤Ë¤Ä¤¤¤Æ¤Ï etherboot ¤Îʸ½ñ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

¥Ö¡¼¥È¥Õ¥í¥Ã¥Ô¡¼¤òºîÀ®¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ etherboot ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¥Þ¥·¥ó¤Î¥É¥é¥¤¥Ö¤Ë¥Õ¥í¥Ã¥Ô¡¼¥Ç¥£¥¹¥¯¤òÁÞÆþ¤·¤Þ¤¹¡£ ¤½¤ì¤«¤é¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤ò etherboot ¥Ä¥ê¡¼Æâ¤Î src ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤·¤Æ¼¡¤Î¤è¤¦¤ËÆþÎϤ·¤Þ¤¹¡£


	  # gmake bin32/devicetype.fd0
	

devicetype ¤Ï ¥Ç¥£¥¹¥¯¥ì¥¹¥ï¡¼¥¯¥¹¥Æ¡¼¥·¥ç¥ó¤Î¥¤¡¼¥µ¥Í¥Ã¥È¥«¡¼¥É¥¿¥¤¥×¤Ë°Í¸¤·¤Þ¤¹¡£ Àµ¤·¤¤ devicetype ¤ò·èÄꤹ¤ë¤¿¤á¤Ë¡¢ Ʊ¤¸¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î NIC ¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

22.7.1.3. TFTP ¤ª¤è¤Ó NFS ¥µ¡¼¥Ð¤ÎÀßÄê

TFTP ¥µ¡¼¥Ð¾å¤Ç tftpd ¤òÍ­¸ú¤Ë¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

  1. tftpd ¤¬Ä󶡤¹¤ë¥Õ¥¡¥¤¥ë¤òÃÖ¤¯¥Ç¥£¥ì¥¯¥È¥ê (¤¿¤È¤¨¤Ð /tftpboot) ¤òºîÀ®¤·¤Æ¤¯¤À¤µ¤¤¡£

  2. /etc/inetd.conf ¥Õ¥¡¥¤¥ë¤Ë°Ê²¼¤Î¹Ô¤òÄɲ䷤Ƥ¯¤À¤µ¤¤¡£

    tftp    dgram   udp     wait    root  /usr/libexec/tftpd    tftpd -s /tftpboot
    

    注意: ¾¯¤Ê¤¯¤È¤â PXE ¤Î¤¤¤¯¤Ä¤«¤Î¥Ð¡¼¥¸¥ç¥ó¤¬ TCP ÈǤΠTFTP ¤òÍ׵᤹¤ë¤è¤¦¤Ç¤¹¡£¤½¤Î¾ì¹ç dgram udp ¤ò stream tcp ¤ËÃÖ¤­´¹¤¨¤¿ 2 ÈÖÌܤιԤòÄɲ䷤Ƥ¯¤À¤µ¤¤¡£

  3. inetd ¤ËÀßÄê¥Õ¥¡¥¤¥ë¤òºÆÆɤ߹þ¤ß¤µ¤»¤Æ¤¯¤À¤µ¤¤¡£

    # kill -HUP `cat /var/run/inetd.pid`
    

tftpboot ¥Ç¥£¥ì¥¯¥È¥ê¤Ï¥µ¡¼¥Ð¾å¤Î¤É¤³¤Ë¤Ç¤âÃÖ¤±¤Þ¤¹¡£ ¤½¤Î¾ì½ê¤¬ inetd.conf ¤ª¤è¤Ó dhcpd.conf ¤ÎξÊý¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¤³¤È¤ò³Î¤«¤á¤Æ¤¯¤À¤µ¤¤¡£

¤µ¤é¤Ë NFS ¤òÍ­¸ú¤Ë¤·¤Æ NFS ¥µ¡¼¥Ð¤ÎŬÀڤʥե¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥¨¥¯¥¹¥Ý¡¼¥È¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

  1. ¤³¤Î¹Ô¤ò /etc/rc.conf ¤ËÄɲ䷤Ƥ¯¤À¤µ¤¤¡£

    nfs_server_enable="YES"
    
  2. ²¼µ­¤ò /etc/exports ¤Ë²Ã¤¨¤ë¤³¤È¤Ç¡¢ ¥Ç¥£¥¹¥¯¥ì¥¹¥Þ¥·¥ó¤Î¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê¤¬°ÌÃÖ¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥¨¥¯¥¹¥Ý¡¼¥È¤·¤Æ¤¯¤À¤µ¤¤ (¥Ü¥ê¥å¡¼¥à¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤òŬÅö¤ËÄ´Àᤷ¡¢ margaux ¤ò¥Ç¥£¥¹¥¯¥ì¥¹¥ï¡¼¥¯¥¹¥Æ¡¼¥·¥ç¥ó¤Î̾Á°¤ËÃÖ¤­´¹¤¨¤Æ¤¯¤À¤µ¤¤)¡£

    /data/misc -alldirs -ro margaux
    
  3. mountd ¤ËÀßÄê¥Õ¥¡¥¤¥ë¤òºÆÆɤ߹þ¤ß¤µ¤»¤Æ¤¯¤À¤µ¤¤¡£ /etc/rc.conf Æâ¤Ç NFS ¤ò¤Ï¤¸¤á¤ÆÍ­¸ú¤Ë¤¹¤ëɬÍפ¬¤¢¤Ã¤¿¤Î¤Ê¤é¡¢ Âå¤ï¤ê¤ËºÆµ¯Æ°¤·¤¿Êý¤¬¤è¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¡£

    # kill -HUP `cat /var/run/mountd.pid`
    

22.7.1.4. ¥Ç¥£¥¹¥¯¥ì¥¹ÍѤΥ«¡¼¥Í¥ë¹½ÃÛ

¼¡¤Î¥ª¥×¥·¥ç¥ó¤ò (Ä̾ï¤Î¤â¤Î¤Ë) Äɲä·¤¿¡¢ ¥Ç¥£¥¹¥¯¥ì¥¹¥¯¥é¥¤¥¢¥ó¥ÈÍѤΥ«¡¼¥Í¥ë¥³¥ó¥Õ¥£¥°¥ì¡¼¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¤Æ¤¯¤À¤µ¤¤¡£


          options     BOOTP          # Use BOOTP to obtain IP address/hostname
          options     BOOTP_NFSROOT  # NFS mount root filesystem using BOOTP info
          options     BOOTP_COMPAT   # Workaround for broken bootp daemons.

BOOTP_NFSV3 ¤ª¤è¤Ó BOOTP_WIRED_TO ¤òÍøÍѤ·¤Æ¤â¤è¤¤¤«¤â¤·¤ì¤Þ¤»¤ó (LINT ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤)¡£

¥«¡¼¥Í¥ë¤ò¹½ÃÛ¤·¤Æ (第9章 ¤ò»²¾È)¡¢ dhcpd.conf ¤Ëµ­½Ò¤·¤¿Ì¾¾Î¤Ç tftp ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥³¥Ô¡¼¤·¤Æ¤¯¤À¤µ¤¤¡£

22.7.1.5. ¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î½àÈ÷

dhcpd.conf ¤Ë root-path ¤È¤·¤Æµ­ºÜ¤µ¤ì¤¿ ¥Ç¥£¥¹¥¯¥ì¥¹¥ï¡¼¥¯¥¹¥Æ¡¼¥·¥ç¥ó¤Î¤¿¤á¤Î¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òºîÀ®¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

¤³¤ì¤ò¹Ô¤¦ºÇ¤â´Êñ¤ÊÊýË¡¤Ï /usr/share/examples/diskless/clone_root ¥·¥§¥ë¥¹¥¯¥ê¥×¥È¤ò»ÈÍѤ¹¤ë¤³¤È¤Ç¤¹¡£ ¤³¤Î¥¹¥¯¥ê¥×¥È¤Ï¡¢¾¯¤Ê¤¯¤È¤â¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬ºîÀ®¤µ¤ì¤ë¾ì½ê (DEST ÊÑ¿ô) ¤òÄ´À᤹¤ë¤¿¤á¤ËÊѹ¹¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

ÀâÌÀ¤Ë¤Ä¤¤¤Æ¤Ï¥¹¥¯¥ê¥×¥È¤Î°ìÈÖ¾å¤Ë¤¢¤ë¥³¥á¥ó¥È¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ ¥Ù¡¼¥¹¥·¥¹¥Æ¥à¤ò¤É¤Î¤è¤¦¤Ë¹½ÃÛ¤¹¤ë¤«¡¢ ¤Þ¤¿¥Õ¥¡¥¤¥ë¤¬¤É¤Î¤è¤¦¤Ë¥Ç¥£¥¹¥¯¥ì¥¹²ÔƯ¡¢¥µ¥Ö¥Í¥Ã¥È¡¢ ¤Þ¤¿¤Ï¸Ä¡¹¤Î¥ï¡¼¥¯¥¹¥Æ¡¼¥·¥ç¥ó¤Ë¸ÇÍ­¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤Ã¤Æ¡¢ ÁªÂòŪ¤Ë¥ª¡¼¥Ð¥é¥¤¥É¤Ç¤­¤ë¤«¤òÀâÌÀ¤·¤Þ¤¹¡£ ¤Þ¤¿¡¢¥Ç¥£¥¹¥¯¥ì¥¹¤Ê¾ì¹ç¤Î /etc/fstab ¥Õ¥¡¥¤¥ë¤ª¤è¤Ó /etc/rc.conf ¥Õ¥¡¥¤¥ë¤ÎÎã¤ò¼¨¤·¤Þ¤¹¡£

/usr/share/examples/diskless Æâ¤Î README ¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢Â¿¤¯¤Î¶½Ì£¿¼¤¤ÇطʾðÊ󤬽ñ¤«¤ì¤Æ¤¤¤Þ¤¹¡£ ¤·¤«¤· diskless ¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¾¤ÎÎã¤ÈƱ¤¸¤¯¡¢ clone_root ¤È /etc/rc.diskless[12] ¤Ç¼ÂºÝ¤Ë»È¤ï¤ì¤Æ¤¤¤ë¤â¤Î¤È¤Ï°Û¤Ê¤ëÀßÄêÊýË¡¤¬ÀâÌÀ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ ¤³¤³¤Ë½ñ¤«¤ì¤Æ¤¤¤ëÊýË¡¤Ï rc ¥¹¥¯¥ê¥×¥È¤ÎÊѹ¹¤¬É¬Íפˤʤê¤Þ¤¹¤¬¡¢ ¤³¤Á¤é¤ÎÊý¤¬µ¤¤ËÆþ¤Ã¤¿¤È¤¤¤¦¤Î¤Ç¤Ê¤±¤ì¤Ð¡¢ »²¾È¤Ë¤È¤É¤á¤Æ¤¯¤À¤µ¤¤¡£

22.7.1.6. ¥¹¥ï¥Ã¥×¤ÎÀßÄê

ɬÍפʤ顢¥µ¡¼¥Ð¤ËÃÖ¤«¤ì¤¿¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤Ë NFS ·Ðͳ¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤¹¡£ bootptab ¤Þ¤¿¤Ï dhcpd.conf ¤ÎÀµ³Î¤Ê¥ª¥×¥·¥ç¥ó¤Ï¡¢ ¸½»þÅÀ¤Ç¤ÏÌÀ³Î¤Ë¤Ïʸ½ñ²½¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ ²¼µ­¤ÎÀßÄêÎã¤Ï isc-dhcp 3.0rc11 ¤ò»ÈÍѤ·¤ÆÆ°ºî¤·¤¿¤ÈÊó¹ð¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤Ç¤¹¡£

  1. dhcpd.conf ¤Ë²¼µ­¤Î¹Ô¤òÄɲ䷤Ƥ¯¤À¤µ¤¤¡£

    
              # Global section
                  option swap-path code 128 = string;
                  option swap-size code 129 = integer 32;
    
                  host margaux {
                    ... # Standard lines, see above
                    option swap-path "192.168.4.4:/netswapvolume/netswap";
                    option swap-size 64000;
                  }
    

    ¤³¤ì¤Ï¡¢¾¯¤Ê¤¯¤È¤â FreeBSD ¥¯¥é¥¤¥¢¥ó¥È¤Ë¤ª¤¤¤Æ¤Ï¡¢ DHCP/BOOTP ¥ª¥×¥·¥ç¥ó¥³¡¼¥É¤Î 128 ¤Ï NFS ¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤Ø¤Î¥Ñ¥¹¤Ç¡¢¥ª¥×¥·¥ç¥ó¥³¡¼¥É 129 ¤Ï KB ñ°Ì¤Î¥¹¥ï¥Ã¥×¥µ¥¤¥º¤À¤È¤¤¤¦¤³¤È¤Ç¤¹¡£ ¤â¤Ã¤È¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Î dhcpd ¤Ç¤Ï option option-128 "... ¤È¤¤¤¦½ñ¼°¤¬¼õ¤±ÉÕ¤±¤é¤ì¤Þ¤·¤¿¤¬¡¢ ¤â¤Ï¤äÂбþ¤·¤Æ¤¤¤Þ¤»¤ó¡£

    Âå¤ï¤ê¤Ë¡¢/etc/bootptab ¤Ç¤Ï¼¡¤Î½ñ¼°¤ò»È¤¤¤Þ¤¹¡£

    T128="192.168.4.4:/netswapvolume/netswap":T129=0000fa00

    注意: /etc/bootptab ¤Ç¤Ï¡¢¥¹¥ï¥Ã¥×¤ÎÂ礭¤µ¤Ï 16 ¿Ê¿ô¤Çɽ¤µ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£

  2. NFS ¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¥µ¡¼¥Ð¦¤Ç¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¤Þ¤¹¡£

    
              # mkdir /netswapvolume/netswap
                  # cd /netswapvolume/netswap
                  # dd if=/dev/zero bs=1024 count=64000 of=swap.192.168.4.6
                  # chmod 0600 swap.192.168.4.6
    

    192.168.4.6 ¤Ï¥Ç¥£¥¹¥¯¥ì¥¹¥¯¥é¥¤¥¢¥ó¥È¤Î IP ¥¢¥É¥ì¥¹¤Ç¤¹¡£

  3. NFS ¥¹¥ï¥Ã¥×¥Õ¥¡¥¤¥ë¥µ¡¼¥Ð¾å¤Ç /etc/exports ¤Ë²¼µ­¤Î¹Ô¤òÄɲ䷤Ƥ¯¤À¤µ¤¤¡£

    
	      /netswapvolume  -maproot=0:10 -alldirs margaux
    

    ¤½¤ì¤«¤é¡¢¾å½Ò¤·¤¿¤è¤¦¤Ë mountd ¤Ë¥¨¥¯¥¹¥Ý¡¼¥È¥Õ¥¡¥¤¥ë¤òºÆÆɤ߹þ¤ß¤µ¤»¤Æ¤¯¤À¤µ¤¤¡£

22.7.1.7. »¨Â¿¤ÊÌäÂê

22.7.1.7.1. Æɤ߼è¤êÀìÍѤΠ/usr ¤ÇÆ°ºî¤µ¤»¤ë

¥Ç¥£¥¹¥¯¥ì¥¹¥ï¡¼¥¯¥¹¥Æ¡¼¥·¥ç¥ó¤¬ X ¤òµ¯Æ°¤¹¤ë¤è¤¦¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢ xdm ÀßÄê¥Õ¥¡¥¤¥ë¤òÄ´À°¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤Ç¤·¤ç¤¦¡£ ¤³¤ì¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¥¨¥é¡¼¥Õ¥¡¥¤¥ë¤ò /usr ¤ËÃÖ¤­¤Þ¤¹¡£

22.7.1.7.2. FreeBSD ¤Ç¤Ï¤Ê¤¤¥µ¡¼¥Ð¤ò»ÈÍѤ¹¤ë

¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÄ󶡤¹¤ë¥µ¡¼¥Ð¤¬ FreeBSD ¤ÇÆ°ºî¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢ FreeBSD ¥Þ¥·¥ó¾å¤Ç¥ë¡¼¥È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òºîÀ®¤·¡¢ tar ¤Þ¤¿¤Ï cpio ¤òÍøÍѤ·¤ÆÃÖ¤­¤¿¤¤¾ì½ê¤Ë¥³¥Ô¡¼¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤Ç¤·¤ç¤¦¡£

¤³¤Î¾õ¶·¤Ç¤Ï¡¢major/minor À°¿ô¥µ¥¤¥º¤¬°Û¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¤Ë¤è¤ê /dev Æâ¤Î¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤Ë´Ø¤¹¤ëÌäÂ꤬»þ¡¹¤ª¤³¤ê¤Þ¤¹¡£ ¤³¤ÎÌäÂê¤ò²ò·è¤¹¤ë¤Ë¤Ï¡¢Èó FreeBSD ¥µ¡¼¥Ð¤«¤é¥Ç¥£¥ì¥¯¥È¥ê¤ò¥¨¥¯¥¹¥Ý¡¼¥È¤·¤Æ¡¢ ¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò FreeBSD ¥Þ¥·¥ó¤Ç¥Þ¥¦¥ó¥È¤·¡¢ FreeBSD ¥Þ¥·¥ó¾å¤Ç MAKEDEV ¤ò¼Â¹Ô¤·¤ÆÀµ¤·¤¤¥Ç¥Ð¥¤¥¹¥¨¥ó¥È¥ê¤òºîÀ®¤·¤Þ¤¹ (FreeBSD 5.0 ¤ª¤è¤Ó¤½¤ì°Ê¹ß¤Ç¤Ï¡¢ devfs(5) ¤ò»ÈÍѤ·¤Æ¥æ¡¼¥¶¤Ë°Õ¼±¤µ¤»¤º¤Ë¥Ç¥Ð¥¤¥¹¥Î¡¼¥É¤ò³ä¤êÅö¤Æ¤ë¤Î¤Ç¡¢ ¤³¤ì¤é¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï MAKEDEV ¤ÏɬÍפ¢¤ê¤Þ¤»¤ó)¡£

ËÜʸ½ñ¡¢¤ª¤è¤Ó¾¤Îʸ½ñ¤Ï ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/ ¤«¤é¥À¥¦¥ó¥í¡¼¥É¤Ç¤­¤Þ¤¹¡£

FreeBSD ¤Ë´Ø¤¹¤ë¼ÁÌ䤬¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢¥É¥­¥å¥á¥ó¥È ¤òÆɤó¤À¾å¤Ç <questions@FreeBSD.org> ¤Þ¤Ç (±Ñ¸ì¤Ç) Ï¢Íí¤·¤Æ¤¯¤À¤µ¤¤¡£
ËÜʸ½ñ¤Ë´Ø¤¹¤ë¼ÁÌä¤Ë¤Ä¤¤¤Æ¤Ï¡¢<doc@FreeBSD.org> ¤Þ¤ÇÅŻҥ᡼¥ë¤ò (±Ñ¸ì¤Ç) Á÷¤Ã¤Æ¤¯¤À¤µ¤¤¡£