Article Title: galloping in the Linux World-Linux System Management 4. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
(4) Support for modifying the file system at the beginning
As mentioned earlier in writing the quota STARTUP script, before using the script file to enable the quota function, you must specify the file system in the/etc/fstab file. This is because the/etc/fstab file also needs to be modified to make the hard disk quota on the file system valid at the beginning of each time.
In the/etc/fstab file, partitions that do not enable quota are generally as follows:
If you want to add the user quota function to the file system, you should add "usrquota" after the "defaults" option ". For example, if you want to set quota for the file system on/dev/hdb2, modify it as follows:
/Dev/hdb2/workext2defaults, usrquota1 2
If you need to enable quota support for user groups in the file system, you need to add "maid" after the "defaults" option ":
/Dev/hdb2/work ext2defaults, MAID 2
If you need to support both user quota and group quota, modify as follows:
/Dev/hdb2/work ext2 defaults, usrquota, MAID 2
(5) Create the quota. user and quota. group files.
In the above (3) script, the command "quotacheck-avug" is used to check all subdirectories under the directory where the disk quota needs to be opened and create a quota. user and quota. group configuration file. These two files are used to record the configuration information of quota and the usage of the hard disk in the current quota directory. The first check may be slow.
If quota is installed for the first time, you must first locate the directory to which you want to set quota. The preceding example directory is/work. In this directory, run the "quotacheck-avug" command, let the system automatically generate quota. user and quota. group file. The content of these two files is relatively simple and clear to readers.
File System and Maintenance
Linux provides a general interface for all file system types that can be identified by it. Therefore, the precise format and method of file storage is not important for users. Linux can support the main file system types include ext2 and ext3 file system, used to store Linux Files; ms dos file system, allow Linux to access ms dos/Win9x partition and files on the floppy disk; other file systems include the ISO 9660 file system used by cd rom.
As a system administrator, you should master the following knowledge and skills:
◆ Understand the organization of the file system on Linux and the principle of file storage;
◆ Familiar with partition and file system configuration files;
◆ Create a file system on a floppy disk and add a new file system to the hard disk;
◆ Use various tools to check and repair the file system;
◆ You should also be familiar with various commands for accessing files on the file system.
As mentioned above, a file system is a mechanism used by the operating system to organize files on a disk. Its carrier is a floppy disk or hard disk partition. A floppy disk or hard disk partition must be initialized when used as a file system, and the data structure of the file is written to these media. This process is the process of establishing a file system. Generally, most programs in an operating system are based on the file system in the operating system environment, and cannot work normally when transferred to another file system.
In Linux, each file system occupies an independent partition of the hard disk. Linux can have multiple file systems. Therefore, before installing the Linux system, you must prepare at least one file system to store the Linux system. In general, it is recommended that you provide multiple file systems when installing a Linux system, because this provides better system security.
That is to say, when the file system in a certain partition of the system is damaged, the file system in other Linux partitions will not be affected. On the contrary, if all files are stored in the root file system, all Linux files will be lost when the file system is damaged.
Another reason for using a multi-file system is that you need to allocate storage space on multiple hard disks. That is to say, the space on multiple hard disks can be divided into multiple partitions for Linux to make full use of the system's hard disk space.
Create a File System
After the hard disk is partitioned, a file system should be created on the partition. This step is completed using the mkfs tool. In fact, a tool is provided for each file system Linux to do this. Mkfs uses the-t fstype parameter to specify the file system type to be created. Generally, operations to create a file system will clear the data in the original partition, and this process is irreversible.
The mkfs command is generally formatted as follows:
The-t fstype option specifies the file system type to be created. By default, it is the ext2 file system. To create an ms dos file system, use the msdos parameter. Option-c is used to find the bad blocks in the partition and initialize the Bad blocks list. We recommend that you use this option when installing the system for the first time.
For example, if you need to create an ext2 File System on the partition/dev/hda1 and check for Bad blocks, use the following command:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service