Introduction to unix and linux

Slides:



Advertisements
Similar presentations
1. HDD Partition Setup Insert Booting Diskette to A: drive and turn on the power. Then it will be boot by floppy diskette. 1 Type FDISK and press Enter.
Advertisements

Chapter 6 File Systems 6.1 Files 6.2 Directories
1 Chapter 12 File Management Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Hard Disks Low-level format- organizes both sides of each platter into tracks and sectors to define where items will be stored on the disk. Partitioning:
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
Chapter 12: File System Implementation
File and Disk Maintenance
Chapter 9 Part III Linux File System Administration
4.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 4: Organizing a Disk for Data.
File Management.
Troubleshooting Startup Problems
Sistemas de Ficheiros Ficheiros Diretórios
Chapter 6 File Systems 6.1 Files 6.2 Directories
COMP091 – Operating Systems 1
Operating Systems File Management.
Chapter 4 : File Systems What is a file system?
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.
File System Analysis.
FILE SYSTEMS. File Names 1 to 255 characters in length  This includes the path You can use uppercase and lowercase (case-aware, but not case-sensitive)
Introduction to Unix (CA263) File System
Exploring the UNIX File System and File Security
Lecture 10: The FAT, VFAT, and NTFS Filesystems 6/17/2003 CSCE 590 Summer 2003.
File management in UNIX and windows 2000
Connecting with Computer Science, 2e
GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi.
Ceng Operating Systems
Computer Forensics Principles and Practices by Volonino, Anzaldua, and Godwin Chapter 6: Operating Systems and Data Transmission Basics for Digital Investigations.
Wince File systems. File system on embedded File system choice on embedded is important –File system size can be an issue –Different media are used –
Guide To UNIX Using Linux Third Edition
5.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 5: Working with File Systems.
Installing Windows XP Professional Using Attended Installation Slide 1 of 41Session 2 Ver. 1.0 CompTIA A+ Certification: A Comprehensive Approach for all.
MCSE Guide to Microsoft Windows 7 Chapter 5 Managing File Systems.
Guide To UNIX Using Linux Fourth Edition
Objectives Learn what a file system does
LIS508 lecture 5: storage devices Thomas Krichel
Presented to: Sir Ahmad Karim
®® Microsoft Windows 7 for Power Users Tutorial 5 Comparing Windows 7 File Systems.
 FILE S SYSTEM  DIFFERENT FILE SYSTEMS  FILE SYSTEM COMPONENTS  FILE OPERATIONS  LOG STRUCTERD FILE SYSTEM  FILE EXAMPLES.
Guide to Operating Systems, 4th ed.
4 1 Operating System Activities  An operating system is a type of system software that acts as the master controller for all activities that take place.
Window NT File System JianJing Cao (#98284).
Chapter Two Exploring the UNIX File System and File Security.
File System Management File system management encompasses the provision of a way to store your data in a computer, as well as a way for you to find and.
1 Interface Two most common types of interfaces –SCSI: Small Computer Systems Interface (servers and high-performance desktops) –IDE/ATA: Integrated Drive.
Managing Disks and Drives Chapter 13 powered by dj.
The disk surface is divided into tracks. into tracks. 1.
MCSE GUIDE TO MICROSOFT WINDOWS 7 Chapter 5 Managing File Systems.
Chapter 3 Partitioning Drives using NTFS and FAT32 Prepared by: Khurram N. Shamsi.
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.
MCSE Guide to Microsoft Windows Vista Professional Chapter 5 Managing File Systems.
FILE SYSTEMS. Presented to: Sir. Ahmad Kareem Presented by: Sadia Rasheed Bsit
THE FILE SYSTEM Files long-term storage RAM short-term storage Programs, data, and text are all stored in files, which is stored on.
File system In computing, a file system is a method of storing and organizing computer files and the data they contain to make it easy to find and access.
MCSE GUIDE TO MICROSOFT WINDOWS 7 Chapter 5 Managing File Systems.
NTFS Filing System CHAPTER 9. New Technology File System (NTFS) Started with Window NT in 1993, Windows XP, 2000, Server 2003, 2008, and Window 7 also.
Digital Forensics Dr. Bhavani Thuraisingham The University of Texas at Dallas Lecture #8 File Systems September 22, 2008.
Chapter 8 File Systems FAT 12/16/32. Defragmentation Defrag a hard drive – Control Panel  System and Security  Administration tools  Defrag hard drive.
Hands-On Microsoft Windows Server 2008 Chapter 7 Configuring and Managing Data Storage.
Guide to Operating Systems, 5th Edition
Guide to Operating Systems, 5th Edition
Working with Disks Lesson 4.
Chapter 6 File Systems CSNB113 SYSTEM ADMINISTRATION
Windows XP File Systems
File Management.
Exploring the UNIX File System and File Security
File Managements.
Chapter 16 File Management
Partitioning & Formatting
Chapter 5 File Systems -Compiled for MCA, PU
Presentation transcript:

Introduction to unix and linux By Mike Gideon

Understanding the File System Functions Guide to Operating Systems, 4th ed. Understanding the File System Functions All information stored on a computer’s hard disk is managed, stored, and retrieved through a file system The file system allocates locations on a disk for storage and it keeps a record of where specific information is kept Some file systems also implement recovery procedures when a disk area is damaged or when the OS goes down The overall purpose of a file system is to create a structure for filing data A file is a set of data that is grouped in some logical manner, assigned a name, and stored on the disk

Understanding File System Functions Guide to Operating Systems, 4th ed. Understanding File System Functions File systems used by operating systems perform the following general tasks: Partition and format disks to store and retrieve information Enable files to be organized through directories and folders Establish file-naming conventions Provide utilities to maintain and manage the file system and storage media Provide for file and data integrity Enable error recovery or prevention Secure the information in files

Understanding File System Functions Guide to Operating Systems, 4th ed. Understanding File System Functions Directory or folder – organizational structure that contains files and may additionally contain subdirectories (or subfolders) Directories may store the following information Date and time the directory or file was created Date and time the directory or file was last modified Date and time when the directory or file was last accessed Directory or file size Directory or file attributes, such as security information, or if the directory or file was backed up If the information in a directory or file is compressed or encrypted

Designing a Directory Structure Guide to Operating Systems, 4th ed. Designing a Directory Structure A chaotic file structure: makes it difficult to run or remove programs Makes it difficult to determine the most current versions Makes users spend unproductive time looking for specific files Some users keep most of their files in the computer’s primary level or root directory (root folder) Some programs use an automated setup that suggests folders for new programs Example – creating new subfolders under the Program Files folder To avoid chaos, design the file and folder structure from the start (especially on servers)

Designing a Directory Structure Guide to Operating Systems, 4th ed. Designing a Directory Structure Consider following some general practices: Root folder should not be cluttered with files or too many directories/folders Each software application should have its own folder/subfolder Similar information should be grouped (example: accounting systems or office productivity software) Operating system files should be kept separate and protected Directories and folders should have names that clearly reflect their purposes (a folder named “Shared” would contain documents that can be shared by many users)

Guide to Operating Systems, 4th ed. Disk Storage Basics Hard disks arrive from manufacturer with low-level formatting A low-level format is a software process that marks the location of disk tracks and sectors Tracks are like several circles around a disk and each track is divided into sections of equal size called sectors

Disk Storage Basics Disk tracks and sectors on a platter Guide to Operating Systems, 4th ed. Disk Storage Basics Disk tracks and sectors on a platter

Guide to Operating Systems, 4th ed. Files

Guide to Operating Systems, 4th ed. Block Allocation Block allocation – divides the disk into logical blocks called clusters, which correlate to sectors, heads, and tracks on the disk Keeps track of where specific files are stored on the disk Cylinders – tracks that line up on each platter from top to bottom and are all read at the same time Data regarding block allocation is stored using one of two techniques: File allocation table (FAT) New Technology File System (NTFS) and Unix/Linux file systems – uses various locations on the disk to store a special type of file that is used for directory and file allocation information

Guide to Operating Systems, 4th ed. Cylinders

Guide to Operating Systems, 4th ed. Hard Drive

Guide to Operating Systems, 4th ed. Partitions Partitioning – process of blocking a group of tracks and sectors to be used by a particular file system, such as FAT or NTFS After partitioning, the disk must be high-level formatted in order for the OS to store files It might be necessary for a disk to have more than one file system Will require a partition for each file system Example: To allow the installation of Red Hat Enterprise Linux and Windows 7 on the same computer Linux: usr, var, and home are different file systems

Guide to Operating Systems, 4th ed. Partitions Logical drives – creating multiple logical volumes on a single disk and assigning drive letters to each volume When a partition is created, information about that partition is stored in a special area of the disk known as the partition table (in MS-DOS, Mac OS, and Windows) and disk label (in UNIX/Linux) Another piece of disk that is reserved is known as the boot block in UNIX/Linux and Mac OS X, or the Master Boot Record (MBR) in MS-DOS and Windows.

Partitions In Windows, the MBR consists of four elements: Guide to Operating Systems, 4th ed. Partitions In Windows, the MBR consists of four elements: The boot program – examines the partition table to determine which partition to boot from The disk signature – stores information about the disk and is used by management software such as the Windows registry The partition table for the active partition The end-of-MBR marker – where the MBR ends Not all operating systems support partitions in the same way Each operating system uses specific utilities to create partitions

Guide to Operating Systems, 4th ed. Formatting Formatting – the process of placing the file system on the partition Necessary in order to install an operating system After the OS is installed, a disk management tool can be used to partition and format additional free space Can also use the format command from the Command Prompt window The format command includes several switches (extra codes) To view a list of these switches, type format /?

Formatting When a file is stored to disk: Guide to Operating Systems, 4th ed. Formatting When a file is stored to disk: Data is written to clusters on the disk Filename is stored in the folder, along with the number of the first cluster the data is stored in When the OS fills the first cluster, data is written to the next free cluster and the FAT entry corresponding with the first cluster points to the number of the second cluster used When the second cluster is full, the OS continues with the next free cluster and the FAT entry for the second cluster points to the number of the third cluster used, and so on… When a file is completely written to the disk, the FAT entry for the final cluster is filled with all 1s (means end of file) This is commonly referred to as the linked-list method

Formatting Clusters are a fixed length Guide to Operating Systems, 4th ed. Formatting Clusters are a fixed length When a files does not use all of the space in a cluster, the rest of the cluster is unusable Unusable spots are marked in the FAT as bad clusters (never used for file storage) Each partition stores and extra copy of the FAT table in case the first copy gets damaged There is only one copy of the root directory on each partition (see figure on the following slide) The FAT tables and root directory are at the beginning of each partition and always at the same location

Guide to Operating Systems, 4th ed. Formatting

Guide to Operating Systems, 4th ed. Formatting Each FAT directory entry contains filename, file change date and time, file size, and file attributes Attributes can indicate whether a file is set to: Read-only Archive (to be backed up the next time a backup is made) System Hidden

Guide to Operating Systems, 4th ed. Windows File Systems Windows XP, Vista 7, Server 2003, and Server 2008 support three files systems: Extended FAT16 FAT32 NTFS These OSs also support file systems for DVD/CD-ROM drives and USB devices (flash drives)

Guide to Operating Systems, 4th ed. FAT16 and Extended FAT16 Extended FAT16 evolved from FAT16 used in earlier versions of MS-DOS and Windows (3.x/95/98/Me) In extended FAT16: Maximum size of a volume is 4GB Maximum size of a file is 2GB Has been around for awhile and can be read by non-Windows operating systems like UNIX/Linux Considered a stable file system Long filenames (LFNs) can be used Can contain up to 255 characters Not case sensitive

FAT32 Support for FAT32 started with Windows 95 Release 2 Guide to Operating Systems, 4th ed. FAT32 Support for FAT32 started with Windows 95 Release 2 Designed to accommodate larger capacity disks FAT32: Root folder does not have to be at the beginning of a volume Can use disk space more efficiently than FAT16 (because it uses smaller cluster sizes) Largest volume that can be formatted is 32 GB Maximum file size is 4 GB Offers fast response on small 1 or 2 GB partitions

Guide to Operating Systems, 4th ed. CDFS and UDF Windows versions after Windows 2000 recognize some additional file systems used by peripheral storage technologies CD-ROM File System (CDFS) – supported so that OSs can read and write files to DVD/CD-ROM drives Universal Disk Format (UDF) – also used on DVD/CD-ROMs, which are used for huge file storage to accommodate movies and games

Guide to Operating Systems, 4th ed. The UNIX File System There are many different file systems that can be used with UNIX Some file systems are more “native” to specific UNIX operating systems than others Most versions of UNIX and Linux support the UNIX file system (ufs), which is the original native UNIX file system ufs is a hierarchical file system that is expandable, supports large storage, provides excellent security, and is reliable Many qualities of NTFS are modeled after ufs (journaling and hot fixes)

Guide to Operating Systems, 4th ed. The UNIX File System In Linux, the native file system is called the extended file system (ext or ext fs) ext is modeled after ufs and enables the use of the full range of built-in Linux commands, file manipulation, and security The first ext version had bugs ext2 – reliable file system that handles large disk storage ext3 – added journaling capabilities ext4 – supports file sizes up to 16 TB

The UNIX File System Both ufs and ext use the same structure Guide to Operating Systems, 4th ed. The UNIX File System Both ufs and ext use the same structure Built on the concept of information nodes (or inodes) Each file has an inode and is identified by an inode number An inode contains general information about that file such as: User and group ownership, permissions, size and type of file, date the file was created, and the date the file was last modified and read Each disk is divided into logical blocks The superblock contains information about the layout of blocks, sectors, and cylinder groups on the file system The inode for a file contains a pointer (number) that tells the OS where to find a file on the hard disk (based on logical blocks) Inode 0 contains the root of the folder structure and is the jumping off point for all other inodes

The UNIX File System A UNIX/Linux system can have many file systems Guide to Operating Systems, 4th ed. The UNIX File System A UNIX/Linux system can have many file systems Mounts file systems as a sub file system of the root file system All file systems are referred to by a path The path starts out with / (/ indicates the main root directory of the file system) Directories in the file system contain a series of filenames UNIX/Linux allows the use of long filenames, which may include any character that can be represented by ASCII

The UNIX File System UNIX/Linux file system path entries Guide to Operating Systems, 4th ed. The UNIX File System UNIX/Linux file system path entries

Guide to Operating Systems, 4th ed. The UNIX File System Disks are referenced by a special inode called a device There are two types of devices: Raw device – has no logical division in blocks Block device – does have logical division in blocks Devices are normally kept in the /dev or /devices directory Symbolic link – used to link a directory entry to a file that is on a different partition Merely a pointer to a file

Guide to Operating Systems, 4th ed. The UNIX File System You must first partition a disk to use the UNIX/Linux file system The command to partition the disk differs slightly Most UNIX systems use either fdisk or format Typing man fdisk or man format at the command prompt gives you an overview of available commands

Guide to Operating Systems, 4th ed. The UNIX File System Once a partition is made, a file system can be created You must know the device name of the partition on which you wish to create a file system Type newfs, followed by the name of the device The newfs command is not available in all versions of Linux Use the mkfs command instead

Guide to Operating Systems, 4th ed. The UNIX File System When a file is saved to disk, the system first stores part of the data to memory until it has time to write to disk If computer is shut down prior to data being written to disk, you can end up with a damaged file system UNIX/Linux systems should always be shut down using proper shutdown commands You can manually force a write of all data in memory by using the sync command Another utility is known as fsck Verifies the integrity of the superblock, the inodes, all cluster groups, and all directory entries

The UNIX File System UNIX/Linux file system commands Guide to Operating Systems, 4th ed. The UNIX File System UNIX/Linux file system commands

The File System A file is a container for storing information. Unix/Linux does not impose any structure. No end-of-file (eof) mark. Name and size is not stored in the file itself. File attributes are stored separately / accessible by kernel

The File System The Shell is a file The Kernel is a file Directories are treated like files Devices are treated like files (printers, keyboard, etc.)

Types of Files Ordinary File Directory File Device or Pseudo File Symbolic link also socket and named pipes

Types of Files Ordinary File – aka Regular Files Text – printable characters with newline characters Binary – printable and non printable characters (ASCII range 0-255) commands, images, music files, videos, databases Cat .profile Cat /bin/ls

Types of Files Directory File Contains no data but maintains some details about files and subdirectories it contains. Hierarchical structure – “tree” for organization

Types of Files Device or Pseudo Files Take up no space Internal representation of a physical device (keyboard, monitor, hard drive, etc.)

Types of Files Symbolic link Pointer to another file (similar to a shortcut) Hard links - uses original file’s i-number - indistinguishable Soft links - contains pathname to other file

File System Hierarchy Inverted Tree Top called the “root” (represented by frontslash / ) Absolute paths /home/mike No two files can have the same absolute path (same name, different directories is okay) Don’t always use absolute paths - example

File System Hierarchy

File System Directories (folders) /bin /proc /boot /root /cdrom /sbin /dev /srv /etc /tmp /home /usr /lib /var /lost+found /media /usr = static data (user and programmers) /mnt /var = variable data (admin stuff) /opt

References Information gathered from: Hahn, H. Guide to Unix and Linux Das, S. Your Unix/Linux the Ultimate Guide Palmer, M, & Walters, M. Guide to Operating Systems, 4th ed.