file system structure in linux

24
© Copyright 2012 Hidaya Trust (Pakistan) A Non-Profit Organization www.hidayatrust.org / www,histpk.org Hidaya Institute of Science & Technology www.histpk.org A Division of Hidaya Trust, Pakistan

Upload: qurban-ali-lakhan

Post on 22-May-2015

429 views

Category:

Technology


6 download

DESCRIPTION

Linux Slides

TRANSCRIPT

Page 1: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

Hidaya Institute of Science &

Technologywww.histpk.org

A Division of Hidaya Trust, Pakistan

Page 2: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

File System Structure

Page 3: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

File System Structure

• A file system is the methods and data structures that an operating system uses to keep track of files on a disk or partition; that is, the way the files are organized on the disk.

• A file system organizes data in an efficient manner and is tuned to the specific characteristics of the device.

Page 4: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

FSSTND• The FSSTND (Filesystem Standard), a

filesystem hierarchy standard specific to the Linux operating system, was released on 14 February 1994.

• The name has been changed into Filesystem Hierarchy Standard (FHS) on 26 October 1997.

• Initial release 1.0 14 February 1994.

• Latest release 2.3 29 January 2004.

Page 5: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

What is a File?

• Files are collection of data items stored on disk. Or, it's device which can store the information, data, music (mp3 files), picture, movie, sound, book etc. In fact what ever you store in computer it must be inform of file. Files are always associated with devices like hard disk ,floppy disk etc. File is the last object in your file system tree

Page 6: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

What is a directory?• Directory is group of files.

• Root directory - There is only one root directory in your system, which is denoted by / (forward slash).

• It is root of your entire file system and can not be renamed or deleted.Sub directory - Directory under root (/) directory is sub directory.Directories are used to organize your data files, programs more efficiently.

Page 7: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

/ – Root

• Every single file and directory starts from the root directory.

• Only root user has write privilege under this directory.

• Please note that /root is root user’s home directory, which is not same as /.

Page 8: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

/bin – User Binaries

• The bin directory contains several useful commands that are of use to both the system administrator as well as non-privileged users.

• It usually contains the shells like bash, csh, etc… and commonly used commands like cp, mv, rm, cat, ls.

Page 9: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

/boot, Boot Loader Files

• This directory contains everything required for the boot process.

• Contains boot loader related files.

Page 10: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

/dev – Device Files

• Contains device files.

• These include devices, usb, or any device attached to the system like hda1, hda2 or /dev/cdrom.

Page 11: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

/etc – Configuration Files

• This is the nerve center of your system, it contains all system related configuration files in here or in its sub-directories.

• A "configuration file" is defined as a local file used to control the operation of a programs.

Page 12: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

/home – Home Directories

• Home directories for all users to store their personal files.

• Linux is a multi-user environment so each user is also assigned a specific directory that is accessible only to them and the system administrator.

• ~ tilde symbol is represents the home directory of login user.

Page 13: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

/lib – System Libraries

• The /lib directory contains kernel modules and those shared library images (the C programming code library) needed to boot the system and run the commands in the root filesystem, ie. by binaries in /bin and /sbin.

Page 14: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

/lost+found

• Linux should always go through a proper shutdown. Sometimes your system might crash or a power failure might take the machine down.

• fsck will go through the system and try to recover any corrupt files that it finds.

Page 15: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

/media – Removable Media Devices

• Temporary mount directory for removable devices.

• For examples,

• /media/cdrom for CD-ROM

• /media/floppy for floppy drives

• /media/flash for usb flash drive

Page 16: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

/mnt – Mount Directory

• Temporary mount directory where we can mount the filesystems.

• This is a mount point under which you mount your filesystems or devices.

• Mounting is the process by which you make a filesystem available to the system.

Page 17: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

/opt – Optional add-on Applications

• This directory is reserved for all the software and add-on packages that are not part of the default installation.

Page 18: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

/root – Home Directory of root user

• This is the home directory of the System Administrator, 'root'.

Page 19: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

/sbin – System Binaries

• Just like /bin, /sbin also contains binary executables.

• But, the linux commands located under this directory are used typically by system administrator, for system maintenance purpose.

Page 20: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

/usr – User Programs

• Contains binaries, libraries, documentation, and source-code for second level programs.

Page 21: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

/var – Variable Files

• Content of the files that are expected to grow can be found under this directory.

• This includes

• System log files (/var/log)

• Packages and database files (/var/lib)…

Page 22: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

/srv – Service Data

• Contains server specific services related data.

Page 23: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

/tmp – Temporary Files

• Directory that contains temporary files created by system and users.

• This directory contains mostly files that are required temporarily.

Page 24: File system structure in linux

© Copyright 2012 Hidaya Trust (Pakistan) ● A Non-Profit Organization ● www.hidayatrust.org / www,histpk.org

The End