Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2010 by Scott Orr and the Trustees of Indiana University
Section Overview Devices and Files Drives and Partitions Filesystem Management Network Filesystems
References CQU System Administration Course Textbook Chapter 11 Chapter 11 Lectures 2002 # #10
Kinds of Devices Physical Devices Actual hardware Examples Hard Drives, CDROMs, Floppy Network cards and modems Logical Devices Pseudo devices Examples Virtual Terminals Network Ports
Interrupt Handling User Supervisor SystemCall Interrupt Vector 0 Interrupt Vector n-1 Interrupt Vector n Interrupt Handler n Interrupt vector table Memory Trap n
Device Drivers and Files Device drivers Software to control hardware Compiled into the kernel Dynamically loaded module Device files Located in /dev Provide application access to device Driver must also be present to use
Making Device Files mknod filename type major minor filename: Name of the device file Type “c” – Character Device “b” – Block Device Major Number: Type of device driver Minor Number: Instance (which one) /dev/MAKEDEV : Creation program
Disk Geometry Tracks Sectors Read/write Heads Cylinders Partitions Platters
UNIX Filesystems Defines how data is stored on drives Multiple types of filesystems supported Boot Block (1 st block) Stores the bootstrap loader program Superblock (2 nd block) Copies scattered throughout the partition Stores information about the partition Partition Size Type of File system Block Size Size & Location of inode tables Free Block list
Filesystems and Partitions / (root) binvarusretchomescottbobalicebinsbinlocallibmanlibsrcsharebin
Ext2/Ext3 File Systems LabelPartitionPartitionPartition ZoneZoneZoneZoneZone SuperBlockInodeBitmapDataBitmapInodeBlocksDataBlocks Source: Forensic Discovery By Dan Farmer and Wietse Venema
Why Partition? Not enough space on one disk Separation of data Read-only areas Spool areas and free space OS upgrades Backups Performance
Virtual File System User Process Device Driver NTFSISO9660Ext3 System call Interface VFS Buffer Cache Kernel
Managing Filesystems Creating a new filesystem Similar to DOS format mkfs – creates a filesystem (many aliases) mount – mount a partition Mount point must exist (directory) /etc/fstab umount – Unmount a partition fsck Check/fix filesystem errors Journaling filesystems Quotas?
RAID Storage Redundant Array of Independent (Inexpensive) Drives Level 0 – Data Blocks spread across 2 or more drives (striping). No fault tolerance Level 1 – Each disk copied (mirrored) to another disk Level 0+1 – Each drive with striped data is mirrored Level 5 – Data and fault tolerance (parity) striped across disks
Logical Volume Management Physical Volume 20GB 36GB 34GB/boot2GBext3 Logical Volume Group 90GB Logical Volume /home50GB /25GB Free Space 15GB
Network Filesystems Filesystems shared via NFS Client-side: similar to local mount Server – exports shared filesystems mountd and nfsd /etc/exports and exportfs Access permissions should be selective showmount -e Samba – Microsoft filesystem sharing
Printer Connections Local Parallel USB Remote/Shared Network
Printing Languages PCL (Hewlett Packard) Postscript (Adobe) PDF (Adobe) XHTML
CUPS Client/Server Application cupsd – CUPS Server cupsd.conf printers.conf classes.conf Web Administration – Port 631
Printer Configuration Printer Name Connection info Local (LPT, Serial, etc.) Network (lpd, JetDirect/Socket, HTTP) Shared (SMB) Device Driver or PPDs
Print Commands Printing lpr –P mpage –P Queue Status : lpq –P Status: lpstat –t Configuratation: lpadmin cupsenable/cupsdisable accept/reject
Windows Printer Management “Devices and Printers” Add Printer Wizard Name Connection (Local or Address/Port) Device Make and Model Printer Sharing