Exercise 1 – FreeBSD Installation Announced Date: 2006/9/20 Due Date: 2005/10/4.

Slides:



Advertisements
Similar presentations
Va-scanCopyright 2002, Marchany Unit 8 – Solaris File Systems Randy Marchany VA Tech Computing Center.
Advertisements

Drivers and the kernel1-1 Drivers and the kernel UNIX system has three layers: m The hardware m The operating system kernel m The user-level programs Kernel.
Linux+ Guide to Linux Certification, Second Edition
 Two technologies › Packages › Ports  Packages › contains pre-compiled copies of all the commands for the application, as well as any configuration.
Linux+ Guide to Linux Certification, Second Edition Chapter 3 Linux Installation and Usage.
11 INSTALLING WINDOWS XP Chapter 2. Chapter 2: Installing Windows XP2 INSTALLING WINDOWS XP  Prepare a computer for the installation of Microsoft Windows.
Installing Applications in FreeBSD. Computer Center, CS, NCTU 2 Overview  Two technologies Packages Ports  Packages contains pre-compiled copies of.
1 Web Server Administration Chapter 3 Installing the Server.
Installing Applications Chia-Hung Tsai. Computer Center, CS, NCTU 2 Overview  Two technologies Packages Ports  Packages contains pre-compiled copies.
Lesson 5-Accessing Networks. Overview Introduction to Windows XP Professional. Introduction to Novell Client. Introduction to Red Hat Linux workstation.
Lesson 4-Installing Network Operating Systems. Overview Installing and configuring Novell NetWare 6.0. Installing and configuring Windows 2000 Server.
Cambodia-India Entrepreneurship Development Centre - : :.... :-:-
Installing software on personal computer
Installing Linux Redhat: A how to guide in installing and configuring Redhat 6.2.
PacNOG 6: Nadi, Fiji Installing Ubuntu Server 9.04 Hervey Allen Network Startup Resource Center.
Installing Windows Vista Lesson 2. Skills Matrix Technology SkillObjective DomainObjective # Performing a Clean Installation Set up Windows Vista as the.
Va-scanCopyright 2002, Marchany Unit 3 – Installing Solaris Randy Marchany VA Tech Computing Center.
Uniquely FreeBSD ccTLD Amman November 26, 2007 Amman, Jordan Hervey Allen.
SUSE Linux Enterprise Desktop Administration Chapter 1 Install SUSE Linux Enterprise Desktop 10.
Linux+ Guide to Linux Certification, Third Edition
CompTIA Linux+ Certification
Linux+ Guide to Linux Certification Chapter Three Linux Installation and Usage.
Fundamentals of Networking Discovery 1, Chapter 2 Operating Systems.
1 Web Server Administration Chapter 3 Installing the Server.
2/12/2003 Lecture 2 Computer System Administration Lecture 2 Setup and Installation Irix & FreeBSD.
Guide to Linux Installation and Administration, 2e1 Chapter 3 Installing Linux.
Hands-On Virtual Computing
Chapter 2 Installation Overview. Planning the Installation Questions: –Size of partitions –Where to put partitions –Which software packages to install.
System Administration HW1 huanghs. Computer Center, CS, NCTU 2 Requirements  Basic Install FreeBSD and upgrade to up-to-date –RELEASE Recompile your.
Chapter SIx Maintaining a Computer Part I: Configuring, Updating, and Upgrading the OS.
Drivers and the Kernel. Computer Center, CS, NCTU 2 Roles of Kernel  Components of a UNIX System User-level programs Kernel Hardware  Two roles of kernel.
Initial Boot from Install Disc 1 Turn on the power for your machine. Immediately place the first CD-ROM of the FreeBSD 5.3 install set in your machine's.
CHAPTER Windows NT Server Installation. Chapter Objectives Give an overview of the installation process Outline the pre-installation and post- installation.
1 Web Server Administration Chapter 3 Installing the Server.
1 FreeBSD Installation ISOC/AfNOG Michuki Mwangi (Original materials by Hervey Allen – NSRC)
Maintain Installed Applications. Computer Center, CS, NCTU 2 In Ports Tree  / Makefile  COMMENT pkg-descr  WWW pkg-message  Shown after installed.
Guide to Linux Installation and Administration, 2e1 Chapter 2 Planning Your System.
FreeBSD huanghs. Computer Center, CS, NCTU 2 Outline  FreeBSD version 9.0-RELEASE 9.1-RC1  Installing FreeBSD From CD-ROM From USB.
Installation Overview Lab#2 1Hanin Abdulrahman. Installing Ubuntu Linux is the process of copying operating system files from a CD, DVD, or USB flash.
Linux Administration. Pre-Install Different distributions –Redhat, Caldera, mandrake, SuSE, FreeBSD Redhat Server Install –Check HCL –Significant issues.
CHAPTER 2. Overview 1. Pre-Installation Tasks 2. Installing and Configuring Linux 3. X Server 4. Post Installation Configuration and Tasks.
What is a port The Ports Collection is essentially a set of Makefiles, patches, and description files placed in /usr/ports. The port includes instructions.
1 FreeBSD Installation AFNOG X Cairo, Egypt May 2009 Hervey Allen.
Drivers and the Kernel. Computer Center, CS, NCTU 2 Roles of the Kernel – (1)  Components of a UNIX System User-level programs Kernel Hardware  Kernel.
FreeBSD. Computer Center, CS, NCTU 2 Outline  FreeBSD version 9.2-RELEASE  Installing FreeBSD From CD-ROM From USB.
1 FreeBSD Installation AFNOG Chix 2011 Blantyre, Malawi 31 st Oct - 4 th Nov 2011 Dorcas Muthoni and Evelyn Namara.
Chapter 8: Installing Linux The Complete Guide To Linux System Administration.
Page 1 of 38 Lenovo Confidential Lenovo Confidential Lenovo Confidential Lenovo Confidential Lenovo Confidential Please Note: Information contained in.
FreeBSD. Computer Center, CS, NCTU 2 Outline  FreeBSD version 8.1-RELEASE  Installing FreeBSD From CD-ROM  Build world and kernel Update source Rebuild.
SA-NA Junction. FreeBSD Branches/Tags Three parallel development branches: -RELEASE Latest Release version 7.0 January 2009, 6.3 November 2008
Installing Applications in FreeBSD lctseng. Computer Center, CS, NCTU 2 Before we start  Permission issue root: the super user Like administrator in.
Installing Applications in FreeBSD. Computer Center, CS, NCTU 2 Install software  Package Pre-built rpm, yum, dpkg, … FreeBSD: pkg_add, pkg_delete, pkg_info.
Post Install Configuration FreeBSD SANOG 9 January 14, 2007 Colombo, Sri Lanka Hervey Allen.
2: Operating Systems Networking for Home & Small Business.
Lab 5 Department of Computer Science and Information Engineering National Taiwan University Lab5 - OS Kernel 2014/10/21/ 16 1.
SA-NA Junction FreeBSD. Computer Center, CS, NCTU 2 Outline  FreeBSD version  Installing FreeBSD  Update source and make world  Rebuild kernel.
Drivers and the Kernel. Computer Center, CS, NCTU 2 Introduction – UNIX Kernel and Shell interpret.
Updating FreeBSD Unix System Administration. Objectives At the end of this session you should be able to: 1. Understand the differences between the CURRENT.
Installing Applications in FreeBSD
Operating System Kernel Compilation
Homework #01 FreeBSD Installation
Guide to Linux Installation and Administration, 2e
FreeBSD.
CONFIGURING HARDWARE DEVICE & START UP PROCESS
Operating System Kernel Compilation
Installing Linux Redhat:
Post Install Configuration FreeBSD
Operating System Kernel Compilation
Presentation transcript:

Exercise 1 – FreeBSD Installation Announced Date: 2006/9/20 Due Date: 2005/10/4

Computer Center, CS, NCTU 2 Outline  FreeBSD version  Installing FreeBSD  Update source and make world  Rebuild kernel

Computer Center, CS, NCTU 3 FreeBSD branches  Two parallel development branches: -STABLE  Receive only well-tested bug fixes and other small incremental enhancement  Latest Release version: –5.5 May, 2006 –6.1 May, CURRENT  Latest working sources for FreeBSD  Latest Release version: –7.0-CURRENT

Computer Center, CS, NCTU 4 FreeBSD version  A.B.C – Type A: major version Number B: minor version Number C: slight patch version number Type: version type  SNAP  ALPHA 、 BETA 、 GAMMA  RELEASE  RELENG  STABLE  CURRENT Snapshot  Alpha Beta Gamma  Release  Releng  Stable

Computer Center, CS, NCTU 5 FreeBSD view of Disk (1)  What is the meaning of ad0s1e Disk name  IDE:ad  SCSI: da Slice is equal to the partition of common use  Primary partition: s1 ~ s4  Extended partition: s5 ~ sn Label in each slice  a: root partition  b: swap  c: entire disk  d: entire partition  efgh: /usr, /home, … MBR Slice 1 (/dev/ad0s1) Slice 2 (/dev/ad0s2) Slice 3 (/dev/ad0s3) Slice 4 (/dev/ad0s4) Slice 5 (/dev/ad0s5) Slice 6 (/dev/ad0s6)

Computer Center, CS, NCTU 6 FreeBSD view of Disk (2) D-Disk NTFS Linux Swap MBR Slice 1 (ad0s1) Slice 2 (ad0s2) Slice 3 (ad0s3) Slice 4 (ad0s4) Windows XP (NTFS) disklabel ad0s3a ad0s3b ad0s3c ad0s3d ad0s3e / (root) swap /home Extended Partiton Linux (EXT3FS)  An Example

Computer Center, CS, NCTU 7 Installing FreeBSD  Steps 1.Knowing your hardware 2.Obtaining installation file 3.Booting from CD 4.sysinstall main menu 5.Custom Installation Options 1.Partition 2.Label 3.Distribution 4.Media 5.Commit 6.Post Installation

Computer Center, CS, NCTU 8 Installing FreeBSD – 1. knowing your hardware  CPU 32bit or 64bit Intel 、 AMD or other brand Pentium-II, Pentium4, Xeon, XP1700+, Optron, C3  RAM Size  HD Size, amount, SCSI or IDE  VGA Brand, ram size  Sound Brand  Network Interface Card Brand IP 、 Netmask 、 default gateway 、 Hostname 、 DNS  Other Special device

Computer Center, CS, NCTU 9 Installing FreeBSD – 2. Obtaining installation file  FreeBSD installation CD ftp://freebsd.csie.nctu.edu.tw/pub/ISO-IMAGES-i386/6.1/6.1- RELEASE-i386-bootonly.isoftp://freebsd.csie.nctu.edu.tw/pub/ISO-IMAGES-i386/6.1/6.1- RELEASE-i386-bootonly.iso ftp://freebsd.csie.nctu.edu.tw/pub/ISO-IMAGES-i386/6.1/6.1- RELEASE-i386-disc1.isoftp://freebsd.csie.nctu.edu.tw/pub/ISO-IMAGES-i386/6.1/6.1- RELEASE-i386-disc1.iso Burn!  Boot Floppy Image ftp://freebsd.csie.nctu.edu.tw/pub/releases/i386/6.1- RELEASE/floppies/boot.flpftp://freebsd.csie.nctu.edu.tw/pub/releases/i386/6.1- RELEASE/floppies/boot.flp ftp://freebsd.csie.nctu.edu.tw/pub/tools/fdimage.exe C:\fdimage.exe boot.flp a:\

Computer Center, CS, NCTU 10 Installing FreeBSD – 3. Booting from CD

Computer Center, CS, NCTU 11 Installing FreeBSD – 4. sysinstall Main Menu You can press “Scroll Lock” key to see probe results.  sysinstall Main Menu Contry Selection “Taiwan” Console Keymap “USA ISO” Choose “Custom”

Computer Center, CS, NCTU 12 Installing FreeBSD – 5. Custom Installation Options  5 major steps 1.Partition your disk 2.Label your disk 3.Choose what to install 4.Choose how to install 5.Commit

Computer Center, CS, NCTU 13 Installing FreeBSD – 5. Custom Installation – partition (1)  Create slice and choose boot manager Press “ C ” to create a new slice or press “ A ” to use entire disk Press “ S ” to toggle ad0s1 as bootable (we will put / on this slice) Press “ Q ” to next step (Select Boot Manager)

Computer Center, CS, NCTU 14 Installing FreeBSD – 5. Custom Installation – partition (2) Select “ Standard ” for ad0  BootMgr  Multiple OS  Standard  Single OS  None  Other BM After press OK, it will back to Custom Installation Options menu

Computer Center, CS, NCTU 15 Installing FreeBSD – 5. Custom Installation – partition (3)  If you have more than one disk … You can choose whether to partition it. Install “BootMgr” for first disk and “none” for rest ones

Computer Center, CS, NCTU 16 Installing FreeBSD – 5. Custom Installation – Label (1)  Disklabel Editor Move blue bar to select slice Press “C” to create disk label  swap, / ( and /home, /var, … ) –Specify size –Choose type (either swap or FS) –Specify mount point Press “S” to toggle SoftUpdates (async written to disk) Press “Q” to next step (back to custom installation options menu)

Computer Center, CS, NCTU 17 Installing FreeBSD – 6. Custom Installation – Label (2) Create label in ad0 and specify size

Computer Center, CS, NCTU 18 Installing FreeBSD – 6. Custom Installation – Label (3) Complete disklabel

Computer Center, CS, NCTU 19 Installing FreeBSD – 6. Custom Installation – distri. (1)  Choose Distributions Menu Choose “Custom”

Computer Center, CS, NCTU 20 Installing FreeBSD – 6. Custom Installation – distri. (2)  Select base; binary kernels(all); Generic kernel and SMP kernel Man; Manual src; FreeBSD Source Code ports; FreeBSD Software Collection local; local additions  After Selection Press “OK” and it will return to “Choose Distributions menu” Press “OK” again to back to “Custom Installation Options menu” Select “Media”

Computer Center, CS, NCTU 21 Installing FreeBSD – 6. Custom Installation – distri. (3)

Computer Center, CS, NCTU 22 Installing FreeBSD – 6. Custom Installation – Media (1) Choose CD/DVD if you have 6.1 Stable CD Choose FTP if your NIC is detected  Choose FTP Passive if you in private network

Computer Center, CS, NCTU 23 Installing FreeBSD – 6. Custom Installation – Media (2)  Install through FTP Specify ftp server and path

Computer Center, CS, NCTU 24 Installing FreeBSD – 6. Custom Installation – Media (3) Select NIC IPv6 and DHCP

Computer Center, CS, NCTU 25 Installing FreeBSD – 6. Custom Installation – Media (4) Specify your IP information Press “OK” to next step

Computer Center, CS, NCTU 26 Installing FreeBSD – 6. Custom Installation – Commit  Start to format disk 、 make file system and install software  You can press “ Alt + F2 ” to see the install detail

Computer Center, CS, NCTU 27 Installing FreeBSD – 7. Post Installation (1)

Computer Center, CS, NCTU 28 Installing FreeBSD – 7. Post Installation (2)  Root Password  Time Zone  Asia  Taiwan  Mouse  enable  Networking  sshd  Packages (optional) net/csup editors/vim-lite

Exercise 1 – FreeBSD build world and kernel

Computer Center, CS, NCTU 30 FreeBSD source  Maintained in a CVS repository in California Two softwares to get the latest FreeBSD source  CVSup  CSup – A rewrite of the CVSup file updating client in C  We can use CSup keep our FreeBSD source up-to-date with any FreeBSD mirror sites Install CSup Edit CSup supfile Update source using CSup  Up-to-date your system Build world & kernel using the updated source. Install softwares. Upgrade softwares.

Computer Center, CS, NCTU 31 FreeBSD source CSup Installation  Install via pkg_add Package is pre-compiled application % pkg_add ftp://freebsd.csie.nctu.edu.tw/pub/releases/i386/6.1- RELEASE/packages/net/csup _1.tbz pkg_add package-name pkg_delete package-name pkg_info package-name All installed package is stored in /var/db/pkg  The csup binary is in /usr/local/bin/csup You can use “whereis” command to find something

Computer Center, CS, NCTU 32 FreeBSD source CSup Configuration file (1)  Example csup supfile /usr/share/examples/cvsup/stable-supfile /usr/share/examples/cvsup/ports-supfile  Create your own supfile Edit /usr/local/etc/cvsup-src Edit /usr/local/etc/cvsup-ports

Computer Center, CS, NCTU 33 FreeBSD source CSup Configuration file (2)  /usr/local/etc/cvsup-src *default host=freebsd.csie.nctu.edu.twWhere to get source *default base=/usrWhere to put status file *default prefix=/usrWhere to put source *default delete use-rel-suffixAllow cvs to delete *default compressCompress before transmit *default release=cvs tag=RELENG_6 src-all

Computer Center, CS, NCTU 34 FreeBSD source CSup Configuration file (3)  CVS tags Branch Tags .(FreeBSD-CURRENT line)  RELENG_6(FreeBSD 6-STABLE line)  RELENG_5(FreeBSD 5-STABLE line) Release Tags  RELENG_6_1(FreeBSD 6.1-RELEASE)  RELENG_5_5(FreeBSD 5.5-RELEASE) To refer to a specific point in time  RELENG_6_1_0_RELEASE  RELENG_5_5_0_RELEASE

Computer Center, CS, NCTU 35 FreeBSD source CSup Configuration file (4)  /usr/local/etc/cvsup-ports *default host=freebsd.csie.nctu.edu.tw *default base=/usr *default prefix=/usr *default delete use-rel-suffix *default compress *default release=cvs tag=. ports-all

Computer Center, CS, NCTU 36 FreeBSD source CSup Configuration file (5)  you can put them all together in /usr/local/etc/cvsup-all *default host=freebsd.csie.nctu.edu.tw *default base=/usr *default prefix=/usr *default delete use-rel-suffix *default compress *default release=cvs tag=RELENG_6 src-all ports-all tag=.

Computer Center, CS, NCTU 37 FreeBSD source Update source using CSup  Update both src and ports % /usr/local/bin/csup -L 1 /usr/local/etc/cvsup-all > /var/log/csup.log The “ –L 1 ” tells cvsup to print out the details of all the file updates it is doing. from 0 (silent) to 2

Computer Center, CS, NCTU 38 Rebuilding world & kernel  The canonical way to update system make buildworld make buildkernel make installkernel reboot and boot in single user mode mergemaster -p make installworld mergemaster reboot

Computer Center, CS, NCTU 39 Rebuilding world & kernel – Prepare make.conf  Example make.conf /usr/share/examples/etc/make.conf5.x ~ 6.x Everything add in make.conf is used every time you run make KERNCONF=CHBSD CPUTYPE?=pentium4 man make.conf has detail descriptions of it Available CPUTYPE: See /usr/share/mk/bsd.cpu.mk

Computer Center, CS, NCTU 40 Rebuilding world & kernel – make buildworld  Build FreeBSD entire system % cd /usr/src % make buildworld >& /var/log/world.log & make –j n buildworld Spawn multiple (n) processes to do make. The compiling processes of make world is I/O bound.

Computer Center, CS, NCTU 41 Rebuilding world & kernel – make buildkernel (1)  Why rebuild kernel? Faster boot time.  Probe only necessary device Lower memory usage  Smaller kernel image Additional hardware support.

Computer Center, CS, NCTU 42 Rebuilding world & kernel – make buildkernel (2)  Edit kernel config file cd /usr/src/sys/i386/conf  GENERIC may not have all for your system  LINT has every options %use “ make LINT ” to generte the LINT file cp GENERIC “YOUR-NAME”  We often use hostname to be “ YOUR-NAME ” edit config file  Depend on your system  Be attention to related options  Following the explanation of 1/books/handbook/kernelconfig-config.html 1/books/handbook/kernelconfig-config.html

Computer Center, CS, NCTU 43 Rebuilding world & kernel – make buildkernel (3)  Build kernel % cd /usr/src % make KERNCONF=CHBSD buildkernel If the KERNCONF=“YOUR-NAME” has been set in your make.conf You can use “make buildkernel” instead

Computer Center, CS, NCTU 44 Rebuilding world & kernel – make installkernel  Install kernel % cd /usr/src % make KERNCONF=CHBSD installkernel make buildkernel && make installkernel = make buildkernel installkernel = make kernel

Computer Center, CS, NCTU 45 Rebuilding world & kernel – reboot into single user mode  Boot in single user mode Press “4” Or % shutdown now  For a running system, this will drop it to single user mode

Computer Center, CS, NCTU 46 Rebuilding world – make installworld  mergemaster -p -p Pre-buildworld mode. Compares only files known to be essential to the success of {build|install}world, including /etc/make.conf.  Install the built world % make installworld

Computer Center, CS, NCTU 47 Rebuilding world – mergemaster  mergemaster Synchronize /usr/src/etc with /etc Choose “i” for most case, such as  /etc/defaults/rc.conf, … Press “enter” for certain file, such as  master.passwd, hosts, csh.*

Computer Center, CS, NCTU 48 Reboot  Reboot and enjoy it % reboot

Computer Center, CS, NCTU 49 If Something Goes Wrong … (1)  Possible errors in building new kernel Configuration file  % cd /usr/src/sys/i386/conf/  % config CHBSD make fail Install fail Kernel does not boot  Boot with old kernel, recompile kernel Kernel works, but ps does not work  Build world

Computer Center, CS, NCTU 50 If Something Goes Wrong … (2)  Boot with old kernel In 5.x ~  Press “ 6 ”  Type “ boot /boot/kernel.old/kernel ” In 4.x  Hit any key other than “enter” when counting down  Type “unload”  Type “load /kernel.old”  Type “boot”

Computer Center, CS, NCTU 51 If Something Goes Wrong … (3)  Move working kernel to /boot/kernel % mv /boot/kernel.old /boot/kernel  For versions of FreeBSD prior to 5.x Unlock kernel  % chflags noschg /kernel  % cp kernel.old kernel  % sync;sync; reboot Lock kernel  % chflags schg /kernel  Use ls –lo to check similar file schg  set the immutable ( 永遠不變的 ) flag ls –o  include file flags in long output

Computer Center, CS, NCTU 52 Install software  Package Pre-built ports pkg_add, pkg_delete, pkg_deinstall, pkg_info, pkg_version  Ports cd /usr/ports, make search, make install clean ports/sysutils/portupgrade  portinstall, portupgrade, portversion  /usr/local/etc/pkgtools.conf  Source Tar ball tar xzvf certain-source.tar.gz./configure make; make install

Computer Center, CS, NCTU 53 How to use ports  Using ports Steps of install software (1) Figure out the path to the software –% cd /usr/ports –% make search key=mutt –% cd /usr/ports/chinese/mutt (2) Fetch and compile the source –% make install Uninstall  % make deinstall ※ Using portupgrade  portinstall = portupgrade –N  pkgtools.conf

Computer Center, CS, NCTU 54 How to use ports (1)  Try to install some software, such as: vim mutt wget