Filesystem Hierarchy Operating systems I800

Slides:



Advertisements
Similar presentations
POS/420 Philip Robbins – March 19, 2013 (Week 2) University of Phoenix Mililani Campus Introduction to Unix.
Advertisements

Linux Booting Procedure
A Guide to Unix Using Linux Fourth Edition
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.
1 Unix Systems Administration Y. K. Chang Generic Unix Directory Structure /bin /dev /etc /sbin /home /lost+found / Root Dir /dsk /rdsk /term /pts /rmt.
1.1 The Linux System: Design Principles Linux is a multiuser, multitasking system with a full set of UNIX-compatible tools. Its file system adheres to.
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 Linux File System.
Guide To UNIX Using Linux Third Edition
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
The file structure and related utilities CS240 Computer Science II.
Manage Directories and Files in Linux
Linux Filesystem Last Update Copyright Kenneth M. Chipps Ph.D. 1.
Unix Basics Chapter 4.
Chapter Two Exploring the UNIX File System and File Security.
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
Linux Introduction What is Linux? How do you use it?
Filesystem Hierarchy Dr. Michael L. Collard 1.
UNIX (Linux) Introduction Module-1. OS Kernel In computing, the kernel is the central component of OS. It is a bridge between applications and the actual.
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
E X C E E D I N G E X P E C T A T I O N S Basic LINUX Linux System Administration Dr. Hoganson Kennesaw State University Operating Systems Directory structure:
1 © 2001 John Urrutia. All rights reserved. Chapter 4 The LINUX Filesystem.
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.
Linux Filesystem WeeSan Lee. Roadmap Disk Partitions The Filesystem Filesystem Mouting & Umounting File Tree File Type File Permission.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 File-System Interface.
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.
SUSE Linux Enterprise Desktop Administration Chapter 7 Manage Directories and Files.
Linux Development Lecture 7. Schedule Linux Root Filesystem.
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.
Lab 8 Department of Computer Science and Information Engineering National Taiwan University Lab8 - Root Filesystem 2015/11/10/ 22 1.
A Brief Overview of Unix Brandon Bohrer. Topics What is Unix? – Quick introduction Documentation – Where to get it, how to use it Text Editors – Know.
Linux Filesystem Hierarchy The Linux Documentation Project.
Embedded Software Design Week II Linux Intro Linux Kernel.
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,
UNIX Filesystem and Hierarchy AfNOG 2008 Workshop May Rabat, Morocco.
Linux Administration – Finding You Way on the Command Line The Linux File Directory or Tree.
BILKENT UNIVERSITY DEPARTMENT OF COMPUTER TECHNOLOGY AND INFORMATION SYSTEMS CTIS156 INFORMATION TECHNOLOGIES II FILES AND FILE SYSTEM STRUCTURE.
File permissions Operating systems I800
Filesystem Management and Backups
Linux 101 Training Module Linux Basics.
Welcome to Linux Chap#1 Hanin Abdulrahman.
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
C151 Multi-User Operating Systems
linux and related thing
UNIX Filesystem and Hierarchy
Documenting Operating systems I800
9 Linux on the Desktop.
Exploring the UNIX File System and File Security
Unix : Introduction and Commands
Operating Systems Lecture 4.
Perl Scripting and The File system
Welcome to Linux Chap#1 Hanin Abdulrahman.
Software I: Utilities and Internals
Welcome to Linux Chap#1.
Chapter 4: The Linux Filesystem
January 26th, 2004 Class Meeting 2
Presentation transcript:

Filesystem Hierarchy Operating systems I800 Edmund Laugasson edmund.laugasson@itcollege.ee There has been used materials from Margus Ernits, Katrin Loodus when creating current slides. Current document copying, distributing and/or modifying has been set out by one of the following licences by user’s choice: * GNU Free Documentation Licence version 1.2 or newer * Creative Commonsi Attribution + ShareAlike licence 4.0 (CC BY-SA)

Problems when renewing the server new will be installed next to old one cannot copy (new hardware is completely different and also OS will be renewed) the program configurations should be migrated also user data will be migrated there is a need to know precisely: what is needed to migrate from old to new system what is needed to install onto new server

Problems 2 restoring a machine when hardware will be damaged and restoring onto same hardware will not succeed... there will be new machine installed there will be software installed there will be software configured there will be data restored therefore there will be precisely needed to know: what to install and restore

How to keep system files how to keep system files so that: the system is easy to restore some of the files could be kept on network drives (usually home folders, in some cases even program files) user files would be separately locally installed programs would be distinguishable from those of the installed by manufacturer in the system UNIX-like OS (like Linux) this has been standardized every IT administrator must know the principles

Filesystem Hierarchy UNIX-like have a standard Filesystem Hierarchy Standard (FHS) describes the location of files and directories the goal is to raise the compatibility between systems and software displacement simplification makes makes it easier for system administrators to work The standard is available on the address: http://refspecs.linuxfoundation.org/fhs.shtml FHS development: https://wiki.linuxfoundation.org/en/FHS https://wiki.linuxfoundation.org/lsb/fhs

ls -1 / bin boot cdrom dev etc home initrd.img lib lib32 lib64 lost+found media mnt opt proc root run sbin srv sys tmp usr var vmlinuz

FHS Linux system files are in folders Filesystem Hierarchy Standard (FHS) defines folders and files hierarchy / is the system root directory root directory is the beginning of tree-like filesystem must be available when system is booting (e.g. /usr /opt and /var should not) the system must provide tools for primary remediation

/ directory must contain /bin programs necessary for the system to load /boot bootloader files /dev device files /etc host specific configuration files /home users' home directories /lib shared libraries and kernel modules (in addition to the /lib32, /lib64) /media removable media mount point /mnt temporary file system mount point /opt additional software is installed to opt folder /sbin mainly system commands meant for root user /srv service data files (RedHat based distributions) /tmp temporary files /usr a hierarchy that is not needed at boot time, but often in the main part of the programs installed in the usr directory /var variable-sized data files

/bin /bin/ system programs that are needed to boot the system (mount, cp, cat, etc) contains a files that are used by system boot scripts contains a programs that both regular users and root user will be used must contain: cat chgrp chmod chown cp date dd df dmesg echo false hostname kill ln login ls mkdir mknod more mount mv ps pwd rm rmdir sed sh stty su sync true umount uname can contain: csh ed tar cpio gzip gunzip zcat netstat ping

FHS /boot/ kernel, initrd in the system there can be multiple kernels that can be choosed when booting /dev/ device files must contain the command MAKEDEV e.g. /dev/null , /dev/urandom etc /etc/ configuration files the configuration of system and services binary files are not allowed here /home/ users' home directories usually on the separate partition

FHS 2 /lib/ shared libraries libraries are used by binary files that are located at /bin/ and /sbin/. /media/ here will be mounted removable media e.g. CD/DVD/BD-ROM, USB removable storage, cameras /mnt/ here will be mounted temporary file systems in old Linux systems also optical storage etc

FHS 3 /opt/ for additional programs, e.g. third party programs /proc/ virtual file system to access kernel parameters cat /proc/cpuinfo cat /proc/meminfo cat /proc/asound/cards cat /proc/partitions cat /proc/filesystems cat /proc/devices cat /proc/interrupts cat /proc/ioports , cat /proc/iomem cat /proc/version cat /proc/uptime, jne through the virtual hierarchy there will be information about system and processes man proc

FHS 4 /root/ superuser home directory /sbin/ system programs that are needed to boot the computer e.g. init, ifup, fdisk, etc. /srv/ service state files actually this is not yet respected by distro creators. The reason: there is no consensus /sys/ virtual fail system to keep device status

FHS 5 /tmp/ for temporary files and folders /usr/ hierarchy for files that are not needed to boot the system therefore there can be large program files kept over network by keeping /bin and /sbin sizes small /usr/bin/ program files that are not needed to boot the system e.g. mplayer /usr/bin/X11/ GUI files

/usr/include/ C compiler header files FHS 6 /usr/include/ C compiler header files /usr/lib/ program shared libraries for programs in /usr/bin/ and /usr/sbin/ /usr/local for sysadmins to install software locally and use globally /usr/sbin/ programs needed for system management but not needed to boot /usr/share/ shared files. Do not depend on architecture (e.g. IA-32, x86-64) /usr/src/ source-code, e.g. kernel

FHS 7 /var/ files with variable size system log files e-mail data pinter spooler backup files service files (www etc) /var/lock/ resources lock files /var/log/ differend log files /var/mail/ user mail boxes

FHS 8 /var/run/ the current system information services and their users since the last boot /var/spool/ queue - waiting for data processing e.g. printer queues, unread e-mail /var/tmp/ temporary files that can not be deleted when booting the system

but MS Windows? %windir% Program Files Users %windir%\System32 – 32bit libraries and programs %windir%\SysWOW64 – 64bit libraries and programs http://technet.microsoft.com/en-us/library/bb457124.aspx http://msdn.microsoft.com/en- us/library/windows/desktop/aa384187(v=vs.85).aspx

Links /vmlinuz data on the disk vmlinuz-4.7.2-040702-generic sometimes there is needed that same file/folder would be located in multiple locations at the same file system e.g. ls -l /vmlinuz lrwxrwxrwx 1 root root 33 aug 22 08:03 /vmlinuz -> boot/vmlinuz-4.7.2-040702-generic data on the disk /vmlinuz vmlinuz-4.7.2-040702-generic

Links 2 to one file there can refer many links on different places programs can access to file/folder through the link UNIX-like systems may have two types of links Hard Link reference to data every link is equal can only be done within a single file system Symbolic Link the name link it can refer to a file on another file system

Links 3 hard link ln [parameters] filename linkname symbolic link ln -s filename linkname examples ln -s /media/disk/user “/home/user/usb disk” will create a link “usb disk” that refer e.g. to external disk that will be mounted under /media folder

Broken links when you delete a file that is refe if you delete a file, the name referred to by link, then the link is broken link remains in the system, but the reference of the file is deleted find -L . -type l helps you find broken symbolic links if you delete the name of the link, the file will not be deleted hard link - since the link is equivalent to a file, the data is not lost http://unix.stackexchange.com/questions/50179/what-happens-when-you-delete-a-hard-link

MS Windows NTFS links MS Windows NTFS allows also links hard link alternative: mklink /h link fail symbolic link (since MS Windows Vista NTFS) mklink [parameters] link file https://jpsoft.com/help/mklnk.htm

References Filesystem Hierarchy Standard (FHS) http://refspecs.linuxfoundation.org/fhs.shtml - choose the newest version Linux Filesystem Tree (Ubuntu) https://help.ubuntu.com/community/LinuxFilesystemTreeOverview Filesystem Hierarchy Standard http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard Virtual file system /proc http://tldp.org/LDP/Linux-Filesystem- Hierarchy/html/proc.html An introduction to Linux filesystems https://opensource.com/life/16/10/introduction-linux-filesystems

Questions?

Thank you for your attention!