Free BSD huanghs Computer Center CS NCTU 2
Free. BSD huanghs
Computer Center, CS, NCTU 2 Outline q Free. BSD version • 9. 0 -RELEASE • 9. 1 -RC 1 q Installing Free. BSD • From CD-ROM • From USB
Free. BSD Version
Computer Center, CS, NCTU Free. BSD Branches/Tags q Three parallel development branches: • -RELEASE Ø Latest Release Version: – 9. 0 (January, 2012) – http: //www. freebsd. org/releases/ Ø Upcoming 9. 1 (September, 2012) – http: //wiki. freebsd. org/Releng/9. 1 TODO • -STABLE Ø Tested new features and bug fixes Ø MFC: Merge From Current • -CURRENT Ø Working space for Free. BSD developers Ø Current version: 4 – 10 -CURRENT – http: //www. freebsd. org/releng/
Computer Center, CS, NCTU Free. BSD Version q Free. BSD–A. B. C–Type • • A: major version Number B: minor version Number C: slight patch version number Type: version type Ø PRERELEASE Ø BETA Ø RC Ø RELEASE Ø STABLE Ø CURRENT q Choosing the Free. BSD Version That Is Right For You: • http: //www. freebsd. org/doc/en/articles/version-guide/ 5
Free. BSD Installation
Computer Center, CS, NCTU Free. BSD view of Disk (1) MBR Slice 1 (ad 0 s 1) Slice 2 (ad 0 s 2) Slice 3 (ad 0 s 3) Slice 4 (ad 0 s 4) Windows XP (NTFS) Linux (EXT 3 FS) bsdlabel ad 0 s 3 a / (root) ad 0 s 3 b swap ad 0 s 3 c Extended Partiton ad 0 s 3 d ad 0 s 3 e 7 D-Disk NTFS Linux Swap /home
Computer Center, CS, NCTU Free. BSD View of Disk (2) q What is the meaning of ad 0 s 1 a • Disk name Ø ad: IDE, SATA Ø da: SCSI, usb stick Ø Replace { ad | da } by ada, and link to ada’s • Slice is equal to the partition of common use Ø Primary partition: s 1 ~ s 4 Ø Extended partition: s 5 ~ sn MBR Slice 1 (/dev/ad 0 s 1) Slice 2 (/dev/ad 0 s 2) Slice 3 (/dev/ad 0 s 3) Slice 4 (/dev/ad 0 s 4) • Label in each slice Ø a: root partition / Ø b: swap Ø c: entire slice Ø defgh: /usr, /home, … 8 Slice 5 (/dev/ad 0 s 5) Slice 6 (/dev/ad 0 s 6)
Computer Center, CS, NCTU Knowing Your Hardware q CPU • • • 32 bit or 64 bit Intel、AMD Architecture: amd 64, i 386 (, ia 64, pc 98, powerpc, sparc 64) q RAM • Size q HD • Size, amount, SCSI or IDE q VGA • Brand, ram size q Sound • Brand q Network Interface Card • • Brand IP、Netmask、Default gateway、Hostname、DNS q Other Special device • 9 pciconf -lv
Computer Center, CS, NCTU Pre-Installation Tasks q One PC or Notebook (don’t use Virtual PC!!!) q Another Hard Disk or Shrink a Partition on Your Hard Drive (20 G) q One IP (no private!!) q Network Information • • • IP address Subnet mask Default router IP address domain name of the local network DNS server IP address(es) q Prepare the Installation Media • ftp: //tw. freebsd. org/pub/releases/ 10
Computer Center, CS, NCTU bsdinstall (Free. BSD 9) – (1) q http: //www. freebsd. org/doc/handbook/bsdinstall. html 11
Computer Center, CS, NCTU 12 bsdinstall (Free. BSD 9) – (2) q Install、Shell、Live CD
Computer Center, CS, NCTU 13 bsdinstall (Free. BSD 9) – (3) q Setting hostname • Ex. xxxsa. cs. nctu. edu. tw
Computer Center, CS, NCTU 14 bsdinstall (Free. BSD 9) – (4) q Selecting components to install
Computer Center, CS, NCTU 15 bsdinstall (Free. BSD 9) – (5) q Partitioning methods • Shell – gpart(8)、fdisk(8)、bsdlabel(8)
Computer Center, CS, NCTU bsdinstall (Free. BSD 9) – (6) q Guided Partitioning • Select disk • Replace { ad | da } by ada • { ad | da }’s are linked to ada’s • How to partition the disk Ø Entire Disk Ø Partition – use free space 16
Computer Center, CS, NCTU 17 bsdinstall (Free. BSD 9) – (7) q Guided Partitioning result
Computer Center, CS, NCTU 18 bsdinstall (Free. BSD 9) – (8) q Manual Partitioning
Computer Center, CS, NCTU 19 bsdinstall (Free. BSD 9) – (9) q Choose a partitioning scheme • Master Boot Record (MBR) Ø 4 Primary Partition, 1 Extended Partition, multiple Logical Partition • GUID Partition Table (GPT) Ø 128 Partitions per disk • DON’T use BSD!!!
Computer Center, CS, NCTU 20 bsdinstall (Free. BSD 9) – (10) q Add partitions • freebsd-boot Ø Free. BSD boot code. This partition must be first on the disk.
Computer Center, CS, NCTU 21 bsdinstall (Free. BSD 9) – (11) q Final confirmation
Computer Center, CS, NCTU 22 bsdinstall (Free. BSD 9) – (12) q Fetching Checksum Verification Extraction
Computer Center, CS, NCTU 23 bsdinstall (Free. BSD 9) – (13) q Post-installation • root password • Network interfaces Ø Wired – Static IPv 4 / DHCP / Static IPv 6 / SLAAC Ø Wireless Ø DNS • Time Zone • Services • Add users
Computer Center, CS, NCTU 24 Post-installation q Setting the root Password
Computer Center, CS, NCTU 25 Post-installation q Network interfaces
Computer Center, CS, NCTU 26 Post-installation q Configuring IPv 4 Networking
Computer Center, CS, NCTU 27 Post-installation q Configuring IPv 6 Networking • IPv 6 Stateless Address Auto configuration (SLAAC)
Computer Center, CS, NCTU 28 Post-installation q Configuring DNS
Computer Center, CS, NCTU 29 Post-installation q Setting the Time Zone
Computer Center, CS, NCTU 30 Post-installation q Selecting Services to Enable
Computer Center, CS, NCTU 31 Post-installation q Enabling Crash Dumps (no)
Computer Center, CS, NCTU 32 Post-installation q Add Users • • • • Username - huanghs Full name - Cage Huang Uid - User ID. Typically left blank. Login group - The user's group. Typically left. Invite user into other groups? - wheel Login class - Typically left blank for the default. Shell - The interactive shell for this user. CSCC use tcsh. Home directory - The user's home directory. Home directory permissions - The default is usually correct. Use password-based authentication? - Typically "yes". Use an empty password? - Typically "no". Use a random password? - Typically "no". Enter password - The actual password for this user. Enter password again - The password must be typed again for verification. Lock out the account after creation? - Typically "no".
Computer Center, CS, NCTU 33 Post-installation q Final Configuration
Computer Center, CS, NCTU 34 Free. BSD Handbook q Chapter 3 Free. BSD 9. X and Later • http: //www. tw. freebsd. org/doc/en/books/handbook/bsdinstall. html q Chinese resources • http: //www. tw. freebsd. org/doc/zh_TW/books/handbook/install. html • Chapter 2 Installing Free. BSD 8. X and Earlier
Computer Center, CS, NCTU 35 Login q SSH (Secure Shell) • Pu. TTY: http: //www. chiark. greenend. org. uk/~sgtatham/putty/download. html • Chinese Environment: http: //www. cs. nctu. edu. tw/help/putty. html
Computer Center, CS, NCTU 36 Play with Your Free. BSD q Useful commands • • • • passwd, chsh, chfn, chpass ls ps, top mkdir/rmdir cp/mv/rm write man login/exit/logout/screen Editor: ee, vim, joe, …etc. Connecting: ssh/telnet Email reader: mutt, …etc. News reader: tin File Transmittion: ftp, ncftp, lftp, scp, wget, curl, …etc. Compilers: gcc, g++, javac, …etc. Scripting: perl, php, ruby, python …etc.
Computer Center, CS, NCTU Help Yourself – man (1) q man pages (manual) • Contain descriptions of Ø Individual command. – % man cp Ø File format. – % man rc. local Ø Library routines. – % man strcpy 37
Computer Center, CS, NCTU 38 Help Yourself – man (2) q. Command • % man [section] title Ø % man printf Ø % man 3 printf Ø % man –k exit (printf command) (C Standard printf func. ) (keyword search) q. Man pages organization AT&T BSD Contents 1 1 User-Level commands and applications 2 2 System calls and kernel error code 3 3 Library calls 4 5 Standard file format 5 7 Miscellaneous files and documents 6 6 Games and demonstrations 7 4 Device Drivers and network protocols 1 m 8 System administration commands 9 9 Obscure kernel specs and interfaces %man
Computer Center, CS, NCTU 39 Conventions q Syntax of commands: • • Anything between “[” & “]” – are optional. Anything followed by “…” – can be repeated. {a | b} – you should choose one of them. Example: Ø bork [-x] { on | off } filename … bork on /etc/hosts bork –x off /etc/hosts /etc/passwd bork –x /etc/hosts bork -h /etc/hosts ○ ○ X X
Computer Center, CS, NCTU 40 HOWTO - Shutdown q Free. BSD Shutdown • shutdown -p now • reboot
- Slides: 40