TXT

Linux System Administration PPTs module5

By Curtis Lawson,2014-05-27 14:58
10 views 0
Linux System Administration PPTs module5

     ??ÎÄÓÉericchen1960??Ï×

    pptÎĵµ?ÉÄÜÔÚWAP?Ëä?ÀÀÌåÑé???Ñ????ÒéÄúÓÅÏÈÑ?ÔñTXT???òÏÂÔØÔ?ÎÄ?þµ????ú?é????

     Creating and Managing File Systems

     Creating and Managing File Systems

     Module 5 ?C Creating and Managing File Systems

     Overview This module deals with the structure of the file system, the standard types of file system in Linux. This module also deals with the file system structure, mounting file system and unmounting file systems and disk quotas. Lessons covered in this module File System Structure ext2 and ext3 File System Creating File Systems Checking File Systems Mounting and Unmounting File Systems Disk Quotas

     Creating and Managing File Systems

     Lesson 1 ?C File System Structure

     Introduction A file system is a data structure which interprets the physical sector of a disc into logical directory structure. The logical structure will help computers and users to trace files. The file system registers the location of the files and directories on the disc Topics Covered in this Lesson What is File System Structure File System Hierarchy Standard Special File Locations under Red Hat Linux Standard

     Creating and Managing File Systems

     Topic 1 ?C What is File System Structure

     The file system structure is the most basic level of organization in an

     operating system. A file system is an organization of storage space intended to contain files in directories. Providing a common file system structure ensures users and programs are able to access and write files. File systems are divided into two categories: Static and dynamic files.

     Contd ??

     Creating and Managing File Systems

     The Virtual File System (VFS)

     Contd ??

     Creating and Managing File Systems

     Topic 2 ?C File System Hierarchy Standard

     Red Hat Enterprise Linux uses the File System Hierarchy Standard (FHS) file system structure Linux Directory Structure

     Contd ??

     Creating and Managing File Systems

     Topic 2 ?C File System Hierarchy Standard

     Topic 3 ?C Hat File Locations Linux has made an Red

    SpecialEnterpriseunder Red Hat Linux Standard extension of FHS structure

     slightly to contain special files.

     Files related to RPM (Red Hat Package Manager) are placed in the

     /var/lib/rpm directory.

     The /var/spool/up2date/ directory holds files used by Red Hat Update

     Agent..

     The /etc/sysconfig directory is also specific to Red Hat Enterprise

     Linux.

     Creating and Managing File Systems

     Lesson 2 ?C ext2 and ext3 File system

     Introduction Linux supports several file systems but the most commonly used was the Second Extended or ext2 file system. Now the ext2 file system has been replaced by Third Extended or ext3 file system, which is a journaling version of ext2 file system. Topics covered in this lesson Second extended or ext2 File System The ext3 File System ext2 and ext3 File System Attributes

     Creating and Managing File Systems

     Topic 1 ?C Second extended or ext2 File System

     In Linux, the ext2 file system or second extended file system was the

     file system by default.

     It supports partitions that are up to 4 terabytes or 4096 Gigabytes in

     size and a file of up to 2 Gigabytes in size. Physical layout of the ext2 File System

     Creating and Managing File Systems

     The ext2 Inode

     In the ext2 file system, the inode is the basic building block; every file and directory in the file system is described by one and only one inode

     Creating and Managing File Systems

     ext2 Directories

     In the ext2 file system, directories are special files that are used to

     create and hold access paths to the files in the file system

     Creating and Managing File Systems

     Topic 2 ?C The ext3 File System

     This is the third extended file system, ext3 is used by Linux currently

     and it is a journaling file system.

     Journaling file system keeps temporary data in a new location,

     unrelated to the permanent data and metadata on disk.

     ext3 file system is an enhanced version of the ext2 file system There are several advantages of ext3 File system over ext2 file system

     Creating and Managing File Systems

     Topic 3 - ext2 and ext3 File System Attributes

     Besides to the UNIX-derived modes of permission, the ext2 file system

     structure gives a few data controls or attributes. To enable file attributes, the following command is used: Chattr +|-| = [attribute??] file [file??.] Some of the attributes given below may be enabled:

     A when a file is modified, its atime record is not modified. D the file is skipped for backup by dump.

     Creating and Managing File Systems

     Lesson 3 ?C Creating File Systems

     Introduction File systems are created on the partitions. The partitions have to be created before creating a file system. By default ext2 file system is generated when the ??make file system?? command is used. But now ext3 is the file system by default Topics Covered in this Lesson Creation of an ext2 File System Creation of an ext3 File System Conversion of ext2 to ext3 File System

     Creating and Managing File Systems

     Topic 1 - Creation of an ext2 File System

     mkfs is a standard utility used in creating file systems. By default mkfs

     creates ext2 file system. The command given below will create an ext2 file system. [root@localhost ~]# mkfs /dev/hda1 The above command when executed will create an ext2 file system on the first primary partition and on the first IDE hard drive

     Creating and Managing File Systems

     Topic 2 - Creation of an ext3 File System

     Installation of Red Hat Linux will use ext3 for all file systems by

     default. After partitioning a hard disk, an ext3 file system can be created by using the command [root@localhost ~]# mkfs ?Cj ext3 /dev/hda1 This command will generate an ext3 file system on the first partition and on the first IDE hard drive

     Creating and Managing File Systems

     Topic 3 - Conversion of ext2 to ext3 File System

     Converting an ext2 file system into an ext3 file system can be done

     using root privileges and the below command

     tune2fs ?Cj

     For example, tune2fs ?Cj /dev/hda7

     The command df is run that will display mounted file systems. After

     running the above commands, the partition type has to be changed from ext2 to ext3 in the /etc/fstab file.

     Creating and Managing File Systems

     Lab Exercise

     Exercise 1 Creating Partition In this lab you have to create a 100M partition with ext2 file system by using fdisk and then convert ext2 file system to ext3 file system.

     Creating and Managing File Systems

     Lesson 4 ?C Checking File Systems

     Introduction File systems needs to be maintained and periodic checks have to be performed on the file systems. This is one of the tasks of the system administrator. Linux has a utility that checks and repairs the file system at every reboot and performs the process quickly Topics covered in this Lesson Maintaining File Systems

     Creating and Managing File Systems

     Topic 1 - Maintaining File Systems

     System administrators?? tasks include maintaining file systems

     periodically.

     Checking File Systems The utility fsck which means ??file system check?? is used generally to check and repair file system

     Creating and Managing File Systems

     File System Labels

     The e2label command is used to view what the ext2 label is by

     indicating the raw device for the file system.

     [root@localhost ~]# e2label /dev/hda2 /usr

     A new label can be set using the command given below [root@localhost ~]# e2label /dev/hda5 /iiht

     After setting labels, the mount command can be used with labels and it

     will mechanically trace the proper underlying device.

     For example: # mount LABEL=/iiht /iiht

     Creating and Managing File Systems

     Lesson 5 ?C Mounting and Unmounting File Systems

     Introduction Mounting a file system is instructing the operating system to make a file system available for use at a particular location. That particular location is called mount point. When the user no longer uses this file, then that file system should be unmounted Topics Covered in this lesson Mounting File Systems Unmounting File Systems

     Creating and Managing File Systems

     Topic 1 ?C Mounting File Systems

     A file system is mounted on a directory so that it is accessible to the

     users

     A file system is mounted on a directory so that it is accessible to the

     users

     Using the mount command The basic command used [root@localhost ~]# mount device directory If options are used then: [root@localhost ~]# mount device directory

     Creating and Managing File Systems

     Topic 2 ?C Unmounting File Systems

     Linux will allow only the file systems that are not in use to be

     unmounted.

     The command used to unmount a file system is: [root@localhost ~]# umount device directory where directory is the directory to be unmounted.

     Note: the command used is spelt as umount and not unmount

     Creating and Managing File Systems

     Lesson 6 ?C Disk Quotas

     Introduction In a multi-user system environment, it is very common to have problems like some users utilizing disk space more than they require. This problem can be completely rectified by using Disk Quotas feature of Linux. Topics Covered in this lesson What are Disk Quotas? Implementing Disk Quota Disk Quota Settings Configuration Managing Disk Quotas

     Creating and Managing File Systems

     Topic 1- What are Disk Quotas?

     In a multi-user environment, problems such as some users utilizing

     more than required space persists and this can be rectified by many methods.

     These methods include requesting the users to utilize some amount of

     space as required by them and disk quotas.

     The disk quota is a successful method of Linux that permits the system

     administrator to distribute amount of disk space.

     Assigning disk quotas is flexible and is implemented per file system.

     Creating and Managing File Systems

     Topic 2 ?C Implementing Disk Quotas

     Disk quotas can be established by inodes or by blocks on user or group

     levels.

     The procedure involved in the configuration of disk quotas is as given

     below:

     The file system should be mounted with the usrquota and (or) or grpquota option. Quota configuration files, aquota.user and aquota.group Kernel support for disk quotas should be made active Allocate user and (or) or group quotas as proper through the edquota command

     Creating and Managing File Systems

     Topic 3 ?C Disk Quota Setting Configuration

     Disk quotas can be created, modified and eliminated by using edquota

     command.

     For example: [root@localhost ~]# edquota user1

     The above command will start vi editor on a transient text file.

    The values are to be modified in the proper column and the user can exit the file after saving it

     Creating and Managing File Systems

     Topic 4 ?C Managing Disk Quotas

     Managing and checking disk usage of a file system can be done using

     commands:

     Quotacheck repquota quota

     The reliability of the quota database is verified by using the quotacheck

     command

     The repquota command will make a summarized report of disk quota

     usage on the system

     The quota command is used to check quota usage on a system-wide

     Creating and Managing File Systems

     Topic 4 ?C Managing Disk Quotas

     quota report of partition /dev/hda10

     Creating and Managing File Systems

     Lab Exercise

     Exercise - Implementing Disk Quota In this lab you have to create a partition and implement a disk quota on

     that partition. You have to perform the following steps:

     Create a partition and mount that partition with usrquota option Enable the quota on that partition Create a user test1 password test1 Set the (number of file ) soft and hard limit for user test1 to 3 and 5

     Creating and Managing File Systems

     Conclusion

     Summary

     File System Structure is the fundamental level of organization in an operating system File system is created using mkfs i.e. ??make file system?? command. Mount and umount commands are used to mount and unmount file systems respectively The disk quota is a successful method of Linux for allotting disk space

     Question and Answer session

??TXTÓÉ??ÎÄ?â????ÏÂÔØ:http://www.mozhua.net/wenkubao

Report this document

For any questions or suggestions please email
cust-service@docsford.com