Devices, Linux Filesystems,and the Filesystem Hirarchy standard

Slides:



Advertisements
Similar presentations
Va-scanCopyright 2002, Marchany Unit 8 – Solaris File Systems Randy Marchany VA Tech Computing Center.
Advertisements

Linux+ Guide to Linux Certification, Second Edition
Chapter 9 Part III Linux File 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.
A Guide to Unix Using Linux Fourth Edition
CIS 240 Introduction to UNIX Instructor: Sue Sampson.
Introduction to Unix (CA263) File System
Exploring the UNIX File System and File Security
GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi.
Lesson 22 – Introduction to Linux Systems Administration.
Linux+ Guide to Linux Certification, Second Edition
Linux Linux File System.
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 8: Adding a Disk — Unix Hard Disk Basics Installation and Configuration Barry Kane CMSC-691X.
File System and Directory Structure in Linux. What is File System In a computer, a file system is the way in which files are named and where they are.
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
Filesystem Hierarchy Standard (FHS) –Standard of outlining the location of set files and directories on a Linux system –Gives Linux software developers.
Manage Directories and Files in 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.
Linux+ Guide to Linux Certification, Second Edition
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.
Chapter 1 Managing Storage. Contents Understanding Partitioning Understanding LVM Understanding RAID Understanding Clustering and GFS Using Access Control.
1 Objectives Manage and install new file systems.
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
File Permission and Access. Module 6 File Permission and Access ♦ Introduction Linux is a multi-user system where users can assign different access permission.
Linux file system "On a UNIX system, everything is a file; if something is not a file, it is a process." Sorts of files (on a Linux system) Directories:
Chapter Two Exploring the UNIX File System and File Security.
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,
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
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.
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop V Files and the File System Part B – File System.
Linux Filesystem WeeSan Lee. Roadmap Disk Partitions The Filesystem Filesystem Mouting & Umounting File Tree File Type File Permission.
CSC414 “Introduction to UNIX/ Linux” Lecture 6. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
Basic UNIX system administration CS 2204 Class meeting 14 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
Materi managing user & groups, file system Managing Software Packages and File Systems The Complete Guide to Linux System Administration Chapter 10.
1 C1-UD 6-6 BASIC LINUX FILE MANAGEMENT. Part IV. File System Administration Academic Year DAI. Credit 1 (Single and Multiuser Operating Systems)
ORAFACT The Linux File System. ORAFACT Filesystem Support Support for dozens of filesystem types including: Minix, ext2, MS-DOS, UMSDOS, VFAT, NTFS, NFS,
1 C1-UD 6-2 INSTALLING LINUX Academic Year DAI. Credit 1 (Single and Multiuser Operating Systems) Ferran Chic PELE-08/09 (Pla Experimental Llengües.
Linux Filesystem Administration
Linux Filesystem Management
Chapter 8 Unix & Linux.
Configuring Disk Quotas
Filesystem Management and Backups
Chapter 11 Command-Line Master Class
Unix System Administration
UBUNTU INSTALLATION
Linux file system "On a UNIX system, everything is a file;
Chapter 6 File Systems CSNB113 SYSTEM ADMINISTRATION
Basic Commands ls cp ls –l (in detail format) echo ls –a
Unix System Administration
BIF703 File Permissions.
Exploring the UNIX File System and File Security
Operating System Module 1: Linux Installation
Linux File Systems Partitioning Mounting File Systems
OPS235: Week 5 Lab4: Investigations 1 – 3
Lecture 43 Syed Mansoor Sarwar
COP 4343 Unix System Administration
Software I: Utilities and Internals
January 26th, 2004 Class Meeting 2
Configuring Disk Quotas
Presentation transcript:

Devices, Linux Filesystems,and the Filesystem Hirarchy standard

Objectives Create Partisions and Filesystems Maintain the integrity of filesystems Control filesystem mounting and unmounting Set and view disk quotas Use file premissions to control access to files Manage file ownership Create and change hard and symbolic links Find system files and place files in the correct location

Disk Drives Under Linux Linux supports all sorts of drives and file system types The two most widley used types are IDE and SCISI IDE = Intergrated Device Electronics drive. SCSI ( pronounced “scuzzy”) , Small Computer System Interface drive.

Hard disk devices IDE /dev/hda = primary Master /dev/hdb = primary Slave /dev/hdc = Secondary Master /dev/hdd = Secondary Slave These may change in the future as the politicaly correct are trying to do away with the terms “Master “ and “Slave”...

Hard disk Drives SCSI /dev/sda first SCSI drive /dev/sdb Second SCSI drive , sdc,sdd,sde , and so on ... Can be up to 15 devices on a single interface , most of the innards are on the interface card where under IDE the innards are on the drive itself. SCSI are typlicaly more expensive and considered more reliable and are used on servers and workstations , where IDE's are typicaly found on desktop machines .

Disk partitions Disk can contain up to 16 partitions. The drive partition is expressed as a number after the drive name , such as “/dev/hda1” for the first partition on the primary master drive.

Partition Types Primary - This type contains a filesystem, up to four may exist. One must be marked as active and contain the operating system so the BIOS can find and load it at boot time. Extended – a varient of the primary , a container for logical partitions. Only one per disk. Logical – from 1 to 12 logical partiitions can be created , logical partitions are numbered from 5 to 16.

The root filesystem and mount points / - the root directory /bin and /sbin - Contains system binarys. /etc – configuration files. /lib - program libraries. /boot - Kernal images and other files used to boot the system.

Mount points cont... /home – user files area. /temp – temporay files space /var – log files /usr – user commands , source files , documentation, ect... /swap – used to enable virtual memory.

Managing Partitions Fdisk [device] Example to work with the primary master drive the command “fdisk /dev/hda” would be used , that by the way is also the default , if no drive is invoked. Swiches , a ,d,l,m,n,p,t,w Demonstration of fdisk

Creating Filesystems Mkfs [ -t fs_type] [fs_options] device Where fs_type is one of the supported file systems like msdos or ext2 or ext3 And fs_options , see man pages for options Device - the partitision you want to work on - mksf is like format command in DOS..

Swap files Syntax – mkswap device Such as “mkswap /dev/hdb3” for make a swap partitition on the first IDE interface , Slave drive, partition number 3 please ...

Maintain the integrity of filesystems Monitor free disk space and Inodes Monitor disk usage Checking filesystem integrity

Df command Syntax – df [options] [directories] “ df ” command gives information about disk space and inode utilization. Options , -h information about space , -i information about inodes. “df -h /dev/hda” , tell me about the space on the primary master drive ....

Du Command or Disk Utilization Syntax: du[options][directories] -a , shows all files , not just directories. -c, grand total. -h , produces out put in a form that us lowly humans can understand ! -s , prints summery -S, Excludes subdirectories from count and totals. Example :

Checking Filesystem Integrity Filesystems can become scrambles because of power failure and othere things. The “fsck” program allows you to restore the superblock with a good copy. Syntax: fsck[-t type] [fs-options] filesystem Example: fsck -f /dev/hda5

Controling Filesystem Mounting and Unmounting Each filesysyem is mounted as a directory to the root file system. To automaticaly mount filesystems at boot time use the “/etc/fstab “ file . The “fstab” file tell the kernal what and where the filesystems are and how they are to be used.

Managing fstab There are 6 fields that make up each line in the fstab file. Each field preforms a different function. Device, mount point, Filesystem type , mount options , Dumb frequency and pass number . Example :

Mounting Filesystems The Mount command is used to mount filesystems. Syntax mount [command_line_options] device derectory Example: to mount a cdrom Mount -t iso9660 /dev/hdc /mnt/cdrom

Unmounting a filesystem Command : umount [options] device | directory Example : umount /cdrom or umount /dev/hdc

Quotas Per-user hard limit Per-user soft limit Per-group hard limit Per-group soft limit Grace period

Quota Commands quota [-u | -g] [options] user | group Displays quota limits. Qutaon [options] [filesystems] Turns on Quotas. Quotaoff [options] [filesystem] Turns off Quotas. Quotacheck [options] filesystems Compiles quota databases , should be run weekly via cron.

Quota Commands cont. Edquota [-p proto-user] [options] names Used to edit quotas for users and groups , it uses vi editor . It is interactive . Repquota [options] filesystems Used to report quotas for users and groups

Enabling Quotas Set options in /etc/fstab , add userquota and grpquota to the default options. Create a “quota.user and quota.group files at the top of the /home filesystem and make it a root access only. Run quotacheck to make the database. Run quotaon to enabel the quota system. Check to see if it's starting up in your init script at boot. Make a cron job to run quotacheck.

Use File Permissions to control access to files. Three Classes of users User – The user that owns the file. Group – The group that owns the file. Other – All others users on the system.

File Permissions Read , mnemonic = r , examine contents of file and list directory contents. Write , mnemonic = w , Write to or change the file and create and remove files in the directory. Execute , mnemonic = x , run the file as a program also read and write files in a directory.

File permissions cont. From left to right user, group, other Mnemonic are used to indicte tru and “-” indicates false. Rw-rw-r-- User has read write permissions ,group has read write permissions and others have only read permissions.

SUID , SGID and Sticky SUID(Set User ID) is for executable files only , if the SUID bit is set the files owner owns the resulting process , no mater who launched the program. SGID(Set Group ID) works the same for groups as SUID does . When set on a directory all files created inside that directory belong to the group. Sticky keeps a program in memory after execution . When used in a team inviroment it allows groups to create and modify files but only file owners can delete or rename them.

Setting Access Modes Umask, used to set initial file modes for a shell session. Chmod , changes mode of a file Chmod [options] symbolic_mode ... files , example: chmod u=rw,go=w aflie chmod[options] octal_mode files, example: chmod 666 afile Chmod +r afile , makes it readable for all class of users ...

Manage file ownership Use chown and chgrp Chown can be used to change both user and group of a file . Chown [options] user-owner files Chown [options] user-owner.group-owner files Chown [options] .group-owner files Chown [options] –reference=rfile files , uses rfile as a template for permissions of files .

Hard and symbolic links A link is pseudofile that creats a shortcut to a file. Symbolic links are tiny flies that contain a pointer to another file. Hard links are not realy a link but a copy of another directory entry. Two directory entries have different names but point to the same inode

Link commands Ln creats a link Ln [options] file link To find the file pointed to by the link use the ls -l command.

Finding files and placing them in the proper location Locating files , commands.. Which , example : which tcsh Find Locate Updatedb Whatis Apropos