äœãå¿ èŠã§ããïŒ
ãŸããNASã«ã¯ããã¡ãããä¿¡é Œæ§ã®é«ãããŒã¿ã¹ãã¬ãŒãžãšããã«äŸ¿å©ãªã¢ã¯ã»ã¹ãå¿ èŠã§ãã ãŸããä¿¡é Œæ§ã®ããã«RAIDãå¿ èŠã§ããããã¯ãããŒããã©ã€ãã®æ éã«ããããŒã ã¡ãã£ã¢ã¢ãŒã«ã€ãå šäœã倱ãããšã¯ãå°ãªããšãæãã ããã§ãã ããŒã¿ã«ã¢ã¯ã»ã¹ããã«ã¯ãFTPããã³Sambaã¢ã¯ã»ã¹ãæ§æããå¿ èŠããããŸãã ãã¡ããã誰ããããããã®ããŒãºãæã£ãŠããã®ã§ãMacOSãŸãã¯Linuxã䜿çšããå Žåã¯ãããããä»ã®ãããã³ã«ïŒNFSãAFPïŒãå¿ èŠã«ãªããŸãããç§ã¯èªåã§è¡ã£ãæ¹æ³ã§æ§æã説æããŸããã¹ããŒããã¬ãããã¡ãã£ã¢ããŒã¿ã«ã¢ã¯ã»ã¹ããã«ã¯ãDLNAãµãŒããŒãå¿ èŠã§ãã ãŸããããŠã³ããŒãã®å©äŸ¿æ§ã®ããã«ããã¬ã³ãã¯ã©ã€ã¢ã³ããå¿ èŠã§ãã ããã¯ãã¹ãŠããŠã§ãã€ã³ã¿ãŒãã§ãŒã¹ãä»ããŠç®¡çããããšããå§ãããŸãã
ãªãããŒããŠã§ã¢NASã§ã¯ãªãã®ã§ããïŒ
ã¡ãŒã«ãŒã¯é·ãéãŠãŒã¶ãŒã®äžè©±ãããŠãããç¹ã«å®¶åºçšã®æ¢è£œã®ç®±ãé·ãé補é ããŠããããã§ãã ãããããããã«ã¯æ¬ ç¹ããããŸãïŒ1ïŒé«äŸ¡ã§ãã ããªãã¯20,000ã«ãŒãã«ãããå®ãèŠã€ããããšã¯ã»ãšãã©ãããŸããã 4å°ã®ããŒããã©ã€ããAtomããã»ããµã«æ¥ç¶ã§ããNASã å®äŸ¡ãªãã®ã¯ãéåžžã2ã€ã®ããŒã¿ã¹ããªãŒã ãããŠã³ããŒãããïŒDLNAã§æ ç»ãèŠãããåçãªã©ãã³ããŒããïŒéã«åããã¬ã³ãã«ååã§ã¯ãªã匱ãããã»ããµã䜿çšããŸãã ããããããã6,000ã«ãŒãã«ã§Atomãš4 GBã®ã¡ã¢ãªãæèŒããmini-ITXãã¶ãŒããŒãã«åºã¥ããæ¬æ ŒçãªããPCãçµã¿ç«ãŠãããšãã§ããŸããïŒ
2ïŒå¶éãããŠããŸãã ã€ãŸãã補é å ã«ãã£ãŠå®ããããæ©èœã®ã¿ãæäŸããŸãã ãã¡ãŒã ãŠã§ã¢ã®ã³ã¢ã¯å€§å¹ ã«åãæšãŠãããå¯èœæ§ãããããããã®æ©èœãæ¡åŒµããã«ã¯ããã¿ã³ããªã³ãšèžããããšãéåžžå¿ èŠã§ãã Ubuntuã䜿çšãããšãå®è³ªçã«äœã§ãç¡å¶éã«ãªããŸããããããçš®é¡ã®ãœãããŠã§ã¢ã®å·šå€§ãªãªããžããªã«ããããµãŒããŒããä»®æ³ãã·ã³ã®åŒãäžããŸã§ãããããããšãå¯èœã«ãªããŸãã
ãªãFreeNASãŸãã¯OpenFilerã§ã¯ãããŸãããïŒ
ãé¡ãããŸãã ãŸããããŒããŠã§ã¢NASã®æ¬ ç¹ã®ãã€ã³ã2ãåç §ããŠãã ãããã€ãŸãããããã®ãã£ã¹ããªãã¥ãŒã·ã§ã³ã®æ©èœãå¢ããããšã¯éåžžã«åé¡ããããŸãããUbuntuã«ã¯æ¢ã«æ§æããããœãããŠã§ã¢ã®å·šå€§ãªãªããžããªããããŸãã 第äºã«ããããã¯å·šå€§ãªã·ã¹ãã èŠä»¶ã§ããç¹ã«ãFreeNAS 8ã«ã¯æäœ2 GBã®RAMãå¿ èŠã§ãããOpenFilerã®æ°ããããŒãžã§ã³ã¯x86ã¢ãŒããã¯ãã£çšã«ãªãªãŒã¹ãããªããªããŸããã ããã«ãFreeNASã¯ã©ããããããã¹ã ãŒãºã«éçºãããŠããŸãã-ãã¬ã³ãã¯ã©ã€ã¢ã³ããšDLNAãµãŒããŒãåããããŒãžã§ã³0.7ã¯ããªãåã«æ代é ãã«ãªãã8çªç®ã®åçšããŒãžã§ã³ã§ã¯ãŸã DLNAãèšå®ã§ããŸããã§ãããã·ã¹ãã é害ãçºçããå Žåãã©ã®ããã«ããŒã¿åŸ©æ§ã泚æããŸããïŒ é£ããã§ããServer 12.04 LTSãã£ã¹ããªãã¥ãŒã·ã§ã³ãéžæãããã®ã¯ãªãã§ããïŒ
LTSïŒLong Term SupportïŒã¯ãé·æéã®ãµããŒããšã¢ããããŒãã®ãªãªãŒã¹ããããã£ã¹ããªãã¥ãŒã·ã§ã³ã§ãã å¯èœãªå Žåã¯ãäžåºŠæ§æãããšãå°æ¥äœå¹Žãéãã«åäœãããµãŒããŒãå¿ èŠã«ãªãããããã®ããŒãžã§ã³ã®é åžããããéžæããããšããå§ãããŸããçæ³çã«ã¯ãã°ã©ãã£ã«ã«ã·ã§ã«ã§ãªãœãŒã¹ãç¡é§ã«ããå¿ èŠããªãããããµãŒããŒããŒãžã§ã³ãæããã«éžæãããŸãã Linuxã«ç²ŸéããŠããå ŽåããŸãã¯ãã§ã«UbuntuããŒãžã§ã³ã®ãã¹ã¯ãããããŒãžã§ã³ã䜿çšããŠããå Žåã¯ãååãšããŠéåžžã®ããŒãžã§ã³ã®ãã£ã¹ããªãã¥ãŒã·ã§ã³ãéžæã§ããŸãããããã¯éèŠã§ã¯ãããŸããã
å§ããŸããã
ã€ã³ã¹ããŒã«ã¯å®å šã«ééçã§ããããã詳现ã«ã¯èª¬æããŸããã ããŒããã©ã€ãã®å èš³ã«ã€ããŠèª¬æããŸããããŒããŠã§ã¢RAIDããµããŒãããªãäºç®ã®ãã¶ãŒããŒãã䜿çšããŸããããå®éã«ã¯ããã¶ãŒããŒãã«çµã¿èŸŒãŸããããŒããŠã§ã¢RAIDãæè¯ã®é¢ã瀺ããªãããšããããããããããããœãããŠã§ã¢ãRAIDãç·šæããŸãã 2ã€ã®æ°ããããŒããã©ã€ããããŒã¿ã¹ãã¬ãŒãžã«äœ¿çšãããŸãã è¿œå ã®ã¹ãã¬ãŒãžã¡ãã£ã¢ã¯ãªãã£ãã®ã§ããã£ã¹ã¯ã2ã€ã®ã»ã¯ã·ã§ã³ã«åå²ããŸãã1ã€ã¯ã·ã¹ãã ã®1ã€ã§ããã1ã€ã¯ããŒã¿çšã§ãã 2å°ã®ããŒããã£ã¹ã¯äžã®äž¡æ¹ã®ããŒãã£ã·ã§ã³ã¯RAID 1ã«çµåãããŸãïŒä»®æ³ãã·ã³ã§ã®å©äŸ¿æ§ã®ããã«ãã¹ãŠã®æäœãå®è¡ãããããããŒãã£ã·ã§ã³ã®ãµã€ãºãå°ããããšã«æ³šæããªãã§ãã ããïŒã
æåã«ãæåã®ãã£ã¹ã¯ã«ããŒãã£ã·ã§ã³ããŒãã«ãäœæãã2ã€ã®éšåã«åå²ããŸãã ãããããRAIDã®ããŒãã£ã·ã§ã³ããšããŠããŒã¯ããŸãããããã¯å¿ é ã§ã¯ãããŸããã
2çªç®ã®ãã£ã¹ã¯ãåæ§ã«åå²ãããŸãã 次ã«ãããœãããŠã§ã¢RAIDã®èšå®ãé ç®ãéžæããŸãã ãMDããã€ã¹ã®äœæããšèšãã2ã€ã®ãã£ã¹ã¯ã®æåã®ããŒãã£ã·ã§ã³ãéžæããŸãã ããŒã¿ã®ã»ã¯ã·ã§ã³ã§ãåæ§ã§ãã ã¡ãªã¿ã«ãRAIDã¯åçã«å€æŽããã³æ¡åŒµã§ããããããããŸã§ããŒããã©ã€ãã1å°ãããªãã2å°ç®ã®ããŒããã©ã€ããè³Œå ¥ããäºå®ãããå Žåã¯ããæ°è»œã«æ§æããè³Œå ¥åŸã«ç°¡åã«åãåºãããšãã§ããŸãã
RAIDãäœæãããã䜿çšããããã«ããããããŒã¯ããŸãã ext4ãã¡ã€ã«ã·ã¹ãã ãéžæããããŠã³ããã€ã³ããå²ãåœãŠãŸããã«ãŒãïŒ/ïŒãšããŠã®ã·ã¹ãã ããŒãã£ã·ã§ã³ãããã³ä»»æã®å Žæãžã®ããŒã¿ããŒãã£ã·ã§ã³ïŒ/ mntãã©ã«ããŒã«ããŠã³ãããããšããå§ãããŸãïŒã
ããã«ãRAIDã¢ã¬ã€ã«é害ãçºçããå Žåã«ã·ã¹ãã ãèµ·åãããã©ãããã·ã¹ãã ãéç¥ããŸãã ããããããšçããããšããå§ãããŸããããŒããã©ã€ãã«é害ãçºçããŠãæ°ä»ããªãããšããããŸããã·ã¹ãã ã¯1ã€ã®ãã©ã€ãã§åäœãç¶ããŸããã2çªç®ã®ãã©ã€ãã«é害ãçºçãããšãããŒã¿åŸ©æ§äŒç€Ÿã«æã¡èŸŒãå¿ èŠããããŸãã
ã¹ã¯ããããŒãã£ã·ã§ã³ãäœæããŸãããæåã«ãã¡ã€ã«ãäœæã§ãã次ã«å人çã«ã¯å¿ èŠãªãããã§ããããPCã«4 GBãã€ã³ã¹ããŒã«ãããã¡ã¢ãªäœ¿çšéã10ïŒ ïŒ400 MB ïŒããã ãéåžžã®ç¶æ ã§ã¯ããã«å°ãªããªããŸãïŒçŸåšã¯130 MBã®ã¿ã䜿çšãããŠããŸãïŒã ä»®æ³ãã·ã³ãã¬ã€ãºããäºå®ãããå Žåã¯å¿ èŠã«ãªãå¯èœæ§ããããããã€ã³ã¹ããŒã«åŸã«ã¹ã¯ãããã¡ã€ã«ãäœæããæ¹æ³ã«ã€ããŠèª¬æããŸãããã¹ã¯ããããŒãã£ã·ã§ã³ãäœæãããšããææ¡ã«åŠå®çã«å¯Ÿå¿ããŸãã
ãã¡ã€ã«ãã³ããŒããçãããã»ã¹ã®åŸãã·ã¹ãã ã¯ãªããžããªããã®ããŒã¿ã®æŽæ°ãéå§ããæŽæ°ã®ã€ã³ã¹ããŒã«æ¹æ³ãå°ããŸãã ã·ã¹ãã 管çãæå°éã«æããããŠãããããèªåæŽæ°ãéžæããŸãã ã·ã¹ãã ã¯ãããã«ã©ã®ããã±ãŒãžãã€ã³ã¹ããŒã«ããããå°ããŸãã OpenSSHïŒãªã¢ãŒãã³ãã³ãã©ã€ã³ãå¿ èŠïŒãLAMPïŒWebã€ã³ã¿ãŒãã§ã€ã¹ã«å¿ èŠïŒãããªã³ããµãŒããŒïŒãã®èšäºã§ã¯ããªã³ã¿ãŒã®æ¥ç¶æ¹æ³ã«ã€ããŠã¯èª¬æããŸããïŒããããŠãã¡ããWindowsãã·ã³ããã¢ã¯ã»ã¹ããããã®Sambaãã¡ã€ã«ãµãŒããŒãéžæããŸããã
ããŠãæçµæ®µéã§ãã·ã¹ãã ã¯MySQLã®ãã¹ã¯ãŒããšGRUBã®ã€ã³ã¹ããŒã«èŠæ±ãèŠæ±ããŸãã åèµ·å-ã·ã¹ãã ãã€ã³ã¹ããŒã«ãããŸããïŒ ãã°ã€ã³ããŠãDHCPãå²ãåœãŠãããIPã¢ãã¬ã¹ã確èªããŸãïŒifconfigã³ãã³ãã䜿çšããŠãå®è¡ã§ããŸãïŒãç§ã®å Žåãã¢ãã¬ã¹192.168.1.180ãçºè¡ãããŸããã
ãã¹ãŠãã¢ãã¿ãŒããªãã«ããŠã䟿å©ãªå Žæã§ã·ã¹ãã ãŠããããåãå€ãããšãã§ããŸãããã®åŸãSSHã䜿çšããŠäœæ¥ããŸãã ããã«ã¯PUTTYã䜿çšããŸãã
æ§æ
1ïŒã¹ã¯ãããã¡ã€ã«
ãŸããã¹ã¯ãããã¡ã€ã«ã®èšå®æ¹æ³ã説æããŸããæ¬åœã«å¿ èŠãªå Žåã¯ãæ°è¡ã®ã³ãã³ãã§ãã¹ãŠãè¡ãããŸãããŒãã§æºãããããã¡ã€ã«ãäœæããŸãã
> sudo dd if=/dev/zero of=/swap bs=1M count=2048
ã¹ã¯ãããšããŠäœ¿çšããããã«æºåããŸãã
> sudo mkswap /swap
äœæãããã¡ã€ã«ãfstabãã¡ã€ã«ã«è¿œå ããŠãã¹ã¯ãããã¡ã€ã«ãšããŠäœ¿çšããŸãã
> sudo nano /etc/fstab
/swap none swap sw 0 0
åèµ·åïŒ
> sudo shutdown -r now
2ïŒãœãããŠã§ã¢æŽæ°
ãã¹ãŠã®ããã±ãŒãžãããã«æŽæ°ããŸããããã¯2ã€ã®ã³ãã³ãã§å®è¡ãããŸãã> sudo apt-get update > sudo apt-get upgrade
3ïŒWebã€ã³ã¿ãŒãã§ãŒã¹
Webã€ã³ã¿ãŒãã§ã€ã¹ãä»ããŠã·ã¹ãã ã管çããããã®webimããã±ãŒãžããããŸãããæ®å¿µãªããšã«ãªããžããªã«ã¯ãªããããæºåãããããã±ãŒãžãæåã§ããŠã³ããŒãããŸãã> wget http://prdownloads.sourceforge.net/webadmin/webmin_1.580_all.deb
webimã®ã€ã³ã¹ããŒã«ã«ã¯ããã€ãã®äŸåããã±ãŒãžãå¿ èŠã«ãªããŸãããç§ã®å Žåã¯ãã®ãããªãªã¹ãã§ããä»ã®ãã®ãå«ããå¿ èŠããããããããŸããã
> sudo apt-get install libnet-ssleay-perl libauthen-pam-perl libio-pty-perl apt-show-versions
ããŠãå®éã®ã€ã³ã¹ããŒã«ïŒ
> sudo dpkg --install webmin_1.580_all.deb
Webã€ã³ã¿ãŒãã§ãŒã¹ã«ã¢ã¯ã»ã¹ã§ãããã¹ãŠïŒ
https://192.168.1.180:10000
4ïŒFTPã¢ã¯ã»ã¹ãæ§æãã
ftpã«ã¯ãpure-ftpdã䜿çšããŸãïŒãã ãã奜ã¿ã«å¿ããŠéžæã§ããŸã-proftpdãšvsftpdïŒãããªãã¯ãã©ã«ããŒãäœæããŸãã
> sudo mkdir /mnt/data/public
ãªããžããªããpure-ftpdãã€ã³ã¹ããŒã«ããŸãã
> sudo apt-get install pure-ftpd
ååãšããŠãã·ã¹ãã ã¢ã«ãŠã³ãã§æ¢ã«ãã°ã€ã³ã§ããŸãããããã¯æ¥åžžã®äœ¿çšã«ã¯ãŸã£ããé©ããŠããŸããã ãããªãã¯ãã©ã«ããŒã®ã¿ã«ã¢ã¯ã»ã¹ã§ããä»®æ³ã¢ã«ãŠã³ããäœæããŸãããã
> sudo pure-pw useradd public -u local -g nogroup -d /mnt/data/public
ããŒã¿ããŒã¹ãæŽæ°ããŸãã
> sudo pure-pw mkdb
ä»®æ³ãŠãŒã¶ãŒã®äœ¿çšãæå¹ã«ããŸãããïŒ
> sudo ln -s /etc/pure-ftpd/conf/PureDB /etc/pure-ftpd/auth/50pure
ãµãŒãã¹ãåèµ·åããŸãã
> sudo service pure-ftpd restart
5ïŒãµã³ã
WindowsããŒã¹ã®ãã·ã³ãããµãŒããŒãžã®ã¢ã¯ã»ã¹ãèšå®ããŸã;ããã«ãç§ã®å®¶æã¯å人çã«å€§èŠæš¡ã§ãããè€æ°ã®ãŠãŒã¶ãŒéã§æš©å©ãå ±æããå¿ èŠããããŸãã ãŸããWindowsããïŒããããã£ã®[ã»ãã¥ãªãã£]ã¿ãã䜿çšããŠïŒãã©ã«ããžã®æš©éãç°¡åã«ç·šéããããã«ãACLã䜿çšããŸãããã¡ã€ã³ããªããããWindowsãã·ã³ãšåãããã«ãŠãŒã¶ãŒãäœæããå¿ èŠããããŸãã
> sudo useradd -d /home/PaulZi -s /bin/true -g users PaulZi
Windowsãšåããã¹ã¯ãŒããèšå®ããŸãã
> sudo passwd PaulZi
äœæãããŠãŒã¶ãŒãSambaã«è¿œå ããŸãã
> sudo smbpasswd -a PaulZi
æ¡åŒµæš©å©ã管çããã«ã¯ããŠãŒãã£ãªãã£ãã€ã³ã¹ããŒã«ã§ããŸãïŒãªãã·ã§ã³ïŒã
> sudo apt-get install acl > sudo apt-get install attr
sambaãACLã䜿çšããã«ã¯ãPOSIX ACLããµããŒããããã¡ã€ã«ã·ã¹ãã ãå¿ èŠã§ããext4ã¯éåžžã«é©ããŠããŸãããããã©ã«ãã§ã¯ãã®ãµããŒããªãã§ããŠã³ããããŸãã ãã®æ©èœãæå¹ã«ããã«ã¯ããaclããªãã·ã§ã³ã/ etc / fstabãã¡ã€ã«ã«è¿œå ããŸãã ããããã以äžã«ãæš©å©ã®ç¶æ¿ã®ãµããŒãã¯Windowsã§å®è£ ãããŠãããããããã¯Linuxã§ãå®è£ ããããããsambaã¯è¿œå ããŒã¿ãã©ããã«ä¿åããå¿ èŠããããŸãã ãããè¡ãã«ã¯ãæ¡åŒµãã¡ã€ã«å±æ§ããªãã·ã§ã³ãuser_xattrããæå¹ã«ããŸãã åæã«ããnoexecããªãã·ã§ã³ã䜿çšããŠãããŒã¿ã»ã¯ã·ã§ã³å šäœã§ã®ãã¡ã€ã«ã®å®è¡ãçŠæ¢ããŸãïŒã»ãã¥ãªãã£ã®ããïŒã
> sudo nano /etc/fstab
/dev/md0 /mnt/data ext4 defaults,noexec,acl,user_xattr 0 2
åèµ·åïŒ
> sudo shutdown -r now
ãµã³ãã®èšå®ãç·šéããŸãïŒç°¡æœã«ãããããå€æŽãšè¿œå ã®ã¿ãè¡ããŸãïŒã
> sudo nano /etc/samba/smb.conf
[global] workgroup = Home netbios name = Server security = user # add settings admin users = PaulZi # root map acl inherit = yes # acl store dos attributes = yes # dos # windows : map archive = no map system = no map hidden = no map readonly = no # public share [public] comment = Public path = /mnt/data/public browseable = yes # read only = no # guest ok = yes # inherit permissions = yes # inherit acls = yes # windows- inherit owner = yes # hide unreadable = yes #
ãµãŒãã¹ãåèµ·åããŸãã
> sudo service smbd restart
6ïŒDLNA / UPnP-ãµãŒããŒ
DLNAãµãŒããŒãšããŠãminidlnaãéžæããŸããã MediaTombãServiioïŒJavaãŸãã¯ã°ã©ãã£ãã¯ã©ã€ãã©ãªããã«ããïŒã®ãããªäžèŠãªäŸåé¢ä¿ããã«ããªããšããåçŽãªçç±ã®1ã€ãéžæããŸããã ãã ãããã©ã³ã¹ã³ãŒãã£ã³ã°ãå¿ èŠãªå Žåã¯ãminidlnaã§ã¯ãªãããããã®ãããããã€ã³ã¹ããŒã«ããããšããå§ãããŸãããªããžããªããã®ã€ã³ã¹ããŒã«ïŒ
> sudo apt-get install minidlna
ã«ã¹ã¿ãã€ãºïŒ
> sudo nano /etc/minidlna.conf
media_dir=/mnt/data/public friendly_name=Ubuntu
åèµ·åïŒ
> sudo service minidlna restart
7ïŒãã¬ã³ã
ããŠããã®èšäºã§åãäžããæåŸã®ãµãŒãã¹ã¯ãã¬ã³ãã¯ã©ã€ã¢ã³ãã§ãã ç§ã¯ãå®è©ã®ããWebããŒã¹ã®ã¯ã©ã€ã¢ã³ããšããŠTransmissionã䜿çšããŠããŸããã€ã³ã¹ããŒã«ïŒ
> sudo apt-get install transmission-daemon
ãµãŒãã¹ãåæ¢ããŸããããããªããšãããã»ã¹ã®å®äºåŸã«ãã¹ãŠã®å€æŽãæ¶å»ãããŸãã
> sudo service transmission-daemon stop
ã«ã¹ã¿ãã€ãºïŒ
> sudo nano /etc/transmission-daemon/settings.json
"download-dir": "/mnt/data/public/torrents" "rpc-password": "local" "rpc-username": "local" "rpc-whitelist-enabled": false
ããã§ã¯ã4ã€ã®èšå®ãå€æŽããŸããWebã€ã³ã¿ãŒãã§ã€ã¹ã®ããŠã³ããŒããã¹ããŠãŒã¶ãŒåããã¹ã¯ãŒããèšå®ããã€ã³ã¿ãŒãã§ã€ã¹ãžã®ã¢ã¯ã»ã¹ã®ãã¯ã€ããªã¹ããç¡å¹ã«ããŸã-ãã¹ãŠã®ãŠãŒã¶ãŒãèš±å¯ããŸãã ãã¹ã¯ãŒãã¯æ確ãªåœ¢åŒã§æå®ãããã®åŸã®èµ·ååŸã«æå·åãããŸãã
ãµãŒãã¹ãéå§ããŸãã
> sudo service transmission-daemon start
Webã€ã³ã¿ãŒãã§ãŒã¹ã«å ¥ãããã¹ãŠãæ£åžžã§ããããšã確èªããŸãã
http://192.168.1.180:9091/