Linux File System - PowerPoint PPT Presentation

About This Presentation
Title:

Linux File System

Description:

Linux File System Linux File System Describe the Linux File System Complete Common File System Tasks Manage Disk Partitions Use Removable Media Back Up Data File ... – PowerPoint PPT presentation

Number of Views:277
Avg rating:3.0/5.0
Slides: 45
Provided by: Tung72
Category:
Tags: file | linux | system

less

Transcript and Presenter's Notes

Title: Linux File System


1
Linux File System
2
Linux File System
  • Describe the Linux File System
  • Complete Common File System Tasks
  • Manage Disk Partitions
  • Use Removable Media
  • Back Up Data

3
File System
  • File System is developed for
  • create/store/load/delete/seek file on media
  • Media example
  • Magnetic Media
  • Tape
  • Floppy disk
  • Hard disk
  • Optical Media
  • Cdrom
  • Dvd

4
File System of OS
  • File system of Windows OS
  • Windows 98 and Windows ME
  • Support FAT16, FAT32
  • Windows 2000
  • Support FAT16,FAT32, NTFS
  • Windows XP
  • Support FAT32, NTFS
  • File system of BSD Family OS
  • FFS (Fast File System)?

5
File System in Linux
  • File System in Linux is divided into 2 type
  • Linux Swap
  • is used in virtual memory system
  • Linux File System
  • is used to store file
  • there is various type of 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 )?

6
(No Transcript)
7
Linux File System Layout
  • / - first of mount point in linux
  • /etc - keep linux default configuration
  • /boot - keep important linux booting files
  • /dev - keep all device files
  • /usr - keep all user binary and X library
  • /home - keep user home directory
  • /proc - is pseudo file system for tracking
    running process and state of linux system
  • /var - keeping mail, log file and printer
    spooling
  • /lib - contain shared library that is required by
    system program
  • /tmp - contain system temporary file

8
Searching the File System
9
Using find
  • Syntax find path name filename
  • Ex find / name .log
  • user username
  • size size

10
Using locate
  • Syntax locate filename

11
Using grep
  • Search content in the file
  • Syntax grep search_text file
  • Ex grep vnc /var/log/messages

12
Using grep
  • When working with grep, you can use the following
    options
  • i Ignores case when searching for the search
    text.
  • l Doesnt display the actual matching line of
    text. Only displays the names
  • of the files that contain the matching text.
  • r Searches recursively through
    subdirectories of the path specified.

13
Managing Files and Directories
14
  • Creating files and directories
  • Viewing file contents
  • Deleting files and directories
  • Copying and moving files and directories
  • Creating links

15
Creating Files and Directories
  • To create file params within tmp
  • touch /tmp/params
  • To create a directory
  • mkdir /tmp/backup

16
Viewing Text File Contents
  • cat filename
  • less filename
  • head filename
  • tail filename

17
Deleting Files and Directories
  • rmdir dir_name the directory must empty
  • rm -r dir_name delete directory
  • rm filename delete filename

18
Copy or move file
  • cp copy
  • mv move

19
Creating Links
  • Hard link
  • Soft link (symbolic link) similar shortcut in
    windows

20
PATH?
21
(No Transcript)
22
(No Transcript)
23
(No Transcript)
24
How can we check current mounted partition?
  • Check current mounted by using mount command
    without parameter
  • Example result for checking current mounted
    partition

25
How to use un-mount partition?
  • umount is used to un-mount partition
  • umount directory
  • umount device
  • Example
  • umount /var
  • Or
  • umount /hda1

26
Where is linux store list of mounting partition
when booting ?
  • It is locate in /etc/fstab file
  • Example of fstab file

27
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

28
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

29
Working with Floppies
  • mount t vfat /dev/fd0 /media/floppy

30
Working with Optical Devices
  • Syntax mount t iso9660 device mount_point
  • Ex mount t iso9660 /dev/hdc /media/cdrom.

31
Working with USB and FireWire Devices
  • Syntax mount t auto device mount_point
  • Ex mount t auto /dev/sdd /media/THUMBDRIVE

32
Ex 6.5, page 320
33
!
34
Manage Disk Partitions
  • Using fdisk to create disk partitions
  • Building a file system with mkfs
  • Mounting a partition with mount
  • Checking the file system with fsck
  • Exercise 6.4, page 312

35
Back Up Data
  • Selecting a backup medium
  • Selecting a backup strategy
  • Using Linux backup utilities

36
Selecting a Backup Strategy
  • Selecting a backup type
  • Selecting a backup schedule
  • Determining what to back up

37
Selecting a Backup Type
  • ? Full backups back up everything and flag the
    files as having been backed up.
  • ? Incremental backups back up everything that has
    been modified since the last full or incremental
    backup and flag the files as having been backed
    up.
  • ? Differential backups back up everything that
    has been backed up since the last full backup. It
    doesnt flag the files as having been backed up.

38
(No Transcript)
39
Using Linux Backup Utilities
  • tar cvf filename directory.
  • The c option tells tar to create a new archive.
  • The v option tells tar to work in verbose mode,
    displaying each file being backed up on screen.
    The f option specifies the name of the tar
    archive to be created.
  • tar cvf /media/usb/backup.tar /home.

40
Using Linux Backup Utilities
  • tar
  • cpio

41
  • tar cvf /dev/st0 /home
  • Backup /home to tape

42
Use tar to restore
  • To restore a tar archive, simply enter
  • tar xvf filename

43
Create cpio
  • find . print depth cpio ov gt
    /media/usb/backup.cpio.

44
Cpio restore
  • cpio iv lt /media/usb/backup.cpio.
Write a Comment
User Comments (0)
About PowerShow.com