1, the difference between the twoDu,disk usage, is to calculate the size of each file by searching for files and then add up, du can see the files are just some currently exist, and it has not been deleted. The size of his calculations is the cumulative sum of all the file sizes that he currently thinks exist.Df,disk free, through the file system to quickly get information about the size of the space, when we delete a file, this file does notis immediately disappear in the file system, but tempo
DF displays a much larger percentage of the used disk occupancy than du statistics. The reason is mainly due to the different ways of calculating the results.
First, the experimental situation1. Create and delete filesDisk capacity before file creation:Reference # Df-hFile system capacity used available% mount point/DEV/SDA1 12G 5.7G 5.5G 51%/Tmpfs 506M 0 506M 0%/dev/shm
Create file: Reference # dd If=/dev/
This morning received a Netizen's help, saying that the root partition of the server is full. However, there is no specific large file to find. Because the fault is really weird, I will come to the relevant account password of the failed server.
Failed server related environments:
System: Centos 6.5
Selinux:disabled
Iptables: Open, but the default policy is all: ACCEPT
Our auxiliary server related environment:
System: Centos 6.5
Selinux:permissive
Iptables: Open, but the default policy is all:
Detailed DF command usage
A: displays the disk usage of all file systems and partitions.I: displays the I-nodes usage.K: The size is represented by K (default)T: displays the disk usage of all partitions in a file system.X: displays the disk usage of all partitions of a file system.T: displays the file system name of each partition.Common commands: DF-Hi
Operation DetailsThe reference command
In Linux, check the folder size, disk space remaining (du/df), and dudf.1. Introduction
View the directory size in du, and view the disk usage in df.2. du
Disk usage(1) Basic functions Recursively view the size of all files in a folder(2) common parameters: -H,-human-readable Display dimensions in a readable manner (for example, 1 K 234 M 2G) -S,-summarize only calculates the total usage of each parameter
Questions :Using the DF command to view, a partition usage has reached 100%, but with the du command to count the partition, it is found that the remaining 10G of the partition space is available. Instance:Analysis: If a file is deleted when it is open, the system will still assume that the file still exists. So DF will still be when these files are still present and included in the statistics.Solve: grep
DF commandDF View the total capacity, usage capacity, remaining capacity, etc. of mounted disks. It can be displayed by default in units of K without any parameters. [[email protected] ~]# DFFilesystem 1k-blocks used Available use% mounted on/dev/sda3 18244476 1603980 15707072 10%/Tmpfs 506228 0 506228 0%/dev/shm/DEV/SDA1 194241 27180 156821 15%/bootDF Common options are-I,-H,-K,-M-I view inodes usage status[Email protected] ~]#
When the size of the disk exceeds the standard, there will be alarm prompts, if you know the DF and du command is a very wise choice.DF can view the first-level folder size, usage scale, file system and its hang-in points, but there is nothing to file. Du can view the size of files and folders.Brief introductionthe DF command can show the available space and usage for all current file systems[Email protecte
DF (disk free): Lists the overall disk usage of the file systemUsage:DF [-AKMHI] [directory or file name]Parameters:-A: List all file systems, including system-specific/proc and other file systems-K: Displays the file system in KB capacity;-M: Displays the file system in MB capacity; -H: In the people easier to read GB, MB, KB and other formats to display their own;-I: Do not use the hard disk capacity, but the number of inode to display.Common usage
Transferred from: http://www.cnblogs.com/benio/archive/2010/10/13/1849946.htmlWhen the size of the disk exceeds the standard, there will be alarm prompts, if you know the DF and du command is a very wise choice.DF can view the first-level folder size, usage scale, file system and its hang-in points, but there is nothing to file.Du can view the size of files and folders.It works well with both. For example, use DF
Spatial information for file systemsDF CommandDfcommand provides a single-line summary,a row shows the used and available space for a loaded system of asking the price.the unit depends on the system,some use blocks,some of them areKB.Most modern implementations support- kOptions,That is, forced useKBUnit,as well-L (Lowercase LettersL)Options,Show local file system only,Exclude network-loaded file systems.DF Command DetailedSyntax :DF [ Options ] [ fil
The function of the DF command in Linux is to check the disk space footprint of the filesystem on the Linux server. You can use this command to get how much space the hard disk is occupied and how much space is left.
1. Command format:
DF [Options] [file]
2. Command function:
Displays the available space for the specified disk file. If no file name is specified, the free space for all currently mounted
App server root full, always alarmDF shows that the root partition has used 90% of the space, but the sum of the Du root partition is only about 40G, the partition should not have a large number of small files, so there should be no large number of small files caused by block write full problem.Online search issued by the existing may be a program to operate large files resulting in the file handle is not released, these programs are occupied by the file handle will be
Document directory
Du command:
DF command:
Unallocated space in the file system is used to determine the size of allocated space in the file system. For example, if a file system contains 8192 512-byte blocks and 4096 are not allocated, the allocated space is 4096-byte blocks.
Allocated space = total space-unallocated Space
Because the calculation is based on the overall file system, the DF command is
Du, df, and Linuxdudf in Linux
During Linux O M, it is often found that the values of du and df are different, and sometimes they are very different.
In specific circumstances, df may see that the disk is full, but du determines that the disk space is large.
The file system allocates some disk blocks to record some of its own data, such as I nodes, disk distr
Why is the use of Du and DF to view disk capacity inconsistencies, whether there are bugs or disk fragments, or which result should prevail. In fact, the values of the two commands are inconsistent due to differences in implementation of DU and DF commands, rather than failures.[Root@www ~]# Du-sh/home4.7g/home[Root@www ~]# df-h/homeFileSystem Size Used Avail use
1.10th bit DF of the flag register, direction sign bit. In the string processing instruction, control the increment and decrement of si,di after each operationDf=0, after each operation, Si, di addDf=1, after each operation, Si, di decreasesWe are able to describe the functions of MOVSB in the assembly syntax such as the following:mov es:[di],byte ptr ds:[si]; 8086 does not support this instruction, only for descriptive narrative useSuppose
In linux, the results of df and du reports are different-Linux general technology-Linux technology and application information. The following is a detailed description. There is a script at work
Regularly log on to the server. df: Check partition usage.
If the usage rate exceeds 80%
Alert (email sms)
I recently found a machine reported
Wait for a while and process it (directly rm file)
Report again a
Original
Detailed DF command usage
A: displays the disk usage of all file systems and partitions.
I: displays the I-nodes usage.
K: The size is represented by K (default)
T: displays the disk usage of all partitions in a file system.
X: displays the disk usage of all partitions of a file system.
T: displays the file system name of each partition.
Common commands:DF-Hi
Operation Details
ReferenceThe command
View the file and folder size in Linux (df amp; du)Df
Usage: df [Option]… [File]…Displays the information of the file system where each file is located. All file systems are displayed by default.
Common options-H,-human-readable size displayed as human readable form (e.g., 1 K 234 M 2G)
Example
[Root @ www ~] # Df-H f
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.