Presentation is loading. Please wait.

Presentation is loading. Please wait.

Creating and Managing File Systems. Module 5 – Creating and Managing File Systems ♦ Overview This module deals with the structure of the file system,

Similar presentations


Presentation on theme: "Creating and Managing File Systems. Module 5 – Creating and Managing File Systems ♦ Overview This module deals with the structure of the file system,"— Presentation transcript:

1 Creating and Managing File Systems

2 Module 5 – 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

3 Creating and Managing File Systems ♦ 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 Lesson 1 – File System Structure

4 Creating and Managing File Systems Topic 1 – 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 …

5 Creating and Managing File Systems Contd … The Virtual File System (VFS)

6 Creating and Managing File Systems Topic 2 – File System Hierarchy Standard Red Hat Enterprise Linux uses the File System Hierarchy Standard (FHS) file system structure Linux Directory Structure Contd …

7 Creating and Managing File Systems Topic 3 – Special File Locations under Red Hat Linux Standard ♦ Red Hat Enterprise Linux has made an 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. Topic 2 – File System Hierarchy Standard

8 Creating and Managing File Systems Lesson 2 – 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

9 Creating and Managing File Systems Topic 1 – 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

10 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

11 Creating and Managing File Systems ♦ 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 ext2 Directories

12 Creating and Managing File Systems Topic 2 – 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

13 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.

14 Creating and Managing File Systems Lesson 3 – 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

15 Creating and Managing File Systems ♦ 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 Topic 1 - Creation of an ext2 File System

16 Creating and Managing File Systems ♦ 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 –j ext3 /dev/hda1 This command will generate an ext3 file system on the first partition and on the first IDE hard drive Topic 2 - Creation of an ext3 File System

17 Creating and Managing File Systems ♦ Converting an ext2 file system into an ext3 file system can be done using root privileges and the below command tune2fs –j ► For example, tune2fs –j /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. Topic 3 - Conversion of ext2 to ext3 File System

18 Creating and Managing File Systems ♦ 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. Lab Exercise

19 Creating and Managing 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 Lesson 4 – Checking File Systems

20 Creating and Managing 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 Topic 1 - Maintaining File Systems

21 Creating and Managing File Systems ♦ 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 File System Labels

22 Creating and Managing 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 Lesson 5 – Mounting and Unmounting File Systems

23 Creating and Managing File Systems ♦ 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 Topic 1 – Mounting File Systems

24 Creating and Managing 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 Topic 2 – Unmounting File Systems

25 Creating and Managing File Systems ♦ 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 Lesson 6 – Disk Quotas

26 Creating and Managing File Systems ♦ 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. Topic 1- What are Disk Quotas?

27 Creating and Managing File Systems ♦ 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 Topic 2 – Implementing Disk Quotas

28 Creating and Managing File Systems ♦ 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 Topic 3 – Disk Quota Setting Configuration

29 Creating and Managing File Systems ♦ 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 Topic 4 – Managing Disk Quotas

30 Creating and Managing File Systems ♦ quota report of partition /dev/hda10 Topic 4 – Managing Disk Quotas

31 Creating and Managing File Systems ♦ 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 Lab Exercise

32 Creating and Managing File Systems ♦ 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 Conclusion


Download ppt "Creating and Managing File Systems. Module 5 – Creating and Managing File Systems ♦ Overview This module deals with the structure of the file system,"

Similar presentations


Ads by Google