Unix System Administration

Slides:



Advertisements
Similar presentations
ITI-481: Unix Administration Rutgers University Center for Applied Computer Technologies Christopher Uriarte, Instructor Meeting 4.
Advertisements

Basic Unix system administration
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.
Linux Installation LINUX INSTALLATION. Download LINUX Linux Installation To install Red Hat, you will need to download the ISO images (CD Images) of the.
GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi.
Lesson 22 – Introduction to Linux Systems Administration.
Guide To UNIX Using Linux Third Edition
Linux Install. Resources Guide to Linux Installation and Administration, Nicholas Wells, Course Technology, 2000.
Lecture 02CS311 – Operating Systems 1 1 CS311 – Lecture 02 Outline UNIX/Linux features – Redirection – pipes – Terminating a command – Running program.
Laksh mi.  fdisk is an interactive utility to manipulate disk partitions.  Use fdisk –l to review the disks and partitions on the system.  Use fdisk.
Chapter 8: Adding a Disk — Unix Hard Disk Basics Installation and Configuration Barry Kane CMSC-691X.
Week 10 Project 3: An Introduction to File Systems
Configuring Disk Quotas Linux System Administration To implement disk quotas, use the following steps: Enable quotas per file system by modifying /etc/fstab.
Guide To UNIX Using Linux Fourth Edition
Unix File System Internal Structures By C. Shing ITEC Dept Radford University.
Linux Installation and Administration – Lesson 5 Tutor: George Papamarkos Topic: Devices in Linux.
Manage Directories and Files in Linux
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Guide to Linux Installation and Administration, 2e1 Chapter 3 Installing Linux.
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
Disks, Filesystems 1.  sudo and PATH (environment)  disks  partitioning  formatting file systems: mkfs command  checking file system integrity: fsck.
1 Project 3: An Introduction to File Systems CS3430 Operating Systems University of Northern Iowa.
Chapter 6: Linux Filesystem Administration
1 Interface Two most common types of interfaces –SCSI: Small Computer Systems Interface (servers and high-performance desktops) –IDE/ATA: Integrated Drive.
1 Objectives Manage and install new file systems.
Linux Administration. Pre-Install Different distributions –Redhat, Caldera, mandrake, SuSE, FreeBSD Redhat Server Install –Check HCL –Significant issues.
Guide To UNIX Using Linux Third Edition Chapter 8: Exploring the UNIX/Linux Utilities.
Manage Directories and Files in Linux. 2 Objectives Understand the Filesystem Hierarchy Standard (FHS) Identify File Types in the Linux System Change.
ITR3 lecture 6: intoduction to UNIX Thomas Krichel
Creating and Managing File Systems. Module 5 – Creating and Managing File Systems ♦ Overview This module deals with the structure of the file system,
1 LINUX SECURITY. 2 Outline Introduction Introduction - UNIX file permission - UNIX file permission - SUID / SGID - SUID / SGID - File attributes - File.
Linux+ Guide to Linux Certification Chapter Six Linux Filesystem Administration.
System Administration – Part 2. Devices in UNIX are files: A device can be accessed with different file names All device files are stored in /dev or its.
Managing Files CSCI N321 – System and Network Administration Copyright © 2000, 2007 by the Trustees of Indiana University except as noted.
Linux Commands C151 Multi-User Operating Systems.
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop V Files and the File System Part B – File System.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
CSCI 330 UNIX and Network Programming Unit XX: Linux Administration.
File system In computing, a file system is a method of storing and organizing computer files and the data they contain to make it easy to find and access.
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
Basic UNIX system administration CS 2204 Class meeting 14 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
System initialization Unit objectives A.Outline steps necessary to boot a Linux system, configure LILO and GRUB boot loaders, and dual boot Linux with.
1 C1-UD 6-6 BASIC LINUX FILE MANAGEMENT. Part IV. File System Administration Academic Year DAI. Credit 1 (Single and Multiuser Operating Systems)
Linux Filesystem Administration
Getting Started with Linux
...looking a bit closer under the hood
Filesystem Management and Backups
Guide to Linux Installation and Administration, 2e
...looking a bit closer under the hood
Unix System Administration
Basic Commands ls cp ls –l (in detail format) echo ls –a
C151 Multi-User Operating Systems
Hands On UNIX AfNOG 2010 Kigali, Rwanda
Unix System Administration
Unix System Administration
Guide To UNIX Using Linux Third Edition
Project 3: An Introduction to File Systems
Unix Systems Administration
Hands On UNIX AfNOG X Cairo, Egypt
Introduction to UNIX.
Operating System Module 1: Linux Installation
Linux File Systems Partitioning Mounting File Systems
...looking a bit closer under the hood
Shells, Help, and Paths.
SUSE Linux Enterprise Desktop Administration
COP 4343 Unix System Administration
Devices, Linux Filesystems,and the Filesystem Hirarchy standard
Configuring Disk Quotas
Presentation transcript:

Unix System Administration Chris Schenk Lecture 03 – Tuesday Jan 22 CSCI 4113, Spring 2008

A few notes The 'root' user An actual user on your machine Troubles with ssh'ing to your machine Network is misconfigured, stop by office hours Startup scripts in /etc/init.d Chapter 2 of the book talks all about booting Under Ubuntu - /etc/inittab replaced with /etc/event.d Lecture slides can overlap

A few more shell tricks In addition to '!!' and !cmd Make an error and can't backspace? First option: set terminal to erase on backspace % stty erase <hit backspace key> All successive backspaces will properly erase Second option: erase the input buffer <ctrl>-u Even works on mis-typed passwords! Third option: erase a single character <ctrl>-h There are plenty more, but we'll get them slowly

VIM Quick Notes Edit a file % vim mycoolfile.txt Once in, you are in 'cmd' mode or something You can enter 'insert' mode with 'i' or insert key Get out of insert mode by hitting escape Quit without saving! :q! Saves your butt more than once Write file :w Force write of file :w! Write and quit :wq

More vi FUN! Search with / Hit 'n' for next, 'N' for last <ctrl-f> - page forward <ctrl-b> - page back dd – delete line x – delete current character u – UNDO! <ctrl-r> - Redo

Shells and Environments Look at available shells – /etc/shells Simply programs executed by the OS Starts with mingetty, spawned by init Executes /bin/login /bin/login checks password and executes shell listed in /etc/passwd Executed as a login shell Privileges changed to your user Variables are created printenv and $echo $VARNAME to see them

Shells and Environments (cont) $PAGER is like $EDITOR man invokes $PAGER update-alternatives changes both Forgot to type sudo before your command? % sudo !! Want to execute the last 'vim' command? % !vim Screen makes your life easier % screen <ctrl>-a, d and screen -r

Filesystems Devices all behave like files, permissions like any other file Partitions and Types physical separation of hard drive space fdisk - ext2, ext3, vfat, swap, reiserfs, xfs Mounts Access to partitions on the system /etc/fstab Features File types, modes, ownership

Features What most users see I own my files (check with stat or ls -l) Type: - (file), b (block dev), c (char dev), d (dir), p (pipe), l (symlink), s (socket) Read/Write/eXecute (rwx), user, group other Size, Timestamps Name! What users don't usually see Reference count, INODE number Access and Change time

Devices /dev directory describes all available devices /dev/cdrom, /dev/sda* Different device types block 'b', character stream 'c', pipe 'p' TTYs, sound card, hard drives, cd drives Filesystems use block devices /dev/hda, /dev/sda, /dev/scd0

Hard Drive Devices Labeling differs for IDE and SCSI devices IDE uses /dev/hd* Primary IDE channel 1 - /dev/hda Primary IDE channel 2 - /dev/hdc SCSI uses /dev/sd* Based on SCSI channel ID SCSI channel 1 - /dev/sda SCSI channel 2 - /dev/sdb

Partitions A device is divided into physical extents Physical extents are raw Filesystems built on top of partitions! Numbers are placed after device IDs First partition on IDE device /dev/hda is /dev/hda1 Second partition on SCSI device /dev/sdb is /dev/sda2

fdisk – Partition Table Manipulator usage: fdisk <device> fdisk /dev/sda 'm' – print help 'p' – print partition table 'n' – add new partition 't' – change partition's system ID 'w' – write changes to disk

Partition Table Same sector as the Master Boot Record (MBR) 64-byte data structure, each entry 16 bytes long Maximum of 4 partitions! 10 fields in each entry in the table Bootable flag starting/ending head/sector/cylinder System ID

System ID Describes the filesystem on each partition independent to the OS, standard format one bytes long, 256 total entries available 0x06 (FAT16), 0x07 (NTFS), 0x05 (Extended), 0x82 (linux) Read by the OS at boot time need to know which modules to load

Filesystems Partitions must be formatted to a specific filesystem mkfs utility different versions, mkfs.ext3, mkfs.reiser, etc Each filesystem requires a module in the kernel lsmod (list modules) utility 'used by' number of devices

Mounts Filesystem starts at / (root) not to be confused with root user tree structure starting a /, branching with directories A partition may be mounted to any point on the tree partitions always mounted to directories: /dev/sda1 - / /dev/sda2 - /usr /dev/sda5 - /var

Mounts (cont) How do you see your current mounts? mount command df command (with -h parameter) mount shows options on the filesystem [no]exec, [no]atime, defaults, nosuid, ro/rw Partitions mounted at boot time read from a config file /etc/fstab Manually mounted partitions looked up in fstab manual override of options

/etc/fstab Six fields for each line device or label, mount point, filesystem type, options, dump enable, fsck priority Some devices are marked 'none' filesystems used by the kernel for special tasks process information, device addresses CDRoms list 'auto' for filesystem type three types of cdrom filesystems: IS9660, Joilet, HFS Data is the same, but the filesystem metadata is different

More on mount Manual mounting mount [-o <options>] <device> <mount point> For entries in /etc/fstab only the device or mount point is needed mount /windows Shows more information than simple devices? NFS mounts

Mount Options defaults contains a number of options rw, suid, dev, exec, auto, nouser, async rw/ro – Mount read/write, readonly [no]exec – Allow/disallow execution of binaries [no]suid – Allow/disallow setuid/setgid bits to work [no]user – Allow/disallow a user to mount the filesystem

umount Used to unmount a filesystem Almost identical in usage umount <device | mount point> Problems may arise umount: /home: device is busy no file handles can be open if the device is to be unmounted sitting in a directory on a device means files are open! Your shell has handles open

lsof – List Open Files Great utility for debugging many types of problems Everything under linux is a file so we can see almost anything with lsof! Usage Open files: lsof <file> Open ports: lsof -i tcp:<port> Processes: lsof -p <pid>