Introduction to Unix (CA263) File System

Slides:



Advertisements
Similar presentations
Operating Systems File Management.
Advertisements

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.
A Guide to Unix Using Linux Fourth Edition
Pre-Assessment Questions
5 Basic utilities When a user logs in to the Linux operating system the directory that they will start in is their home directory. Most users will have.
Exploring the UNIX File System and File Security
GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi.
Linux+ Guide to Linux Certification, Second Edition
Chapter 5 Accessing Files and Directories. How Directories Get Created OS installation: usr, dev, etc, export, kernel and others places to store installation.
Linux Linux File System.
The UNIX File System.
Guide To UNIX Using Linux Third Edition
File Management System The way a user or application may access files Programmer does not need to develop file management software You take files for granted.
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.
Guide To UNIX Using Linux Fourth Edition
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
The file structure and related utilities CS240 Computer Science II.
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.
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
Guide to Linux Installation and Administration, 2e1 Chapter 3 Installing Linux.
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
Linux Filesystem Last Update Copyright Kenneth M. Chipps Ph.D. 1.
Unix Basics Chapter 4.
1 Web Server Administration Chapter 3 Installing the Server.
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.
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
UNIVERSITY OF COLOMBO SCHOOL OF COMPUTING IT5501 Systems & Network Administration DEGREE OF BACHELOR OF INFORMATION TECHNOLOGY.
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:
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.
ITR3 lecture 6: intoduction to UNIX Thomas Krichel
Chapter 1 : The Linux System Part 2 Lecture 2 11/14/
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
1 © 2001 John Urrutia. All rights reserved. Chapter 4 The LINUX Filesystem.
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.
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control  The Unix file system is set up like a tree branching out from the root.
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.
Slide: 1 UNIX FILE SYSTEM By:Qing Yang ID: Operating System Research Topic December, 2000.
The Unix File system (UFS) Presented by: Gurpreet Singh Assistant Professor Department of School of Computing and Engineering Galgotias University.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
THE FILE SYSTEM Files long-term storage RAM short-term storage Programs, data, and text are all stored in files, which is stored on.
BIF713 File and Directory Management. File System A File System is a structure used to organize programs and data on a computer ’ s storage device Files.
SUSE Linux Enterprise Desktop Administration Chapter 7 Manage Directories and Files.
UNIX filesystem CS 2204 Class meeting 2 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
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.
UNIX/LINUX OPERATING SYSTEM
Chapter 2: Exploring the UNIX File System (For Tuesday Section) File and File Systems.
LINUX Zhengli Zhu, School of Life Sciences. Outline 1. ABC of Linux 2. Basic orers of Linux 3. Bash Programming.
ORAFACT The Linux File System. ORAFACT Filesystem Support Support for dozens of filesystem types including: Minix, ext2, MS-DOS, UMSDOS, VFAT, NTFS, NFS,
BILKENT UNIVERSITY DEPARTMENT OF COMPUTER TECHNOLOGY AND INFORMATION SYSTEMS CTIS156 INFORMATION TECHNOLOGIES II FILES AND FILE SYSTEM STRUCTURE.
Filesystem Management and Backups
Commands Basic syntax of shell commands UNIX or shell commands have a basic structure command -options target command comes first (such as cd or ls) any.
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
Exploring the UNIX File System and File Security
Unix : Introduction and Commands
Lecture 43 Syed Mansoor Sarwar
Welcome to Linux Chap#1.
Chapter 4: The Linux Filesystem
January 26th, 2004 Class Meeting 2
Presentation transcript:

Introduction to Unix (CA263) File System By Tariq Ibn Aziz

Objectives After reading this chapter and completing the exercises, you will be able to: Discuss UNIX/Linux file systems Explain partitions and inodes Understand the elements of the root hierarchy Use the mount command Explain and use paths, pathnames, and prompts Navigate the file system Create and remove directories Copy and delete files Configure file permissions

Understanding UNIX/Linux File Systems File: basic component for data storage UNIX/Linux considers everything to be a file A file system is UNIX/Linux’s way of organizing files on mass storage devices A physical file system is a section of the hard disk that has been formatted to hold files The file system is organized in a hierarchical structure (inverted tree)

Understanding UNIX/Linux File Systems (continued)

UNIX File System Most versions of UNIX and Linux support the UNIX file system (ufs), which is the original native UNIX file system. ufs is a hierarchical (tree structure) file system that is expandable, supports large amounts of storage, provides excellent security, and is reliable. ufs supports journaling, if a system crashes unexpectedly, it reconstruct files or to roll back recent changes for minimal or no damage of the files. ufs also supports hot fixes by moving data automatically from damaged portions of disks to areas that are not damaged.

UNIX File System In Linux, the native file system is called the extended file system (ext or ext fs), which is installed by default. ext is modeled after ufs,

Understanding the Standard Tree Structure The structure starts at the root level Root is the name of the file at this basic level and it is denoted by the slash character (/) Directory: file that can contain other files and directories Subdirectory: directory within a directory The subdirectory is considered the child of the parent directory

Using UNIX/Linux Partitions The section of the disk that holds a file system is called a partition When installing UNIX/Linux, one of the first tasks is deciding how to partition a storage device, or hard disk Hard disks may have many partitions UNIX/Linux partitions are given names LINUX uses hda1 and hda2

Using UNIX/Linux Partitions (continued) Storage devices are called peripheral devices Peripheral devices connect to the computer through electronic interfaces IDE: Integrated Drive Electronics SCSI: Small Computer System Interface

Setting Up Hard Disk Partitions Partitioning your hard disk provides organized space for file systems At least 3 partitions (root, swap, /boot) often recommended Root partition holds root file system directory (/), size depends on installation but often ranges between 1.2 to 5+ GB

Setting Up Hard Disk Partitions (continued) Swap partition acts as a memory extension, often has same size as RAM, enables virtual memory /boot partition used to store OS files comprising kernel, relatively small Other often used partitions include /usr, /home, /var

Using Inodes Inodes are associated with directories and files in ufs and ext file systems An inode contains the name, general information, and location information (a pointer) for a file or directory

Using Inodes The file system itself is identified by the superblock A superblock contains information about block layout on a specific partition Without the superblock, the file system cannot be accessed. For this reason, many copies of the superblock are written into the file system at the time the file system is created through partitioning and formatting. If the superblock is destroyed, you can copy one of the superblock copies over the original, damaged superblock to restore access to the file system.

Exploring the Root Hierarchy UNIX/Linux must mount a file system before any programs can access files on it To mount a file system is to connect it to the directory tree structure The root file system is mounted by the kernel when the system starts

Exploring the Root Hierarchy (continued) The root directory contains sub-directories that contain files: /bin contains binaries, or executables needed to start the system and perform system tasks /boot contains files needed by the bootstrap loader as well as kernel images /dev contains system device reference files, such as the hard disks, mice, printers, consoles, modems, memory, floppy disks, and CD-ROM drives.

Exploring the Root File Hierarchy (continued) Root subdirectories continued: /etc contains configuration files that the system uses when the computer starts /home is used to offer disk space for users /lib contains kernel modules, security information, and the shared library images /mnt contains mount points for temporary mounts by the system administrator. A temporary mount is used to mount a removable storage medium, such as a floppy disk or CD/DVD /proc is a virtual file system allocated in memory only

Exploring the Root File Hierarchy (continued) Root subdirectories continued: /root is the home directory of the root user, or the system administrator /sbin contains essential network programs used only by the system administrator /tmp is a temporary place to store data during processing cycles, for example sorting /usr partition houses software offered to users /var contains subdirectories which have sizes that often change, such as error logs. For incoming mail and printing spooling we have /var/spool/mail subdirectory or /var/spool/lpd subdirectory,

Using the mount Command Users can access mounted file systems which they have permission to access Additional file systems can be mounted at any time using the mount command To ensure system security, only the root user uses the mount command

Using the mount Command Suppose you want to access files on a CD-ROM for your organization.You or the system administrator can mount a CD-ROM by inserting a disk in the CD-ROM drive, and thenusing the following mount command: mount -t iso9660 /dev/cdrom /mnt/cdrom This command mounts the CD on a device called “cdrom” located in the /dev directory. The actual mount point in UNIX/Linux is /mnt/cdrom, a directory that references the CD-ROM device. After the CD is mounted, you can access its files through the /mnt/ cdrom directory.

Using the unmount Command system administrator unmounts them using the umount command before removing the storage media, umount /mnt/floppy umount /mnt/cdrom

Using Paths, Pathnames, and Prompts To specify a file or directory, use its pathname, which follows the branches of the file system to the desired file A forward slash (/) separates each directory name The UNIX/Linux command prompt may indicate your location within the file system Use the UNIX/Linux pwd command to display the current path name

Configure Shell Prompt

Configure Shell Prompt

Configure Shell Prompt An environment variable, PS1, contains special formatting characters that determine your prompt’s configuration. variable contains: [\u@\h \W]\$ Characters that begin with \ are special Bash shell formatting characters.

Navigating the File System To navigate the UNIX/Linux directory structure, use the cd (change directory) command UNIX/Linux refers to a path as either: Absolute - begins at the root level and lists all subdirectories to the destination file Relative - begins at your current working directory and proceeds from there

Using Dot and Dot Dot Addressing Techniques UNIX/Linux interpret a single dot (.) to mean the current working directory Two dots (..) mean the parent directory cd .. moves you up a level in the directory structure

Listing Directory Contents The ls (list) command displays a directory’s contents, including files and subdirectories

Using Wildcards A wildcard is a special character that is used as a placeholder The * wildcard represents any group of characters in a file name The ? wildcard represents a single character in a file name

Creating and Removing Directories and Files mkdir (make directory) command Create a new directory rmdir (make directory) command Delete an empty directory cp (copy) command Copy files from one directory to another rm (remove) command Delete files

Configuring File Permissions for Security

Configuring File Permissions for Security (continued) Owner has read w Owner has write x Owner has execute Group has read - Group does not have write Group has execute Others have read Others do not have write Others have execute

Configuring File Permissions for Security (continued) chmod command To set file permissions Settings are read (r), write (w), execute (x) The three types of users are owners, groups, and others Setting permissions to directories Use the execute (x) to grant access

Chapter Summary In UNIX/Linux, a file is the basic component for data storage and UNIX and Linux consider everything a file A file system is UNIX/Linux’s way of organizing files on mass storage devices and each file is referenced using a correct and unique pathname The section of the mass storage device that holds a file system is a partition

Chapter Summary (continued) You can customize your command prompt to display the current working directory name, the current date and time, and several other items The ls command displays the names of files and directories contained in a directory Use the chmod command to set permissions such as read (r), write (w), execute (x) for files that you own