Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000,...

30
Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University

Transcript of Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000,...

Page 1: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

Device and Filesystem Management

CSCI N321 – System and Network Administration

Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University

Page 2: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

Section Overview

Devices and Files

Drives and Partitions

Filesystem Management

Network Filesystems

Page 3: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

References

CQU 85321 System Administration Course

TextbookChapter 11

Lectures2002 #10

Page 4: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

Kinds of DevicesPhysical Devices Actual hardware Examples

Hard Drives, CDROMs, Floppy Network cards and modems

Logical Devices Pseudo devices Examples

Virtual Terminals Network Ports

Page 5: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

Interrupt Handling

UserUser

SupervisorSupervisor

SystemSystemCallCall

Interrupt Vector 0Interrupt Vector 0

Interrupt Vector Interrupt Vector n-n-11Interrupt Vector Interrupt Vector nn

InterruptInterruptHandler Handler nn

Interrupt vector tableInterrupt vector table

MemoryMemory

Trap Trap nn

Page 6: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

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

Page 7: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

Making Device Files

mknod filename type major minor

filename: Name of the device fileType “c” – Character Device “b” – Block Device

Major Number: Type of device driverMinor Number: Instance (which one)/dev/MAKEDEV: Creation program

Page 8: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

Disk Geometry

TracksTracksSectorsSectors

Read/write HeadsRead/write Heads

CylindersCylinders

PartitionsPartitions

PlattersPlatters

Page 9: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

Common Disk Types

SCSI Many cable types

SATA (IDE Family)SASFibre Channel High Bandwidth

Solid State Devices (SSD)Universal Serial Bus (USB) Removable Media

Page 10: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

UNIX FilesystemsDefines how data is stored on drivesMultiple types of filesystems supportedBoot Block (1st block) Stores the bootstrap loader program

Superblock (2nd 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

Page 11: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

Filesystems and Partitions

/ (root)

bin varusretchome

scott bobalice bin sbin local lib

man lib srcsharebin

Page 12: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

SuperSuperBlockBlock

GroupGroupDescriptorsDescriptors

Ext2/3/4 File Systems

BootBootBlockBlock Block GroupBlock Group Block GroupBlock Group Block GroupBlock Group

DataDataBitmapBitmap

InodeInodeBitmapBitmap

InodeInodeTablesTables

DataDataBlocksBlocks

Page 13: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

NTFS File System

BootBootBlockBlock

Master FileMaster FileTable (MFT)Table (MFT)

SystemSystemFilesFiles File AreaFile Area

StandardStandardInformationInformation

File/DirFile/DirNameName

SecuritySecurityDescriptorDescriptor

Data orData orIndexIndex

Source: http://technet.microsoft.com/en-us/library/cc750198.aspxSource: http://technet.microsoft.com/en-us/library/cc750198.aspx

Page 14: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

Why Partition?

Not enough space on one diskSeparation of data Read-only areas Spool areas and free space OS upgrades

BackupsPerformance

Page 15: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

Virtual File SystemUser ProcessUser Process

Device DriverDevice Driver

NTFSNTFSISO9660ISO9660Ext3Ext3

System call InterfaceSystem call Interface

VFSVFS

Buffer CacheBuffer Cache

KernelKernel

Page 16: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

Managing FilesystemsCreating 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 partitionfsck Check/fix filesystem errors Journaling filesystems

Quotas?

Page 17: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

RAID StorageRedundant Array of Independent (Inexpensive) DrivesLevel 0 – Data Blocks spread across 2 or more drives (striping). No fault toleranceLevel 1 – Each disk copied (mirrored) to another diskLevel 0+1 – Each drive with striped data is mirroredLevel 5 – Data and fault tolerance (parity) striped across disksLevel 6 – Same as level 5 but with 2 parity disks

Page 18: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

RAID 0

Usable Storage? All

Performance? Read and Write

Improvement

No Fault Tolerance

Source: http://www.prepressure.com/library/technology/raidSource: http://www.prepressure.com/library/technology/raid

Page 19: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

RAID 1

Usable Storage? ½ available

Performance Improvement Read

Fault Tolerant

Source: http://www.prepressure.com/library/technology/raidSource: http://www.prepressure.com/library/technology/raid

Page 20: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

Raid 10

Storage Usage? ½ Available

Performance Read and Write

Fault TolerantRAID 0+1

Source: http://www.prepressure.com/library/technology/raidSource: http://www.prepressure.com/library/technology/raid

Page 21: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

RAID 5

Need at least 3 DisksUsable Storage N – 1 (Disks)

Performance Improvement Read

Hot Spare(s)

Source: http://www.prepressure.com/library/technology/raidSource: http://www.prepressure.com/library/technology/raid

Page 22: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

RAID 6

Need 4+ DisksUsable Storage: N -2 (Disks)Performance Improvement: ReadFault TolerantHot spare(s)

Source: http://en.wikipedia.org/wiki/Standard_RAID_levelsSource: http://en.wikipedia.org/wiki/Standard_RAID_levels

Page 23: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

Logical Volume Management

Physical VolumePhysical Volume20GB20GB

Physical VolumePhysical Volume36GB36GB

Physical VolumePhysical Volume34GB34GB

/boot/boot2GB2GBext3ext3

Logical Volume GroupLogical Volume Group90GB90GB

Logical VolumeLogical Volume/home/home50GB50GB

Logical VolumeLogical Volume//

25GB25GB

Free SpaceFree Space15GB15GB

Page 24: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

Network Filesystems

Filesystems shared via NFSClient-side: similar to local mountServer – exports shared filesystems mountd and nfsd /etc/exports and exportfs Access permissions should be selective

showmount –eCIFS – Microsoft filesystem sharing Samba – CIFS support for Linux/MAC

Page 25: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

Printer Connections

Local Parallel USB

Remote/SharedNetwork

Page 26: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

Printing Languages

PCL (Hewlett Packard)Postscript (Adobe)PDF (Adobe)XHTML

Page 27: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

CUPS

Client/Server Applicationcupsd – CUPS Server cupsd.conf printers.conf classes.conf

Web Administration – Port 631

Page 28: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

Printer Configuration

Printer NameConnection info Local (LPT, Serial, etc.) Network (lpd, JetDirect/Socket, HTTP) Shared (SMB)

Device Driver or PPDs

Page 29: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

Print Commands

Printing lpr –P<printer> mpage –P<printer>

Queue Status: lpq –P<printer>Status: lpstat –tConfiguratation: lpadmin cupsenable/cupsdisable accept/reject

Page 30: Device and Filesystem Management CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.

Windows Printer Management

“Devices and Printers”Add Printer Wizard Name Connection (Local or Address/Port) Device Make and Model

Printer Sharing