ch2 unix introduction(2013 ncu-nos_nm)

25
Unix introduction CSIE 基基 @ NCU 基基基基基 Updated: 10222013

Upload: -chou

Post on 08-Jun-2015

132 views

Category:

Education


4 download

TRANSCRIPT

Page 1: Ch2   unix introduction(2013 ncu-nos_nm)

Unix introductionCSIE 基爾 @ NCU 網路開源社

Updated: 10222013

Page 2: Ch2   unix introduction(2013 ncu-nos_nm)

課程• 相關學分:計算機概論、作業系統• 等級:入門 – 進階• 背景知識:• 課程目標:

• 了解作業系統• 了解 Unix 相關的作業系統• Unix 安裝與操作

Page 3: Ch2   unix introduction(2013 ncu-nos_nm)

Operating System

Page 4: Ch2   unix introduction(2013 ncu-nos_nm)

我上次說,是讓使用者跟電腦溝通好朋友。

Page 5: Ch2   unix introduction(2013 ncu-nos_nm)

恐龍本告訴你…

Page 6: Ch2   unix introduction(2013 ncu-nos_nm)

作業系統定義• 【電腦使用者】與【電腦硬體】間【負責協調溝通的中間人】

• 是一隻叫做 kernel 的程式,不斷的在電腦上執行

Page 7: Ch2   unix introduction(2013 ncu-nos_nm)

作業系統的目標• 控制程式

• 提供使用者良好的環境,不需要考量硬體輸出輸入層面的問題

• 管理及配置資源• 能夠有效地使用電腦的硬體

Page 8: Ch2   unix introduction(2013 ncu-nos_nm)

Unix-like & Linux

Page 9: Ch2   unix introduction(2013 ncu-nos_nm)

Shell & Kernel

使用者

(

你) 電腦(

體)

Shell

sh

bash

tcsh

Kernel

BSD

Page 10: Ch2   unix introduction(2013 ncu-nos_nm)

版本• 如果你嘗試 google

• NICE MAP

Page 11: Ch2   unix introduction(2013 ncu-nos_nm)

Linux 主流分支

Page 12: Ch2   unix introduction(2013 ncu-nos_nm)

BSD 主流分支

Page 13: Ch2   unix introduction(2013 ncu-nos_nm)
Page 14: Ch2   unix introduction(2013 ncu-nos_nm)

Basic @ installation

Page 15: Ch2   unix introduction(2013 ncu-nos_nm)

磁碟劃分 partition

• MBR (multi)

• APM (apple)

• BSD

• GPT

• PC98

• VTOC8 (sun)

Page 16: Ch2   unix introduction(2013 ncu-nos_nm)

SWAP

• 程式透過 CPU 搬到記憶體

• 如果記憶體空間不夠了?• CPU 把用不到的搬到 SWAP• CPU 把要用的搬到記憶體• 電腦變慢

• 記憶體的兩倍

Page 17: Ch2   unix introduction(2013 ncu-nos_nm)

進階:檔案系統• Windows: FAT32 / NTFS

• FreeBSD: ufs+s /

• … 太多了

• 原理• 一個硬碟分成 sector• 每個 sector 又再區分成 block• 不同的檔案系統會將資料拆成 block 存放

Page 18: Ch2   unix introduction(2013 ncu-nos_nm)

目錄結構/

/root 、 /mnt 、 /dev 、 /lib 、 /bin

/usr : 非系統程式設定檔 /home : 使用者加目錄、網頁 /var : 暫存檔、紀錄檔 /etc : 系統程式設定檔swap

如果我只劃分一個 / ( 跟目錄 ) ,那 /usr 、 /home…etc ,都會是屬於跟目錄底下的目錄。

專業的系統管理員,會針對不同的系統做不同的磁區劃分。劃分區塊,就像是你的電腦分成 C 槽、 D 槽雷同的意義。

C:

Windows

System32

Program files

D:

backup

e-mails

favorites

BT

movies

C:\Windows\System32

Page 19: Ch2   unix introduction(2013 ncu-nos_nm)

磁碟分割• 這個年頭大家都用預設,但如果一個 MIS 都用預設就太遜了…• BSD 分割要點

• 1. SWAP = MEMORY*2• 2. / 根目錄不能太小但不用太大• 3. FREEBSD 的 /usr 很重要• 4. /home 在部分伺服器需要好好照顧• 5. /var 在網路伺服器絕對要夠大• 6. 可以視情況多切一些區塊出來放置特定的服務根目錄 ex. /ftp

Page 20: Ch2   unix introduction(2013 ncu-nos_nm)

實作:安裝 freebsd

Page 21: Ch2   unix introduction(2013 ncu-nos_nm)

實作環境: PROXMOX

• Open Source Tools

• Hypervisor

• Browser

Page 22: Ch2   unix introduction(2013 ncu-nos_nm)

帳號密碼• 網址:

• 帳號:• 密碼: • 登入選項使用 VE• 語言隨你高興

• 點擊虛擬機:開啟你的 FREEBSD 冒險之旅 ( 誤 ) 。

Page 23: Ch2   unix introduction(2013 ncu-nos_nm)

今日流程• 1. 光碟安裝。

• 2. 手動劃分磁碟區塊。 ( 按太快會用預設請注意 )• Disk partition > Manual

• ---END---

• Next: 網路設定、 root 、重要設定檔

/ /home /var /usr swap

4GB 4GB 3.5GB 8GB 512MB

freebsd-ufs freebsd-ufs freebsd-ufs freebsd-ufs freebsd-swap

Page 24: Ch2   unix introduction(2013 ncu-nos_nm)

NEXT…

Page 25: Ch2   unix introduction(2013 ncu-nos_nm)

進階

• 開機程序• F2