gnu/linux filesystem 1 st aut gnu/linux festival computer engineering & it department bahador...
Post on 20-Dec-2015
241 views
TRANSCRIPT
![Page 1: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/1.jpg)
GNU/Linux Filesystem
1st AUT GNU/Linux Festival
Computer Engineering & IT Department
Bahador Bakhshi
![Page 2: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/2.jpg)
2
What We Will Learn
Introduction
Filesystem Hierarchy Standard
Directory layout of Linux FS
Help
Mounting
![Page 3: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/3.jpg)
3
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 4: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/4.jpg)
4
Introduction (cont’d)
You should understand Linux FSWhy?
Everything in Linux is file, if it is NOT processEasy to use
Open file, read/write and close the file
Unlike Windows, Linux FS is standard FSEveryone should learn standards
![Page 5: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/5.jpg)
5
Filesystem Hierarchy Standard
Started by Dennis Ritchie, 1993
Defines the main directories and their contents in most Linux-based systems
Current Version: 2.3, 29 Jan 2004.
![Page 6: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/6.jpg)
6
FHS
There is not any drive C:, D:, …
All directories are under “/”“/” is the root directory
It is possible to have multiple partitionsto multiple filesystems
![Page 7: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/7.jpg)
7
The “/”
The primary hierarchy in FSHThe root of tree of filesystem
All paths start form here
There is only one “/” in filesystem
![Page 8: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/8.jpg)
8
The “/”
/
boot bin dev etc lib proc root sbin tmp usr var
![Page 9: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/9.jpg)
9
boot
Linux kernel
Boot loader configuration
If you lost bootYou cannot boot your OS
![Page 10: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/10.jpg)
10
boot
boot
vmlinuz-2.6.12 config-2.6.12 grub
grub.conf
![Page 11: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/11.jpg)
11
bin
Essential programs
Need for system startup
Basic commands for Navigating in filesystemFile management
![Page 12: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/12.jpg)
12
bin
bin
bash bzip2 cat gzip ls mv rm...
![Page 13: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/13.jpg)
13
dev
Everything is file Hardware components (devices) are file
Hard diskKey board
All device files are here
Direct interaction with device driver Open the device fileRead & Write
![Page 14: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/14.jpg)
14
dev
dev
hda fda sda tty random null...
![Page 15: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/15.jpg)
15
etc
System configuration directoryWhat is done by the registry in Windows
All configuration file are text filesYou can view and edit it manually
![Page 16: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/16.jpg)
16
etc
etc
bashrc fstab inittab passwd shadow X11
X11.conf
init.d
network named httpd
![Page 17: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/17.jpg)
17
home
Home directory of user
Each user has a directory/home/bahador/home/hamed
All files of user are stored here
![Page 18: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/18.jpg)
18
lib
Programs need librariesDynamically linked libraries
Programmers need libraries
All essential libraries are hereNeeded for system startup
![Page 19: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/19.jpg)
19
lib
lib
libc libm libcrypt libpthread modules
![Page 20: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/20.jpg)
20
proc
Kernel’s interfaceKernel pseudo-directory
Special directoryIt is NOT a directory on hard disk
Kernel Configuration
Kernel State monitoring
![Page 21: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/21.jpg)
21
proc
proc
cpuinfo meminfo devices interrupts net sys
tcp udp kernelnet
1 129
![Page 22: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/22.jpg)
22
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 23: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/23.jpg)
23
sbin
System configuration programsFormat hard diskManage hardware
Only “root” can run the programs
![Page 24: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/24.jpg)
24
sbin
sbin
fsck mkfs mount adduser poweroff...
![Page 25: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/25.jpg)
25
tmp
Temporary directory
All temp files are created by programs
Your temp files
It is emptied regularly
![Page 26: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/26.jpg)
26
usr
Secondary hierarchy
Very useful programsWe usually use them
compiler, tools
Are not essential for system startup
![Page 27: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/27.jpg)
27
usr
usr
bin doc include lib local sbin src
Linux-2.6.14
![Page 28: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/28.jpg)
28
var
The variable directory
All dynamic files
User cannot change the files
![Page 29: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/29.jpg)
29
var
var
cache lib lock log www named
message boot.log
![Page 30: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/30.jpg)
30
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 31: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/31.jpg)
31
Permissions
There are 3 basic permissionsRead (r)Write (w)Execute (x)
How to find themls -l
How to change themchmod +/- r/w/x <filename>
![Page 32: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/32.jpg)
32
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 33: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/33.jpg)
33
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 34: GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi](https://reader036.vdocuments.site/reader036/viewer/2022062320/56649d4d5503460f94a2c9b4/html5/thumbnails/34.jpg)
34
?