Operating Systems Răzvan Daniel ZOTA Faculty of Cybernetics, Statistics and Economic Informatics

Slides:



Advertisements
Similar presentations
Chapter 12: File System Implementation
Advertisements

Chapter 4 : File Systems What is a file system?
Linux Installation LINUX INSTALLATION. Download LINUX Linux Installation To install Red Hat, you will need to download the ISO images (CD Images) of the.
File Systems.
Allocation Methods - Contiguous
File Systems Examples.
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)
Chapter 11: File System Implementation
Lecture 10: The FAT, VFAT, and NTFS Filesystems 6/17/2003 CSCE 590 Summer 2003.
Connecting with Computer Science, 2e
1 Friday, July 07, 2006 “Vision without action is a daydream, Action without a vision is a nightmare.” - Japanese Proverb.
Chapter 12: File System Implementation
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 –
5.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 5: Working with File Systems.
Hard Drive Formatting 1. Formatting Once a hard drive has been partitioned, there’s one more step you must perform before your OS can use that drive:
Tasks Necessary for Setting Up a Hard Disk Initializing the disk with basic or dynamic storage type Creating partitions on basic disks or volumes on dynamic.
MCSE Guide to Microsoft Windows 7 Chapter 5 Managing File Systems.
Chapter 4 Operating Systems and File Management. 4 Chapter 4: Operating Systems and File Management 2 Chapter Contents  Section A: Operating System Basics.
Storage and NT File System INFO333 – Lecture Mariusz Nowostawski Noria Foukia.
Objectives Learn what a file system does
Chapter 8 File Management
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.
Chapter 5 Part 2 Secondary Storage Mgt. File Mgt. in Popular OSs
File Systems (1). Readings r Silbershatz et al: 10.1,10.2,
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).
Component 4: Introduction to Information and Computer Science Unit 4: Application and System Software Lecture 3 This material was developed by Oregon Health.
IOS110 Introduction to Operating Systems using Windows Session 5 1.
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.
MCSE GUIDE TO MICROSOFT WINDOWS 7 Chapter 5 Managing File Systems.
Module 4.0: File Systems File is a contiguous logical address space.
MCSE Guide to Microsoft Windows Vista Professional Chapter 5 Managing File Systems.
Page 1 File Systems and Disk Management Lecture 5 Hassan Shuja 10/19/2004.
Disk & File System Management Disk Allocation Free Space Management Directory Structure Naming Disk Scheduling Protection CSE 331 Operating Systems Design.
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.
Lecture 18 Windows – NT File System (NTFS)
FAT File Allocation Table
FILE SYSTEMS. Presented to: Sir. Ahmad Kareem Presented by: Sadia Rasheed Bsit
UNIX & Windows NT Name: Jing Bai ID: Date:8/28/00.
Operating Systems 1 K. Salah Module 4.0: File Systems  File is a contiguous logical address space (of related records)  Access Methods  Directory Structure.
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.
Hands-On Microsoft Windows Server 2008 Chapter 7 Configuring and Managing Data Storage.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 3: Windows7 Part 3.
Linux Filesystem Administration
Day 28 File System.
File-System Management
Faculty of Cybernetics, Statistics and Economic Informatics
Guide to Operating Systems, 5th Edition
Guide to Operating Systems, 5th Edition
Disks and Formatting Ch 3.
Chapter 11: File System Implementation
Working with Disks Lesson 4.
Day 27 File System.
Windows XP File Systems
Filesystems.
File Management Chase Goehring.
File Management.
File Structure 2018, Spring Pusan National University Joon-Seok Kim
File Managements.
Operating System Module 1: Linux Installation
CS510 Operating System Foundations
Chapter 3: Windows7 Part 3.
Chapter Overview Operating System Basics
Faculty of Cybernetics, Statistics and Economic Informatics
Partitioning & Formatting
Chapter 5 File Systems -Compiled for MCA, PU
Presentation transcript:

Operating Systems Răzvan Daniel ZOTA Faculty of Cybernetics, Statistics and Economic Informatics

2 Backup commands – UNIX/Linux tar (tape archive) –standard for all Unix versions General syntax: tar function [modifier] destination_file(s) | directories tar functions: –c (create) – in order to create an archive –t (table of contents) – in order to view the content table of a tar file –x (extract) – used to extract files from archive Modifiers (a few examples): –f (filename) – the tar file will be created; otherwise it is picked the device specified by the medium variable TAPE, if it is set; if not, the default value from /etc/default/tar is used. –v (verbose) – together with the t function gives extra information about tar file

3 Compression commands- UNIX/Linux tar examples: - tar cvf dir2backup.tar dir2 (it creates the tar archive for dir2 directory) - tar cvf ex.tar f1 f2 f3 (it creates the tar archive with files f1, f2, f3) -tar tvf ex.tar (to view the contents of an archive) -tar cvf /dev/cdrom f1 f2 f3 (it creates an archive on the cd with files f1, f2, f3) -tar -xvf myfile.tar (extraction from the tar file) File compression: compress –v ex.file Decompression: uncompress –v ex.file.Z We may combine backup and compression with the jar (Java archive) command: jar cvf home.jar *

4 Compression commands- UNIX/Linux GNU compression programs gzip, gunzip, gzcat The gzip command is similar to compress; usually it cretes a smaller file with.gz extension. gunzip is used for decompression gzcat file_name used to view the content of the file without making the decompression (gunzip -c) Obs. We may find on Linux the zip and unzip commands, similar with Windows versions. In this case we may work with zip files compressed on Windows.

5 What is a filesystem? A filesystem is an integral part of an operating system, consisting of files, directories and all the information needed to access, locate (and recover, if needed) and manipulate them. Introduction to filesystems

6 File system structure

7 The most important Unix directories /binUNIX commands /devDevices directory /etc Files required to boot the system and communicate, and scripts to control the boot process /kernelContains the kernel and drivers for the kernel /mntThe “mount” directory; reserved for mounting filesystems /optlocally installed packages and files /sbin Files required to start the system and scripts to control the boot process /shlibShared libraries /tmpTemporary directory /usrUser routines

8 The most important Linux directories /binBinary (executable) files – basic system programs /boot System boot directory. The kernel, module links, system map, and boot manager reside here /devDevices directory /etcSystem wide configuration scripts /proc Process directory. Contains information and statistics about running processes and kernel parameters /sys System wide device directory. Contains information and statistics about device and device names /tmpTemporary directory /usr/binMore system binaries /usr/local/binMiscellaneous binaries local to the particular machine /usr/share/docDocumentation for installed packages

9 OSs and supported filesystems OSFilesystems Windows 7/8/10NTFS, FAT16, FAT32 Mac OS XHFS+ (Hierarchical File System Plus) LinuxExt 2, Ext 3, Ext 4 NTFS (New Technology File System)- was introduced in Windows NT and at present is major file system for Windows. This is a default file system for disk partitions and the only file system that is supported for disk partitions over 32GB. The file system is quite extensible and supports many file properties, including access control, encryption etc. Each file on NTFS is stored as file descriptor in Master File Table and file content. Master file table contains all information about the file: size, allocation, name etc. FAT12 was used for old floppy disks. FAT16 (or simply FAT) and FAT32 are widely used for flash memory cards and USB flash sticks. It is supported by mobile phones, digital cameras and other portable devices.

10 OSs and supported filesystems HFS+ file system is applied to Apple desktop products, including Mac computers, iPhone, iPod, as well as Apple X Server products. Advanced server products also use Apple Xsan file system, clustered file system derived from StorNext or CentraVision file systems. Ext2, Ext3, Ext4 - 'native' Linux file system. This file system falls under active developments and improvements. Ext3 file system is just an extension to Ext2 that uses transactional file write operations with journal. Ext4 is a further development of Ext3, extended with support of optimized file allocation information (extents) and extended file attributes. This file system is frequently used as 'root' file system for most Linux installations.

11 CDFS (CD-ROM File System) represents a relatively simple format defined in 1988 as the CD-ROM standard. Windows implements this standard compatible with ISO 9660 in \Windows\System32\Drivers\Cdfs.sys. CDFS restrictions: –The name (for files and directories) < 32 characters –The tree structure for subdirectories <= 8 levels UDF (Universal Disk Format) – a standard compatible with ISO 13346, offering support for versions 1.02 and 1.5 OSTA (Optical Storage Technology Association) defined in 1995 as a replacement format for CDFS, especially DVD-ROM. –The names (for files and directories) <= 255 characters –The maximum length for a path = 1023 characters –The name of the files can be lower/upper case CDFS and UDF

12 For many years, the most popular filesystem was FAT (File Allocation Table). There are 3 types of FAT. The first one is the original FAT (FAT12), then appeared FAT16 and FAT32, improved versions for the original FAT. The original FAT was limited from many points of view, being capable to recognize only files up to 8 characters in length. The disk space was inefficient used, so FAT16 was built to support partitions up to 4 GB. But the space on the disk was inefficient used. For example, using a partition of 512 MB, the clusters’ dimension is 8 KB, meaning that the 1 KB files will occupy 8 KB of space on disk, because we cannot store multiple files in a cluster. In conclusion, we have 7 KB lost. FAT, FAT16 and FAT32

13 In order to solve the problems of FAT16, FAT 32 was developed, using less dimensions for clusters and supporting partitions up to 2 TB. For example, if we consider a partition of MB (2 GB) formatted in FAT16, we will have a FAT table with 65,526 clusters, each cluster consuming 32 KB. The big dimension of the cluster will have a negative impact in using the space on the disk. If we use for this partition the FAT32 system, this will lead to cluster of only 4 KB and an “economy” of 90% in using the hard disk space. But there is a price for this: we need to have more clusters (instead of clusters we will have clusters). Moreover, the FAT entries in FAT32 table are on 32 bits, so, as a result, the dimension of the FAT table is 16 times more than in the case of FAT16! FAT32

14 FAT16 and FAT32 characteristics Type of FATFAT16FAT32 Cluster dimension 32 KB4 KB Number of FAT entries 65,526524,208 FAT table dimension ~ 128 KB~ 2 MB

15 FAT16 and FAT32 characteristics Almost any OS is implementing a disk caching mechanism to keep in memory the disk structures frequently accessed (the FAT table, for example). The caching operation implies using the main memory to store information about disk, avoiding permanently reading from hard disk (very slow comparative with main memory).disk caching So, when the FAT table is small (128 KB for FAT16) it is easy to store it in memory, but when the dimension of table grows up, the system is forced to use a big amount of memory for FAT, or not to use memory at all. The maxim number of the FAT32 clusters is 268 million, so with a 4 KB cluster it may offer support for a disk of 1 TB. But in this case the dimension of the FAT table will be over 1 GB! (268 milions multiplied by 4 bytes for each entry in the table).

16 The clusters’ dimensions for FAT32 Cluster dimension The minimum dimension of the partition The maximum dimension of the partition 4 KB0.5 GB8 GB 8 KB8 GB16 GB 16 KB16 GB32 GB 32 KB32 GB64 GB

17 In the following table we may see the dimensions of the FAT table in MB, function of the partition’s dimension for different sizes of the clusters. We may see that FAT32 is using clusters of 4 KB until 8 GB partitions, otherwise the memory used to store FAT table would be too big. The entries marked with bold show us what FAT32 Windows will choose for a partition of that size (the FAT table dimension is kept at 8 MB). FAT32 characteristics

18 The FAT32 table dimension Partition dimension 4 KB clusters 8 KB clusters 16 KB clusters 32 KB clusters 8 GB8 MB4 MB2 MB1 MB 16 GB16 MB8 MB4 MB2 MB 32 GB32 MB16 MB8 MB4 MB 64 GB64 MB32 MB16 MB8 MB 2 TB (2,048 GB) --1,024 MB512 MB256 MB

19 NTFS – New Technology File System Starting with Win 2000, the NTFS file system is the native file system on Windows. NTFS is using 64 bits for index clusters. This capability offers the ability to address volumes up to 16 exabytes. Multiples of bytesbytes SI decimal prefixes Binary usage Name (Symbol) Value kilobytekilobyte (kB) megabytemegabyte (MB) gigabytegigabyte (GB) terabyteterabyte (TB) petabytepetabyte (PB) exabyte (EB) zettabytezettabyte (ZB) yottabyteyottabyte (YB)

20 NTFS characteristics Importance Access controlAccess rights for individual files or directories MFT (Master File Table) It contains records for each file and directory in NTFS; The records regarding NTFS structure and MFT are redundant when the first record is corrupted; Small files (under 1500 bytes) are stored entirely in MFT for a faster access. NTFS file attributesThe file attributes are contained in the MFT record of the file. The list of the file attributes may be particularized for some other systems (Mac, UNIX, Linux) in order to extend the NTFS functionality. FilenamesNTFS allows filenames up to 255 characters but it can generate 8+3 names for backward compatibility with FAT/DOS

21 NTFS characteristics POSIX complianceThe POSIX compliance enables UNIX apps to access the files stored in NTFS under Windows NT. To do this, NTFS needs some file attributes that are unique to POSIX, like: - Case sensitive filenames; - Hard-links that enable a file to be accessed from different sources; - A “time stamp" attribute to identify when a file was last accessed or modified. Macintosh supportMacintosh support services enable users accessing files from Macintosh platforms; for Mac users the NT server looks like an AppleShare server. Macintosh access control rights are also supported. Hot FixingIf NTFS finds a bad sector on a SCSI disk will automatically move affected files and will mark it as "bad" without user intervention. Filesystem recoveryNTFS is using the cache memory manager for buffer writes on disk within a process called "lazy-write". Alco, it runs a monitoring program for writing on the disk which allows to recover the filesystem in case of a crash.

22 Master File Table - NTFS Increased reliability by MFT special design

23 The Master File Table was been designed for a quick and safe access to files. The main characteristics of it are: superior performance in finding files on disk (quick find for small files and directories) and great reliability (as a result of redundant characteristics). MFT can serve both objectives very well. First of all, the definition of MFT records enable small files and directories to be included in these records and there is not necessary any access to disk. For big files NTFS uses a hierarchical binary tree structure in order to quick search in bigger directories. The reliability is assured by the link between these redundant characteristics: –Redundant master record – the mirror record (the copy) of MFT; –Redundant files and data segments MFT – mirror MFT; –Redundant sector boots (the existence of the primary boot sector and dual boot sector – its copy). MFT - characteristics

24 us/library/cc766145(v=ws.10).aspx (A nice comparison between NTFS, FAT16 and FAT32) us/library/cc766145(v=ws.10).aspx To read sub-chapter 9.6 from: –“Sisteme de operare – Unix și Windows” – R. Zota, A. Vasilescu, Ed. ASE, 2015 Comparison of NTFS and FAT File Systems

25 Other filesystems Default filesystem on a Linux is ext3 (third extended filesystem) or ext4 – More information at: JFS (Journaling FileSystem) - filesystem created by IBM; used on Unix AIX and on Linux versions. “A journaling file system is a file system that keeps track of changes not yet committed to the file system's main part by recording the intentions of such changes in a data structure known as a "journal", which is usually a circular log.” OCFS2 (Oracle Cluster File System) – filesystem created by Oracle for Linux clusters.

26 Which Linux file system should you choose? Read this interesting article: which-linux-file-system-should-you-choose/

27 Unix/Linux commands about hard disk and partitions df (disk free) – used to see the free space on a hard disk df –h (human readable format) du (disk usage) – used to determine the occupied space by a directory as a number of 512 bytes blocks du –k (occupied space in blocks of 1 KB) du –k | tail -1 (showing the last line of the listing – total no of blocks)