Introduction to Linux file system and common commands

Source: Internet
Author: User

In Linux, everything is a file, the following is a brief summary of the Linux file system partition type, file system type and common commands.

First, partition type
1. Primary partition: There can be up to four
2. Extended partition: There can only be one, or it can be considered as one of the primary partitions. That is, there can be up to four primary and extended partitions.
However, the extended partition cannot store data and formatting and must be partitioned into logical partitions to be used.
3. Logical partitioning: is divided in the extended partition, the partition number starts from 5 (1-4 is occupied by the primary and extended partitions),
If the IDE hard disk Linux supports up to 59 logical partitions, if it is SCSI hard disk Linux supports up to 11 logical partitions.

Format: Writes to the file system.

Ii. Types of file systems
Ext2: is an upgraded version of the Ext file system, the previous system of the Red Hat Linux7.2 version is
Ext2 file System. Released in 1993, with a maximum of 16TB partitions and a maximum of 2TB files.
The Ext3:ext3 file system is an upgraded version of the Ext2 file system, with the biggest difference being the log function to improve the reliability of the file system in the case of a system failure.
Supports partitions up to 16TB and files up to 2TB maximum
EXT4: is an upgraded version of the Ext3 file system. EXT4 has a number of improvements in performance, scalability, and reliability. such as backwards compatible ext3,
Maximum 1EB file system and 16TB files, unlimited subdirectories, extents continuous data block concept, multi-block allocation, deferred allocation,
Persistent pre-allocation, fast fsck, log check, no log mode,
Online defragmentation, inode enhancement, default enable barrier, and more. is the CentOS6.3 default file system.

Iii. common commands for file systems
DF: View disk space usage information for the file system
DF Options File
Options:
-A: Displays all file system information, including special file systems such as/proc,/SYSFS
-H: Easy to read display, such as KB,MB, or GB
-T: Show file system type
-M: Display capacity in megabytes
-K: Displays the capacity in kilobytes. is also the default unit
-I: Display inode information

Du: Statistics directory or file size
Du option directory or file name
Options:
-A: Displays the disk footprint for each sub-file. By default, only the disk footprint of subdirectories is counted
-H: Displays disk footprint in a convenient reading, such as KB,MB or GB
-S: Total usage of statistics, not listing subdirectories and sub-files
Note: If you have a large number of files in your directory, using the du command will scan the entire directory, comparing resources to slow.

The difference between DF and Du
1.DF commands are considered from the file system, not only to consider the space occupied by the file, but also to count the space occupied by the command itself or the program (if the file has been deleted,
However, the program does not free up space), so using DF to see the remaining space is the real free space.
The 2.DU command is file-oriented and only calculates the space occupied by the file or directory


FSCK: File System repair
FSCK option partition device file name (e.g./DEV/SDA1)
Options:
-A: Automatically fix file system without displaying user prompt
-Y: Auto fix. Consistent with-a action, some file systems only support-y
This command is automatically executed once when the system is started, so it is usually very rare to know, and it requires administrator privileges to use the command.

Introduction to Linux file system and common commands

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.