FreeBSD startup and repair

Slides:



Advertisements
Similar presentations
Basic Unix system administration
Advertisements

Booting and Shuting Down WeeSan Lee. Roadmap Bootstrapping Boot Loaders Startup/Init Scripts Reboot & Shutdown Q&A.
Genesis: from raw hardware to processes System booting sequence: how does a machine come into life.
Chapter 9: Understanding System Initialization The Complete Guide To Linux System Administration.
Booting and Shutting Down the UNIX Operating System Arcadio A. Sincero Jr. 6/6/2001 CMSC 691X, Section 6080.
Linux+ Guide to Linux Certification Chapter Nine System Initialization.
Linux Booting Procedure
Linux can be generally divided into four major components: 1. KERNEL – OS, ultimate boss The kernel is the core program that runs programs and manages.
FreeBSD startup and repair AfNOG 2007 Abuja, Nigeria Hervey Allen Materials from Brian Candler.
LinuxChix System Startup and Recovery. What happens at startup? ● The BIOS loads and runs the MBR ● A series of "bootstrap" programs are loaded – see.
Booting And Shutting Down. Bootstrapping  Bootstrapping is standard term for “starting up a computer”  During bootstrapping the kernel is loaded into.
Chapter 2 Booting and Shutting Down Kim Grempler (Sections 2.0 to 2.3) Leon Dague (Sections 2.4 to 2.7)
 Starting up a computer › Load kernel into memory and execute it. (1)BIOS load and run the MBR (Master Boot Record) (2)MBR searches for the bootable.
Startup and Shutdown1-1 Booting and Shutting Down  Bootstrapping m The computer must pull itself up m Automatic and manual booting m Steps in the boot.
Linux Boot Up Process Bootstrapping –Bootstrapping is the standard term for “ starting up a computer”. During bootstrapping, the kernel is loaded into.
Unix kernel Kernel refers to the core part of an operating system Historically, UNIX kernels are monolithic Newer versions of UNIX allow part of the kernel.
Starting and Stopping Linux. Boot Process BIOS initializes hardware –Loads the boot sector MBR loads the bootloader –Point to kernel Kernel initializes.
Processes & Daemons Chapter IV / Part III. Commands Internal commands: alias, cd, echo, pwd, time External commands, code is in a file: grep, ls, more.
System Startup and Shutdown
Chapter 2 Booting Up and Shutting Down. Computer Center, CS, NCTU 2 Boot Up?
© 2010 VMware Inc. All rights reserved VMware ESX and ESXi Module 3.
System Administration: Linux Track 2 Workshop June 2010 Pago Pago, American Samoa.
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.
UNIX ™ /Linux Overview Unix/IP Preparation Course June 9, 2013 Lusaka, Zambia.
Booting Up and Shutting Down. Computer Center, CS, NCTU 2 Booting Up  Starting up a computer Load kernel into memory and execute it. (1)BIOS load and.
Booting and boot levels
System Startup & Shutdown Objectives –to interpret the Unix startup and shutdown configuration files –to be able to create a customised run level Contents.
Linux Security Anthony Albrecht – Services & Accounts
1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise.
2/19/2003 Lecture 3 Computer System Administration Lecture 3 Setup (continued)
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2010 by Scott Orr and the Trustees of Indiana University.
UNIX ™ /Linux Overview Unix/IP Preparation Course May 23, 2010 Kigali, Rwanda.
UNIX ™ /Linux Overview Unix/IP Preparation Course May 25, 2014 Djibouti.
14 Step-by-Step Instructions for an Upgrade Installation n Prepare for the installation Verify that all devices and applications are Windows 2000 compatible.
Linux Administration. Pre-Install Different distributions –Redhat, Caldera, mandrake, SuSE, FreeBSD Redhat Server Install –Check HCL –Significant issues.
PacNOG 6: Nadi, Fiji Terminal and Console Access Hervey Allen Network Startup Resource Center.
FreeBSD Overview Comparison with Linux ccTLD Workshop September 12, 2005 Nairobi, Kenya Hervey Allen.
Linux Security. Module 13 – Linux Security ♦ Overview Linux is more prone today to security loopholes and attacks, both inside and outside the network.
UNIX ™ /Linux Overview Unix/IP Preparation Course May 29, 2011 Dar es Salaam, Tanzania.
Daemons Ying Zhang CMSC691X, Summer02. Outline  Introduction  Init and Cron  System daemons  Print daemons and NFS daemons  Time synchronization.
PacNOG 7: Pango Pango, American Samoa Terminal and Console Access Hervey Allen Network Startup Resource Center.
Unix network Services. Configuring a network interface In Unix there are essentially two commands that are used to enable TCP/IP. ifconfig route.
Chap 11 System Admin: Core Concepts. A well-maintained system… Runs quickly enough so users don’t get frustrated Has enough storage to accommodate users’
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2009 by Scott Orr and the Trustees of Indiana University.
Unix System Administration Booting and Shutting Down Chapter 2.
Sys Admin Course Service Management Fourie Joubert.
Overview A) Power on or reset B) 1st stage boot loader C) 2nd stage boot loader D) Operate system.
Linux Introduction Linux was developed in the early 1990’s by Linus Torvald computer science student at the University of Helsinki Linux is distributed.
System Administration Startup Process. Why Care? ● Every process on your system comes about by following a specific chain of events from the machine startup.
Introduction to Unix AfNOG 2007 Workshop April 22, Abuja, Nigeria Hervey Allen Phil Regnauld.
Getting Started with Linux
The Linux Kernel About 6 million lines of code
VMware ESX and ESXi Module 3.
Booting Up and Shutting Down
CIT 480: Securing Computer Systems
Chapter 4 Booting and Shutdown
Booting Up and Shutting Down
Services & Settings.
CONFIGURING HARDWARE DEVICE & START UP PROCESS
UNIX Services and Daemons
OPS235: Week 1 Installing Linux (Lab1: Investigations 4 - )
SUSE Linux Enterprise Desktop Administration
Post Install Configuration FreeBSD
Booting Up and Shutting Down
System Administration Practice Homework2 - File System Server
Services Management frank.
Managing Cisco IOS Software
Lecture 10 review Booting sequence in Brief
Services & Settings lctseng.
Objectives Topic 2.6 Understanding the boot process
Presentation transcript:

FreeBSD startup and repair AfNOG 2007 Abuja, Nigeria Hervey Allen Materials from Brian Candler

What happens at startup? The BIOS loads and runs the MBR A series of "bootstrap" programs are loaded see man boot Kernel is loaded, and perhaps some modules controlled by /boot/loader.conf The root filesystem is mounted

Then... /sbin/init is run This is always the first process, so has pid=1 In normal operation it executes the main startup script /etc/rc This in turn runs other scripts /etc/rc.d/* The order is determined by dependency information within the scripts Each script reads /etc/rc.conf to decide whether a service is wanted or not and to get options init also controls console logins

How login shells are started console init ® getty ® login ® <shell> controlled by /etc/ttys ssh sshd started by /etc/rc.d/sshd sshd ® login ® <shell> ftp (avoid) inetd started by /etc/rc.d/inetd inetd ® ftpd ® login ® <shell> controlled by /etc/inetd.conf inetd doesn't run unless you explicitly enable it

Single-user mode If "single user mode" is chosen at startup, init just runs a single root shell No startup scripts are run, meaning: filesystems are not mounted daemons are not started no remote logins Safest state for repairing the system You will see this in the exercise

/boot/loader.conf Controls the kernel loader Examples: snd_driver_load="YES" load all possible sound modules snd_ich_load="YES" load just the "ich" sound module if_wi_load="YES" load the "wi" network interface module hint.acpi.0.disabled="1" Disable ACPI power management kern.maxproc=5000 Set size of kernel process table

What to put in /boot/loader.conf? Look in /boot/defaults/loader.conf copy entries from here, but don't change this file /boot/loader.conf overrides items in /boot/defaults/loader.conf Look in /usr/src/sys/i386/conf/GENERIC.hints Look in the handbook You don't have to load all modules at bootup you can load them later with kldload kldload snd_driver show loaded modules with kldstat

/etc/rc.conf Controls behaviour of startup scripts Examples: sshd_enable="YES" DO start the ssh daemon ntpdate_enable="YES" synchronise clock at bootup ntpdate_flags="-b ntp-1.example.net" which time server(s) to synchronise to ifconfig_fxp0="192.0.2.1/24" configure network interface(s)

What to put in /etc/rc.conf? Look in /etc/defaults/rc.conf copy entries from here, but don't change this file The /etc/rc.d/* scripts are just plain old shell scripts With experience you can read them, work out what they are doing, and what settings they use

Plain old shell scripts Most system settings have a command-line tool to set them e.g. "ifconfig" configures a network interface The system forgets state when you reboot All that the startup scripts do is to run the correct commands for you, using information taken from /etc/rc.conf

You can write your own startup scripts /etc/rc.local Or put scripts in /usr/local/etc/rc.d/ Better, as you can have one script per service