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
3File 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
4File 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)?
5File 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)
7Linux 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
8Searching the File System
9Using find
- Syntax find path name filename
- Ex find / name .log
- user username
- size size
10Using locate
11Using grep
- Search content in the file
- Syntax grep search_text file
- Ex grep vnc /var/log/messages
12Using 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.
13Managing Files and Directories
14- Creating files and directories
- Viewing file contents
- Deleting files and directories
- Copying and moving files and directories
- Creating links
15Creating Files and Directories
- To create file params within tmp
- touch /tmp/params
- To create a directory
- mkdir /tmp/backup
16Viewing Text File Contents
- cat filename
- less filename
- head filename
- tail filename
17Deleting Files and Directories
- rmdir dir_name the directory must empty
- rm -r dir_name delete directory
- rm filename delete filename
18Copy or move file
19Creating Links
- Hard link
- Soft link (symbolic link) similar shortcut in
windows
20PATH?
21(No Transcript)
22(No Transcript)
23(No Transcript)
24How can we check current mounted partition?
- Check current mounted by using mount command
without parameter - Example result for checking current mounted
partition
25How to use un-mount partition?
- umount is used to un-mount partition
- umount directory
- umount device
- Example
- umount /var
- Or
- umount /hda1
26Where is linux store list of mounting partition
when booting ?
- It is locate in /etc/fstab file
- Example of fstab file
27How 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
28How 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
29Working with Floppies
- mount t vfat /dev/fd0 /media/floppy
30Working with Optical Devices
- Syntax mount t iso9660 device mount_point
- Ex mount t iso9660 /dev/hdc /media/cdrom.
31Working with USB and FireWire Devices
- Syntax mount t auto device mount_point
- Ex mount t auto /dev/sdd /media/THUMBDRIVE
32Ex 6.5, page 320
33!
34Manage 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
35Back Up Data
- Selecting a backup medium
- Selecting a backup strategy
- Using Linux backup utilities
36Selecting a Backup Strategy
- Selecting a backup type
- Selecting a backup schedule
- Determining what to back up
37Selecting 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)
39Using 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.
40Using Linux Backup Utilities
41- tar cvf /dev/st0 /home
- Backup /home to tape
42Use tar to restore
- To restore a tar archive, simply enter
- tar xvf filename
43Create cpio
- find . print depth cpio ov gt
/media/usb/backup.cpio.
44Cpio restore
- cpio iv lt /media/usb/backup.cpio.