Linux Installation and Administration – Lesson 5 Tutor: George Papamarkos Topic: Devices in Linux.

Slides:



Advertisements
Similar presentations
Chapter 9 Part III Linux File System Administration
Advertisements

Devices and Drivers (Chapter 7) Khattab Alhabashi UNIX System Administration.
Basic Unix system administration
Linux Installation LINUX INSTALLATION. Download LINUX Linux Installation To install Red Hat, you will need to download the ISO images (CD Images) of the.
04/21/2004CSCI 315 Operating Systems Design1 Disk Management.
Introduction to Unix (CA263) File System
52 Advanced Operating Systems Writing Device Drivers.
Exploring the UNIX File System and File Security
Linux+ Guide to Linux Certification, Second Edition Chapter 3 Linux Installation and Usage.
Lecture 10: The FAT, VFAT, and NTFS Filesystems 6/17/2003 CSCE 590 Summer 2003.
Embedded System Programming Introduction to Device Drivers.
GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi.
Guide To UNIX Using Linux Third Edition
Linux Install. Resources Guide to Linux Installation and Administration, Nicholas Wells, Course Technology, 2000.
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 10 File System Interface
Linux+ Guide to Linux Certification, Third Edition
CompTIA Linux+ Certification
Guide To UNIX Using Linux Fourth Edition
CIS 191: Linux and Unix Class 9 April 1, 2015 Hardware, Project, and Devices.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 5.1 © Copyright IBM Corporation 2008 Unit 4 Working.
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.
Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.
1 Network File Sharing. 2 Module - Network File Sharing ♦ Overview This module focuses on configuring Network File System (NFS) for servers and clients.
RjpSystem Level Programming Operating Systems 1 Having fun withy the Unix Operating System Praxis Week 7 Rob Pooley.
Chapter 6: Linux Filesystem Administration
Chapter Two Exploring the UNIX File System and File Security.
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.
File System Interface. File Concept Access Methods Directory Structure File-System Mounting File Sharing (skip)‏ File Protection.
Chapter 2 (Cont.) The Unix Way Essential System Administration, 3rd Edition.
Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2010 by Scott Orr and the Trustees of Indiana University.
Chapter 5 File Management File System Implementation.
Managing Files. Module 5 Managing Files ♦ Introduction “On a Linux system, everything is a file; if something is not a file, it is a process.” ♦ Topics.
Manage Directories and Files in Linux. 2 Objectives Understand the Filesystem Hierarchy Standard (FHS) Identify File Types in the Linux System Change.
Chapter Two Exploring the UNIX File System and File Security.
Linux Kernel Management. Module 9 – Kernel Administration ♦ Overview The innermost layer of Linux operating system is the kernel, which is a thin layer.
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.
IST 222 Day 3. Homework for Today Take up homework and go over Go to Microsoft website and check out their hardware compatibility list.
An Introduction to Device Drivers Ted Baker  Andy Wang COP 5641 / CIS 4930.
1 © 2001 John Urrutia. All rights reserved. Chapter 4 The LINUX Filesystem.
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.
Manage Directories and Files in Linux Part 2. 2 Identify File Types in the Linux System The file types in Linux referred to as normal files and directories.
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop V Files and the File System Part B – File System.
CSC414 “Introduction to UNIX/ Linux” Lecture 2. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
Linux Filesystem WeeSan Lee. Roadmap Disk Partitions The Filesystem Filesystem Mouting & Umounting File Tree File Type File Permission.
UNIX File System By Vishal Desai. Introduction Basic purpose of file system: Represent and organize the system resources. But UNIX File System also maps.
Filesystem Management and Backups. 2 Section Overview Devices and Files Filesystem Management Network Filesystems Backups.
Hp education services education.hp.com hp education services education.hp.com 1 HP World/Interex 2002 Linux File System Support Chris Cooper (734)
Lab 8 Department of Computer Science and Information Engineering National Taiwan University Lab8 - Root Filesystem 2015/11/10/ 22 1.
Basic UNIX system administration CS 2204 Class meeting 14 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
Implementation Method Linux-USB Gadget Framework –The Linux-USB Gadget Framework makes it easy for peripherals and other devices embedding GNU/Linux system.
Linux Filesystem Administration
Input/Output (I/O) Important OS function – control I/O
Filesystem Management and Backups
Linux Kernel Module Programming
Installing OS.
Chapter 12: File System Implementation
Chapter 6 File Systems CSNB113 SYSTEM ADMINISTRATION
Basic Commands ls cp ls –l (in detail format) echo ls –a
Unix System Administration
Introduction to the Kernel and Device Drivers
An Introduction to Device Drivers
Exploring the UNIX File System and File Security
Operating System Module 1: Linux Installation
Linux File Systems Partitioning Mounting File Systems
Lecture 43 Syed Mansoor Sarwar
Presentation transcript:

Linux Installation and Administration – Lesson 5 Tutor: George Papamarkos Topic: Devices in Linux

Lesson Outline Managing Filesystems –Mounting Disks Managing Devices –Device Files –Loading Device Drivers –Loading Modules Automatically

Managing Devices – Device Files Device Files allow user programs access hw devices on the system through Linux kernel Device Drives in Linux/Unix are part of the monolithic kernel Devices are located under the /dev dir –E.g. /dev/ttyS0 for the 1 st serial port –/dev/hda2 for the 2 nd partition of the 1 st IDE HDD drive

Managing Devices – Device Files Some device files do not correspond to actual devices –E.g. /dev/null acts as a byte sink.Write on this device succeeds always but what is written is ignored Devices are divided to: –Block Devices: Data are read and written in “blocks” E.g. the IDE hard drives –Character Devices: Data are read and written sequentially E.g. serial port

Managing Devices – Device Files In ls –l command in /dev dir, the size of the files has been replaced by two numbers separated by a comma. –brw-rw root disk 3, 0 November /dev/hda –The 1 st value is called major number and the second is called minor number –Major Num: Specifies a particular driver within the kernel –Minor Num: Specifies a particular devices handled by the driver –E.g. All USB devices are handled by the same driver with one major num although for each of them there is a minor num

Working with Device Files Create a device file: mknod -m permissions name type major minor where: name is the full pathname of the device to create, such as /dev/rft0 type is either c for a character device or b for a block device major is the major number of the device minor is the minor number of the device -m permissions is an optional argument that sets the permission bits of the new device file to permissions –E.g. mknod /dev/test b 42 0 Remove a device file: rm /dev/test You can of course create links between devices using ln command

Loading Device Drivers Drivers are cooperating with kernel and they are: –Compiled within the kernel, or –Loaded like external modules to the kernel (like.dll files in Windows) at runtime A module is simply a single object file containing all the code for the driver. –E.g. usbcore.o the module for usb devices

Loading Device Drivers The modules are stored (in most of the systems) in /lib/modules/kernel- version where different dirs per module category exist

Load a Module Command: insmod –insmod usbcore.o The module may fail to load due to dependencies from other modules You have to find by your own and resolve this To avoid this, create a module database with the command: depmod –a, to store all the info about the module After that you can replace insmod with modprobe command, which checks the create database and resolves the module dependencies automatically

Working with modules List the already loaded drivers with: –lsmod Remove a loaded driver with: –Rmmod –E.g. rmmod usbcore

Mounting Filesystems on Devices Filesystem is the way the data are organised and stored (in physical level) on disks Common Filesystems in Linux 1.Ext2/ext3 2.ReiserFS 3.Swap 4.NFS 5.Vfat 6./proc filesystem

Mounting filesystems In order to access any filesystem under Linux, you must mount it on a certain directory. The mount command is used to do this and usually must be executed as root. The format of this command is: mount -t type device mount-point where type is the type name of the filesystem, device is the physical device where the filesystem resides (the device file in /dev), and mount-point is the directory on which to mount the filesystem. You have to create the directory before issuing mount.

Mounting Filesystems E.g. –mount -t vfat /dev/hda2 /mnt/windows To mount the windows hda2 FAT32 partition There are many options to the mount command, which can be specified with the -o switch. One common option to mount is -o ro, which mounts the filesystem as read-only. E.g. CDROMs mount -t iso9660 -r /dev/cdrom /mnt/cdrom

Unmounting Filesystems The inverse of mounting a filesystem is, naturally, unmounting it. Unmounting a filesystem has two effects: –synchronizes the system's buffers with the actual contents of the filesystem on disk –it makes the filesystem no longer available from its mount point. Unmounting is done with the umount command –umount, e.g. umount mnt/windows

/etc/fstab You can find out what devices are mounted, and where, using the mount command with no arguments The system automatically mounts several filesystems when the system boots. This is handled by the file /etc/fstab –Each line in this file is of the format: device mount-point type options e.g. /dev/hda2 /mnt/windows vfat defaults

/etc/fstab The option defaults should be used for most filesystems; it enables a number of other options, such as rw (read-write access), async (buffer I/O to the filesystem in memory asynchronously), and so forth. Another potentially useful option is umask, which lets you set the default mask for the permission bits, something that is especially useful with some foreign filesystems.

/etc/fstab At boot time mount –a command is called that mounts everything listed in /etc/fstab A filesystem does not need to be listed in /etc/fstab in order to be mounted, but it does need to be listed there in order to be mounted "automatically" by mount -a