Filesystem Hierarchy Operating systems I800 Edmund Laugasson

Similar documents
File System Hierarchy Standard (FHS)

Welcome to getting started with Ubuntu Server. This System Administrator Manual. guide to be simple to follow, with step by step instructions

Filesystem Hierarchy and Permissions

Filesystem Hierarchy and Permissions

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

Manage Directories and Files in Linux. Objectives. Understand the Filesystem Hierarchy Standard (FHS)

GNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018

Unix Filesystem. January 26 th, 2004 Class Meeting 2

List of Linux Commands in an IPm

*nix Crash Course. Presented by: Virginia Tech Linux / Unix Users Group VTLUUG

Unix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech

Introduction to Linux Part I: The Filesystem Luca Heltai

Embedded System Design

Chapter 6. Linux File System

Perl and R Scripting for Biologists

ECE 471 Embedded Systems Lecture 10

INTRODUCTION TO LINUX

Linux Systems Administration Getting Started with Linux

Unix System Architecture, File System, and Shell Commands

Introduction to Linux

Linux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester

LiLo Crash Recovery. 1.0 Preparation Tips. 2.0 Quick Steps to recovery

Computer System Management - Unix/Linux

File System. yihshih

The newer versions of Unix also blur the distinction between files and processes, serial ports, ipc channels, and shared memory segments

Introduction to Linux

Overview of the UNIX File System

Introduction to Unix: Fundamental Commands

Embedded Linux Systems. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

Topics. Installation Basics of Using GNU/ Linux Administration Tools

TestOut Linux Pro - English 4.0.x OBJECTIVE MAPPING: CompTIA Linux+ LX0-103

Chapter-3. Introduction to Unix: Fundamental Commands

Linux Kung Fu. Stephen James UBNetDef, Spring 2017

Software I: Utilities and Internals

CSE 265: System and Network Administration

INF322 Operating Systems

Linux Essentials Objectives Topics:

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

Linux Files and the File System

Files. Computer Center, CS, NCTU. % ls l. d rwx--x--x 7 liuyh gcs 1024 Sep 22 17:25 public_html. File type. File access mode.

Saving Your Bacon Recovering From Common Linux Startup Failures

Overview of the UNIX File System. Navigating and Viewing Directories

Essential Unix and Linux! Perl for Bioinformatics, ! F. Pineda

Operating Systems. Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000) alphapeeler.sf.net/pubkeys/pkey.htm

LPIC-1 System Administrator

Hands-on Keyboard: Cyber Experiments for Strategists and Policy Makers

Introduction to Linux Command-Line for Beginners

Disks, Filesystems 1

Introduction. What is Linux? What is the difference between a client and a server?

Outline. Structure of a UNIX command

MA 511: Computer Programming Lecture 23 Partha Sarathi Mandal

Linux Kung-Fu. James Droste UBNetDef Fall 2016

Introduction to Linux

Overview LEARN. History of Linux Linux Architecture Linux File System Linux Access Linux Commands File Permission Editors Conclusion and Questions

Computer Systems and Architecture

Chapter 1. Getting started with UNIX

Course 55187B Linux System Administration

GNU/Linux: An Essential Guide for Students Undertaking BLOSSOM

Virtual Machine. Linux flavor : Debian. Everything (except slides) preinstalled for you.

Linux basics U3A in Bath. Linux Principles. by Andy Pepperdine

Introduction of Linux

Chapter 4 File system management. Chapter 4 File system management

EECS2301. Lab 1 Winter 2016

RocketRAID 2310/2300 Controller Fedora Linux Installation Guide

UNIX Concepts COMPSCI 386

Introduction to Linux. Roman Cheplyaka

Introduction and Overview Getting Started

CSE 265: System and Network Administration

Introduction to Linux

UNIX File Hierarchy: Structure and Commands

Linux Session Part I. Kesavan M

Introduction Into Linux Lecture 1 Johannes Werner WS 2017

UNIX System Programming Lecture 3: BASH Programming

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering

D, E I, J, K. Generalized Regular Expression Parser (GREP), 110 Generic 105 key (Intl) PC, 29 git command, 242

CREATION OF A MINIMAL STAND ALONE RTAI SYSTEM ================================================

Lecture 2: The file system

Introduction to Linux

How to clone a Linux box using netcat

Linux Command Line Primer. By: Scott Marshall

Full file at

Linux Reference Card - Command Summary

Copyright Heraflux Technologies. Do not redistribute or copy as your own. 1

Systems Programming/ C and UNIX

client X11 Linux workstation

SQL Server Administration on Linux 2017

for more :-

Getting Started with Linux

Lecture 03. Shell programming Part 1. CSC 320: Systems Programming

Disks, Filesystems, Booting Todd Kelley CST8177 Todd Kelley 1

The kernel constitutes the core part of the Linux operating system. Kernel duties:

Linux for Beginners. Windows users should download putty or bitvise:

Server Consolidation with Xen Farming

DTK2410 Specification

Some Practical Matters. Introduction to Unix. What's Our Goal? Linux!= UNIX

Disks, Filesystems Todd Kelley CST8177 Todd Kelley 1

Introduction to SUSE Linux Enterprise Server

Exam LFCS/Course 55187B Linux System Administration

PowerVM Lx86 for x86 Linux Applications Administration Guide

Unix Handouts. Shantanu N Kulkarni

Transcription:

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 2 / 26 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 3 / 26 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 4 / 26 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) 5 / 26 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 / 6 / 26 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

7 / 26 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 8 / 26 /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 9 / 26 /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 10 / 26 /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 11 / 26 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 12 / 26 /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 13 / 26 /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 14 / 26 /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

FHS 6 15 / 26 /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 16 / 26 /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 17 / 26 /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? 18 / 26 %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 19 / 26 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 /vmlinuz vmlinuz-4.7.2-040702-generic data on the disk

Links 2 20 / 26 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 21 / 26 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 22 / 26 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 23 / 26 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 24 / 26 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? 25 / 26

Thank you for your attention! 26 / 26