Www.ischool.drexel.edu INFO 320 Server Technology I Week 4 Basic Unix commands 1INFO 320 week 4.

Slides:



Advertisements
Similar presentations
Basic Unix system administration
Advertisements

2 © 2004, Cisco Systems, Inc. All rights reserved. IT Essentials I v. 3 Module 4 Operating System Fundamentals.
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.
Week 8 System Initialization and X Windows. Objectives  Summarize the major steps necessary to boot a Linux system  Configure the LILO and GRUB boot.
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+ Guide to Linux Certification, Second Edition
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.
Booting the Linux Kernel Dr. Michael L. Collard 1.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Second Edition
Booting And Shutting Down. Bootstrapping  Bootstrapping is standard term for “starting up a computer”  During bootstrapping the kernel is loaded into.
What You Will Learn Components of a computer’s system software The importance of an operating system Functions of an operating system Types of user interfaces.
Linux+ Guide to Linux Certification, Second Edition Chapter 3 Linux Installation and Usage.
1 Web Server Administration Chapter 3 Installing the Server.
Lesson 4-Installing Network Operating Systems. Overview Installing and configuring Novell NetWare 6.0. Installing and configuring Windows 2000 Server.
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
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.
Ch 11 Managing System Reliability and Availability 1.
Linux+ Guide to Linux Certification, Third Edition
CompTIA Linux+ Certification
Linux+ Guide to Linux Certification Chapter Three Linux Installation and Usage.
Chapter-4 Windows 2000 Professional Win2K Professional provides a very usable interface and was designed for use in the desktop PC. Microsoft server system.
Booting and boot levels
Basic Input Output System
Guide to Linux Installation and Administration, 2e1 Chapter 3 Installing Linux.
System Startup & Shutdown Objectives –to interpret the Unix startup and shutdown configuration files –to be able to create a customised run level Contents.
MAC OS – Unit A Page: 10-11, Investigating Data Processing Understanding Memory.
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2010 by Scott Orr and the Trustees of Indiana University.
Installation Overview Lab#2 1Hanin Abdulrahman. Installing Ubuntu Linux is the process of copying operating system files from a CD, DVD, or USB flash.
CS 390 Unix Programming Summer Unix Programming - CS 3902 Course Details Online Information Please check.
Linux Administration. Pre-Install Different distributions –Redhat, Caldera, mandrake, SuSE, FreeBSD Redhat Server Install –Check HCL –Significant issues.
IT2204: Systems Administration I 8b).Booting (Supplementary Notes)
Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.
System Startup & Shutdown
UNIX (Linux) Introduction Module-1. OS Kernel In computing, the kernel is the central component of OS. It is a bridge between applications and the actual.
Linux Startup Process Presenter: Dipu Gupta.
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop V Files and the File System Part B – File System.
Understanding Memory.
Genesis: From Raw Hardware to Processes Andy Wang Operating Systems COP 4610 / CGS 5765.
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2009 by Scott Orr and the Trustees of Indiana University.
Copyright © 2007 Heathkit Company, Inc. All Rights Reserved PC Fundamentals Presentation 29 – The ROM/BIOS.
 Contents 1.Introduction about operating system. 2. Minimum requirement for Windows 7 operating system. 3. Procedure to install Window 7 operating system.
Lecture 4 & 5: System Architecture  File systems  Devices  File system permissions  Review of Linux runlevels  In-class exercise.
System initialization Unit objectives A.Outline steps necessary to boot a Linux system, configure LILO and GRUB boot loaders, and dual boot Linux with.
Embedded Software Design Week II Linux Intro Linux Kernel.
UNIX U.Y: 1435/1436 H Operating System Concept. What is an Operating System?  The operating system (OS) is the program which starts up when you turn.
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.
The Boot Process The process of bringing the system from an "off" status to a running state is known as “booting”. The boot process takes place in four.
SYSTEM ADMINISTRATION PART I by İlker Korkmaz and Kaya Oğuz
Guide to Linux Installation and Administration, 2e
Chapter 2: System Structures
Structure of Unix OS.
BIF703 File Permissions.
CONFIGURING HARDWARE DEVICE & START UP PROCESS
Booting Up 15-Nov-18 boot.ppt.
OPS235: Week 1 Installing Linux (Lab1: Investigations 4 - )
The Boot Process The process of bringing the system from an "off" status to a running state is known as “booting”. The boot process takes place in four.
SUSE Linux Enterprise Desktop Administration
Lecture9: Embedded Network Operating System: cisco IOS
Lecture9: Embedded Network Operating System: cisco IOS
The Boot Process The process of bringing the system from an "off" status to a running state is known as “booting”. The boot process takes place in four.
Presentation transcript:

INFO 320 Server Technology I Week 4 Basic Unix commands 1INFO 320 week 4

Overview Now we’re focusing more on practical concerns about how Linux/UNIX works –Booting –Managing Services –Users and Groups –Permissions But first a brief digression about scheduling and memory speeds 2INFO 320 week 4

Installation addendum I recently got a new system, and was very good to set it up right –Make sure the system works out of the box –Test RAM and hard disk – no errors –Install one component at a time, and check for errors for each before adding the next In doing so, I found a surprising increase in RAM speed just from doing an upgrade 3INFO 320 week 4

Memory and speed Recall that a major part of an OS’s job is to manage processes, and where they run As a refinement of the earlier slide about memory speeds, here are examples of speed to access various levels of memory –They are for a GHz four-core Intel Xeon E5506 processor with 4 MB cache and DDR3 800 MHz RAM, before and after a 4 GB RAM upgrade 4INFO 320 week 4

Memory and speed (memtest86+ v2.11) TypeAmountSpeed (MB/s) L1 cache32 kB71,079 L2 cache256 kB28,057 L3 cache4096 kB19,563 RAM (2 GB)2039 MB5,213 RAM (6 GB)6135 MB8,703 5INFO 320 week 4

Memory and speed In contrast, a 2002-era 2 GHz (1993 MHz) Pentium 4 processor with 1 GB of RAM ( MHz DDR SDRAM) got the results on the next slide (same test) –So how much of a factor is CPU clock speed in system performance? –Is 800 MHz RAM four times faster than 200 MHz RAM? Why or why not? 6INFO 320 week 4

Memory and speed (same test) TypeAmountSpeed (MB/s) L1 cache8 kB14,439 L2 cache512 kB12,611 L3 cachenone- RAM (1 GB)1022 MB797 7INFO 320 week 4

Booting From (Frisch, 2002), (Petersen, 2009) and (Rankin, 2009) 8INFO 320 week 4

Bootstrapping The process of bringing a computer to life and preparing it for use is formally known as bootstrapping –As in ‘picking yourself up by your bootstraps’ –This is usually abbreviated to booting We won’t go into huge detail, but an overview of the process is in order 9INFO 320 week 4

Booting overview Power on (or command to reboot) ROM finds boot device, loads boot program Boot program loads kernel into memory Kernel makes sure hardware is happy, runs init program 10INFO 320 week 4

Booting overview 11INFO 320 week 4

Start booting The process of booting varies from one flavor of UNIX/Linux to another, and is also hardware-dependent –We’ll focus on Linux on PC’s Booting starts with permanent instructions executed when the system powers up –Their location can be called ROM, ROS, firmware, or CMOS/nvram (a list of terms is at the end of these notes) 12INFO 320 week 4

Booting Several kinds of devices could be used for booting (examples?) –The ROM (BIOS) program chooses in which order they are checked –It finds the boot device, loads the boot program, and hands control to it On PC’s, ROM loads the master boot program from the master boot record (MBR), at the start of the C: drive 13INFO 320 week 4

Master boot programs On a Windows system, the master boot program could be a simple DOS program On Linux systems, lilo or GRUB can be the master boot program –Then based on input from the user, it knows which kernel to boot –GRUB’s configuration file is at /boot/grub/menu.lst 14INFO 320 week 4

GRUB If you want to change the GRUB configuration use the tool update-grub instead of editing the config file For more GRUB information install –sudo apt-get install grub-doc Can use the HTML reader w3m –w3m /usr/share/doc/grub-doc/html/grub.html 15INFO 320 week 4

Booting The boot program loads the kernel into memory (RAM), and passes control to it –The boot program also checks RAM, looks for key peripherals, might detect new devices The kernel has many names, unix (System V), vmunix (BSD), hp-ux (HP-UX), vmlinux or vmlinuz (Linux) 16INFO 320 week 4

Kernel In Linux the kernel is now modular*, to accommodate all the different kinds of file systems, RAID, encryption, etc. possible –The initrd (initialized RAM disk) file is loaded with the kernel –It decompressed initramfs, which is a RAM filesystem for the kernel to use until it mounts the disk-based root filesystem * It was ‘monolithic’- just load everything right away 17INFO 320 week 4

Booting Then the kernel has control –It initializes itself, runs hardware diagnostics, installs drivers, might test the CPU –Then the kernel runs the first program, init Init is usually* PID 1, found in /sbin/init It is the parent of all other Unix processes and shells Init controls if the system will be booted into multiuser mode or single user mode * Try ps –ef and see for yourself! 18INFO 320 week 4

Multiuser mode The normal boot process goes into multiuser mode –Init verifies the integrity of the filesystems using the fsck utility –Mount local disks –Designate paging areas –Clean up filesystems – check quotas, save recovery files, delete /tmp files 19INFO 320 week 4

Multiuser mode –Start server daemons for printing, , cron jobs, etc. –Start networking daemons, mount remote disks –Enable user logins with agetty process These are accomplished via a lot of services scripts (next section) Now a user can log into the system 20INFO 320 week 4

Single user mode Single user mode (also called service mode or maintenance mode) is used for exclusive access to the system –Often for admin or maintenance functions –Could enter it if file system problems occur that fsck can’t fix Init runs a Bourne shell ( /bin/sh ) as root user; often has limited filesystems loaded 21INFO 320 week 4

Managing Services 22INFO 320 week 4

Services The init daemon manages the startup of services in most traditional System V- based UNIX systems Ubuntu has recently switched to a tool called Upstart for the same purposeUpstart To understand their role, we need to look at run levels 23INFO 320 week 4

Run Levels Services are set up in different run levels from 0 to 6 –Runlevel 0 powerdown state, ready to shut off –Runlevel 1 single user mode –Runlevel 2 normal multiuser mode –Runlevels 3 to 5 are other multiuser modes –Runlevel 6 shutdown and reboot state –Runlevel s or S, single user mode 24INFO 320 week 4

Run Levels There are other special purpose run levels, such as a, b, c, and q To see your current run level try –who -r The default run level for Ubuntu is 2, per /etc/inittab (not used in Desktop) The telinit utility can be used to change run level interactively 25INFO 320 week 4

Run Levels Other key service resources include: –The /etc/init.d directory has startup scripts for every service Most accept start or stop as arguments –Directories /etc/rc0.d through /etc/rc6.d have init scripts for each runlevel These scripts Start, Kill (stop), or Disable (ignore) each service in numeric order 26INFO 320 week 4

Run Levels –The directory /etc/rcS.d has startup scripts that are applied before going to a particular run level So a typical startup would run –Init looks to inittab to find the desired run level (let’s say 2) –Then run the S (start) flagged services in /etc/rcS.d –Then run the services in /etc/rc2.d 27INFO 320 week 4

Run Levels The init daemon keeps running in case there’s a change in run level Services can be manually started or stopped by commanding their scripts –sudo /etc/init.d/networking start –sudo /etc/init.d/networking stop –Use no argument (e.g. start, stop ) to see the available ones 28INFO 320 week 4

xinetd A legacy program for starting and stopping Internet services is xinetd (eXtended InterNET Daemon) –The services it controls are in the directory /etc/xinetd.d –All are disabled by default; enable them by editing their config file, e.g. /etc/xinetd.d/echo –Then reload xinetd to activate them sudo service xinetd reload 29INFO 320 week 4

Upstart Upstart was designed to handle interactive running and stopping of services, beyond what the run level concept can do –Init only changes services when you boot, reboot, or change run level –But some services, like networking, could change during a session 30INFO 320 week 4

Upstart Upstart is event-driven Actions (such as starting or stopping services) can be taken based on events that occur –Events could include startup, shutdown, changing runlevel, plugging in a network cable, removing a flash drive, etc. 31INFO 320 week 4

Upstart Upstart scripts are in /etc/event.d Get a list of all Upstart jobs with –sudo initctl list The default Upstart runlevel is in –/etc/event.d/rc-default –Look for the command telinit 2 –Replaces the inittab file 32INFO 320 week 4

Rebooting and shutting down The boot command can be used to manually reboot, or use reboot The –s qualifier can boot into single user mode –boot -s To shut down from a command line use halt or shutdown –The latter has many configuration options 33INFO 320 week 4

Users and Groups 34INFO 320 week 4

Users Ok, now we have a running system, we need to define users, and assign them to groups In the Desktop GNOME interface, users and groups are managed from –System > Administration > Users and Groups 35INFO 320 week 4

Users From the command line add a user withadd a user –sudo adduser To set or reset a password use –sudo passwd Remove a user with deluserRemove a user –sudo deluser –It can also remove their files and home directory, or remove them from a group 36INFO 320 week 4

Groups The addgroup command creates a new group –sudo addgroup Conversely, delgroup removes a group –sudo delgroup –The group must have no users for whom it is their primary group 37INFO 320 week 4

Other stray commands The who command tells who is logged into the system For keyword-based help, use –man –k keyword Or –apropos keyword If you can’t find a command, use whereis –whereis commandname 38INFO 320 week 4

Permissions 39INFO 320 week 4

Permissions Permissions apply to files, directories, and links Their basis is the right to read, write, and execute –Read is only that –Write includes create, modify or delete –Execute is in the sense of running a script or application 40INFO 320 week 4

Permissions In a full listing ( ls –l ) the permissions for each entry are shown In order, they pertain to the User, their Group members, and Other (anyone else) For each of those categories, read (r), write (w) and execute (x) –So what does rwxr-xr-- mean? –What’s wrong with r-xrwxrwx ? 41INFO 320 week 4

Changing permissions The read, write, and execute can be given numeric values of 4, 2, and 1 respectively and are added for each type of user –So the example rwxr-xr-- becomes what numbers? To change permissions, chmod is used chmod –The value of permissions can be done numerically (like above) or with code letters 42INFO 320 week 4

Changing permissions The numeric format might look like –chmod 751 filename Whereas the text format might say –chmod u+rw filename –Meaning the user (u) adds (+) read and write (rw) permissions to filename –Before the operator, u g o a mean user, group, other, or all users A plus operator adds permissions, - removes them 43INFO 320 week 4

Files and ownership Files have group membership –By default it’s the group of their creator –chgrp can be used to modify the group associated with them Also chown can change the owner and/or group membership of a file chown –chown glenn:prof filename –Assigns owner=glenn and group=prof to filename 44INFO 320 week 4

Terms CMOS = complementary metal oxide semiconductor GRUB = GNU GRand Unified Bootloader lilo = Linux Loader MBR = master boot record, sector 0 on C: drive Nvram = non-volatile random access memory RAM = random access memory ROM = read only memory ROS = read only storage xinetd = eXtended InterNET Daemon 45INFO 320 week 4

References The Official Ubuntu Book, by Benjamin Mako Hill et al, Prentice Hall ISBN Index of Ubuntu community HowTo pages dex dex 46INFO 320 week 4