###### tags: `computer organization` `hw` `thu` # CO-HW5 TrueNAS installation and setup ## 1. Install Virtualization software and get TrueNAS installed: i.e. 安裝隨便, 上面有寫字。 ![](https://i.imgur.com/d2lrbRF.png) ## 2. Set network adapter to bridge mode so that Win10 can connect to the web server on it: ![](https://i.imgur.com/YENv7ES.png) 注意, 你adapter設成bridge mode後就代表這個虛擬機跟你現在在用的這台電腦在路由器下的地位相同了, 所以你如果是在實驗室或特定環境下測試的話, 請注意跟你的電腦一樣都要設定固定ip: 1. 開機選1: Network Interfaces ip, subnet mask 3. 開機選4: Default route gateway ## 3. Login with the password you set during the installation: ![](https://i.imgur.com/KyEAjVL.png) ![](https://i.imgur.com/H83xv6L.png) ## 4. Setup the RAID according the tutorial slides: ![](https://i.imgur.com/Jmp3KWQ.png) ![](https://i.imgur.com/wttGUri.png) ![](https://i.imgur.com/5TwCesL.png) 接下來就是等... ![](https://i.imgur.com/utbsHee.png) 完成之後, 你的Raid形成的Pool就被掛載到你的`/mnt`路徑下了。 ## 5. 接下來就是打開分享並且掛載到目標的電腦上,有三種: ### a. SMB #### 打開Service ![](https://i.imgur.com/zOMc2qI.png) #### 設定使用者(登入用) ![](https://i.imgur.com/VxxyUza.png) ![](https://i.imgur.com/AOkqT0A.png) ![](https://i.imgur.com/ju8AuT5.png) ![](https://i.imgur.com/Ccfh9DW.png) #### 使用SMB分享你剛建好的磁區 ![](https://i.imgur.com/XL1LTgR.png) ![](https://i.imgur.com/hgQaZVQ.png) #### 在Win10上掛載 ![](https://i.imgur.com/WEKqtkS.png) ![](https://i.imgur.com/N8D4Bkq.png) 可以看到這個Share的名稱叫jsl,因為是前面SMB分享的時候設定的, 而不是因為使用者名稱。 ![](https://i.imgur.com/Ocmmhrn.png) #### 使用~ ![](https://i.imgur.com/MaQXizL.png) ![](https://i.imgur.com/0lMMWyB.png) ![](https://i.imgur.com/CYqDLdT.png) ### b. iSCSI #### 打開Service ![](https://i.imgur.com/MVCvv4n.png) #### 設定zvol ![](https://i.imgur.com/WIdYWC0.png) ![](https://i.imgur.com/RlzFFUk.png) ![](https://i.imgur.com/eOiZRKu.png) #### iSCSI設定 點右上角的Wizard ![](https://i.imgur.com/Sscla8v.png) ![](https://i.imgur.com/iVyivGI.png) ![](https://i.imgur.com/t4NQiNm.png) ![](https://i.imgur.com/BqwoM1H.png) ![](https://i.imgur.com/jvP1jpQ.png) wtf?! ![](https://i.imgur.com/rXU1b3k.png) ![](https://i.imgur.com/CBjQg7V.png) ![](https://i.imgur.com/6xzU31Z.png) ![](https://i.imgur.com/hZfHzue.png) #### 設定Initiator ![](https://i.imgur.com/9nO708B.jpg) ![](https://i.imgur.com/IuucP4f.png) ![](https://i.imgur.com/2Y1a5DM.png) ![](https://i.imgur.com/EH3kBbv.png) #### 打開入口 ![](https://i.imgur.com/su7SNzA.png) ![](https://i.imgur.com/04ikAHF.png) ![](https://i.imgur.com/veraWAj.png) ![](https://i.imgur.com/PlEK5gc.png) ![](https://i.imgur.com/tseaH8H.png) #### Win10掛載 ![](https://i.imgur.com/eRdPxHc.png) ![](https://i.imgur.com/zFpEc55.png) ![](https://i.imgur.com/vyFvbx7.png) ![](https://i.imgur.com/jiNVX75.png) 中間隨便,下一步就好。 ![](https://i.imgur.com/rBZwOWF.png) ![](https://i.imgur.com/GVocbhm.png) #### 使用~ ![](https://i.imgur.com/DtCwj0u.png) ![](https://i.imgur.com/Gqxz7lN.png) ### NFS (Unix) #### 打開服務 ![](https://i.imgur.com/WOXcN1i.png) #### 設定NFS ![](https://i.imgur.com/64lozuI.png) ![](https://i.imgur.com/vQhp9iV.png) ![](https://i.imgur.com/o9yAKAq.png) ![](https://i.imgur.com/qMMWzEO.png) #### 於Linux/Unix系統上掛載NFS ##### i. Linux 因為我Linux跟Windows是同一台,我就不開虛擬機做了啊。 (反正老師有教學,虛擬機開下去照著打就好了) ##### ii. macOS(debug地獄) 一樣打mount指令,只是不用像Ubuntu一樣要裝nfs-common。 p.s. 要確認你在同一個區網下,我的VM因為開了bridge mode,所以跟我的筆電都在我家的router下。 ``` mkdir nfs sudo mount -t nfs 192.168.1.4:/mnt/TrueNAS_VirtualBox/jsl nfs ``` ![](https://i.imgur.com/Y9nLeF8.png) 但是失敗了,所以我參考了這個網頁的解法: https://www.cyberciti.biz/faq/apple-mac-osx-nfs-mount-command-tutorial/ 但還是失敗了,所以我又找了這個網站的解法: https://www.reddit.com/r/osx/comments/qqbf1t/monterey_and_nfs_mounting/ ![](https://i.imgur.com/MwNLpjz.png) 但又失敗了: ![](https://i.imgur.com/y7SXGvA.png) 後來我又找到了在Services的Actions的位置的選項: ![](https://i.imgur.com/Y5w85tp.png) 1. 我把nfs版本強制改成了v4 - 他預設好像是v3,但是我前面的補丁在mac上改成了用v4。 2. 我改了路徑到jsl㡳下(原本只有到TrueNAS_VirtualBox) - 可能是我前面沒有設對。 然後我就成功了...(雖然可能只是因為我路徑沒設對,但現在1點了我超想睡,我現在也不想回去想到㡳哪個才是真正的原因XD) ![](https://i.imgur.com/aHqGkeV.png) 也可以看到前面步驟建立的'啦啦啦.txt'。 試著新增個檔案看看: ![](https://i.imgur.com/e6ngAKy.png) 也可以在TrueNAS裡面的shell確認到之前的檔案都有被確實寫入: ![](https://i.imgur.com/CR3LLVt.png) ## 結束,謝謝大家 ![](https://i.imgur.com/4QtlPf5.gif)