+ All Categories
Home > Education > Linux file system

Linux file system

Date post: 21-Jul-2015
Category:
Upload: mohammad-reza-gerami
View: 50 times
Download: 5 times
Share this document with a friend
Popular Tags:
35
ان آموزش دپارتم آموزش لینوکس
Transcript
Page 1: Linux file system

دپارتمان آموزش

آموزش لینوکس

Page 2: Linux file system

GNU/Linux Filesystem

Mohammad Reza Gerami

[email protected]

[email protected]

Page 3: Linux file system

3

What We Will Learn

Introduction

Filesystem Hierarchy Standard

Directory layout of Linux FS

Help

Mounting

Page 4: Linux file system

4

Introduction

Filesystem

How are data stored in storage?

How do users access the data?

Data organization, files and directories

Filesystem types

Disk FS: ext2, ext3, FAT, FAT32 & NTFS

Network FS: Samba & NFS

Flash FS: JFFS2

Special FS: proc FS

Page 5: Linux file system

5

Introduction (cont’d)

You should understand Linux FS

Why?

Everything in Linux is file, if it is NOT process

Easy to use

Open file, read/write and close the file

Unlike Windows, Linux FS is standard FS

Everyone should learn standards

Page 6: Linux file system

6

Filesystem Hierarchy Standard

Started by Dennis Ritchie, 1993

Defines the main directories and their contents in

most Linux-based systems

Current Version: 2.3.

Page 7: Linux file system

7

FHS

There is not any drive C:, D:, …

All directories are under “/”

“/” is the root directory

It is possible

to have multiple partitions

to multiple filesystems

Page 8: Linux file system

8

The “/”

The primary hierarchy in FSH

The root of tree of filesystem

All paths start form here

There is only one “/” in filesystem

Page 9: Linux file system

9

The “/”

/

boot bin dev etc lib proc root sbin tmp usr var

Page 10: Linux file system

10

boot

Linux kernel

Boot loader configuration

If you lost boot

You cannot boot your OS

Page 11: Linux file system

11

boot

boot

vmlinuz-2.6.12 config-2.6.12 grub

grub.conf

Page 12: Linux file system

12

bin

Essential programs

Need for system startup

Basic commands for

Navigating in filesystem

File management

Page 13: Linux file system

13

bin

bin

bash bzip2 cat gzip ls mv rm...

Page 14: Linux file system

14

dev

Everything is file

Hardware components (devices) are fileHard disk

Key board

All device files are here

Direct interaction with device driver

Open the device file

Read & Write

Page 15: Linux file system

15

dev

dev

hda fda sda tty random null...

Page 16: Linux file system

16

etc

System configuration directory

What is done by the registry in Windows

All configuration file are text files

You can view and edit it manually

Page 17: Linux file system

17

etc

etc

bashrc fstab inittab passwd shadow X11

X11.conf

init.d

network named httpd

Page 18: Linux file system

18

home

Home directory of user

Each user has a directory

/home/bahador

/home/hamed

All files of user are stored here

Page 19: Linux file system

19

lib

Programs need libraries

Dynamically linked libraries

Programmers need libraries

All essential libraries are here

Needed for system startup

Page 20: Linux file system

20

lib

lib

libc libm libcrypt libpthread modules

Page 21: Linux file system

21

proc

Kernel’s interface

Kernel pseudo-directory

Special directory

It is NOT a directory on hard disk

Kernel Configuration

Kernel State monitoring

Page 22: Linux file system

22

proc

proc

cpuinfo meminfo devices interrupts net sys

tcp udp kernelnet

1 129

Page 23: Linux file system

23

root

Home directory of root

Don’t confuse

/ is the “root of Filesystem”

root is the name of system admin

/root is the admin

Page 24: Linux file system

24

sbin

System configuration programs

Format hard disk

Manage hardware

Only “root” can run the programs

Page 25: Linux file system

25

sbin

sbin

fsck mkfs mount adduser poweroff...

Page 26: Linux file system

26

tmp

Temporary directory

All temp files are created by programs

Your temp files

It is emptied regularly

Page 27: Linux file system

27

usr

Secondary hierarchy

Very useful programs

We usually use them

compiler, tools

Are not essential for system startup

Page 28: Linux file system

28

usr

usr

bin doc include lib local sbin src

Linux-2.6.14

Page 29: Linux file system

29

var

The variable directory

All dynamic files

User cannot change the files

Page 30: Linux file system

30

var

var

cache lib lock log www named

message boot.log

Page 31: Linux file system

31

Helps

Some documents are in /usr/share/doc

Info pages are not complete help

info <command name>

Man pages

/usr/share/man

man1: user commands, man8: System administration

man <command name>

Page 32: Linux file system

32

Permissions

There are 3 basic permissions

Read (r)

Write (w)

Execute (x)

How to find them

ls -l

How to change them

chmod +/- r/w/x <filename>

Page 33: Linux file system

33

Mounting

Mount

To add a filesystem to other filesystem

Add you cool-disk FS to you laptop FS

How?

mount <options> <device> <mount point>

mount -t vfat /dev/sdb1 /mnt/flash

Don’t forget the umount

umount <mount point>

umount /mnt/flash

Page 34: Linux file system

34

Linux FS vs. Windows FS

There is not drive C:, D:

Top hierarchy is /

Path separator is / not \

File extensions have NOT any meaning

There is not hidden attribute, hidden files are

started by .

Page 35: Linux file system

35

[email protected]

تماس با واحد آموزش


Recommended