Sunteți pe pagina 1din 14

Linux File System

Presented by Aphirak Jansang


04/15/12 1

File System

File System is developed for


create/store/load/delete/seek file on media Media example

Magnetic Media

Tape Floppy disk Hard disk Cdrom Dvd 2

Optical Media

04/15/12

File System of OS

File system of Windows OS

Windows 98 and Windows ME

Support FAT16, FAT32 Support FAT16,FAT32, NTFS Support FAT32, NTFS

Windows 2000

Windows XP

File system of BSD Family OS

FFS (Fast File System)


3

04/15/12

File System in Linux

File System in Linux is divided into 2 type

Linux Swap

is used in virtual memory system is used to store file there is various type of file system

Linux File System


ext2 ( is first introduced in kernel 2.0.x ) reiserfs ( is first introduced in kernel 2.2.x ) ext3 ( is first introduced in kernel 2.4.x )

04/15/12

Different between Linux and Windows File System


Characteristic
File System

Windows
NTFS, FAT

Linux
ext2,ext3

Reference Root of each Each partition will be Each partitions is partition point own root mounted under / Ex. C:, D:, F:

04/15/12

Linux File System Layout

/
/etc /boot /dev /usr /home /proc

/var spooling /lib - contain shared library that is required by system program /tmp - contain system temporary file

- first of mount point in linux - keep linux default configuration - keep important linux booting files - keep all device files - keep all user binary and X library - keep user home directory - is pseudo file system for tracking running process and state of linux system - keeping mail, log file and printer

04/15/12

How Linux mount this layout?


/
hda3

hda1

/var
Using mount command

/home

hda4

mount t type device target-dir

type ex. ext2, ext3, reiserfs, device ex. /dev/hda1, /dev/hdb1, target-dir ex. /, /var, /home, /mnt/cdrom,
7

04/15/12

How to use mount command?


/
hda3, ext2

hda1,ext2

/var

/home

hda4,ext2

mount command example


mount t ext2 /dev/hda3 / mount t ext2 /dev/hda4 /home mount t ext2 /dev/hda1 /var 8

04/15/12

How can we check current mounted partition?

Check current mounted by using mount command without parameter Example result for checking current mounted partition

04/15/12

How to use un-mount partition?

umount is used to un-mount partition


umount directory umount device

Example

umount /var

Or

umount /hda1
10

04/15/12

Where is linux store list of mounting partition when booting ?


It is locate in /etc/fstab file Example of fstab file

04/15/12

11

How can we add new mount partition entry in /etc/fstab?

Assume we would like to add windows partition (hdb1, FAT32) that linux have to mount at boot time at /mnt/windows

file system = /dev/hdb1 mount point = /mnt/window type = vfat Options = defaults Dump = 0 Pass = 1
12

04/15/12

How can we add new mount partition entry in /etc/fstab?

From the previous information, we have to add following line in /etc/fstab files
/dev/hba1 /mnt/windows vfat defaults 0 0

04/15/12

13

Conclusion

Linux File System


ext3 file system ext2 file system mount t type device target-dir umount device | umount target-dir /etc/fstab
14

Mount/Un-mount command

Linux System mount configuration file

04/15/12

S-ar putea să vă placă și