当前位置:网站首页>File system and log analysis
File system and log analysis
2022-07-24 06:36:00 【Walking Di five flowers】
Catalog
3、 ... and 、 Access file process
6、 ... and 、 Classification of log files
One 、inode And block
1、 File data consists of meta information and actual data .
2、 The files are stored on the hard disk , The smallest unit on the hard disk is “ A sector ”, Each sector stores 512 byte
block( block ): Eight consecutive sectors make up one block block , Is the smallest unit of file access
inode( The index node ): Also called inode node , Used to store file meta information ( Meta information is quite Window Documents in / Properties of directories and so on )
( The smallest unit on the hard disk is sector 512 byte
The smallest unit of file storage is block 4K
Successive 8 Sectors make up a block block 512x8=4096 byte =4k )
3、 see inode Value method ① ls -i file / Catalog
②stat file / Catalog : stat Inquire about inode Value contains information

In use find When searching ,time Represents days , also min It means minute, which means it was modified a few minutes ago
atime Represents the access time of the file
mtime Indicates the content modification time of the file
ctime Indicates the attribute modification time of the file
Two 、 Hard and soft links
1、 The difference between hard link and soft link
Soft link :
type : Shortcut ; Operating range : It can be used across regions ; Occupancy space : Just occupy inode Value size ; Action object : You can create a directory
Hard to connect :
type : copy ; Operating range : Non cross region ; Occupancy space : The size is the same as the original file ; Action object : You cannot create a directory

experimental data



3、 ... and 、 Access file process

1、 When the range has a soft connection , First find the file name ——》 Soft connection inode node ——》 original file name ——》 The original document inode node ——》block block data
analysis : When deleting the original file , The soft connection fails , Flashing red , When a file with the same name is created, it will be restored

2、 Hard links
Hard links and original documents inode The value is the same . All point to the same inode It's worth it , All deleting soft links or hard links has no effect on each other . But if you delete inode value , There will be no documents .

Four 、 Delete inode value
1、 Normally, delete a file . System operation flow
rm -rf file name
Find the filename ——》 Find according to the file name inode value ——》 Finally, delete the data
2、 Delete inode value , The data is deleted ( The file name is only for users , The system recognizes inode value )

The delete command ①:find ./ -inum Numerical value -exec rm -i {} \; Find the items that need to be deleted under the current directory inode value , And delete
②:find ./ -inum Numerical value -delete Find the items that need to be deleted under the current directory inode value , And delete
3、 Delete inode Usefulness ( Use scenarios )
① The filename contains special characters , It may not be deleted properly . In this case, you can directly delete inode, Can play the role of deleting files
② Move or rename files , Just change the filename , No effect inode number
③ After opening a file , The system is based on inode Number to identify this file , Don't think about file names anymore .
④ After the file data is modified and saved , Will generate a new inode number .
⑤ When the system disk resources are insufficient , When data cannot be deleted by deleting the file name , We can delete inode Value to delete .
5、 ... and 、inode Value size
inode It also consumes hard disk space , When the hard disk is formatted , The operating system automatically divides the hard disk into two areas . One is the data area , Store file data ; The other is inode District (inode table) , Deposit inode The information contained .
6、 ... and 、 Classification of log files
Log files are used to record Linux Files of various running messages in the operating system , Be the host first “ Diary ”.
1、 The role of logs : Auxiliary obstacle removal ; Data recovery ; Data analysis
2、 Classification of log :
Kernel and system log : This kind of log data is served by the system rsyslog Unified management , According to its main configuration file ./etc/rsyslog.conf The settings in determine where to record kernel messages and various system program messages
User logs : This kind of log data is used to record Linux. Operating system information about user login and logout , Include user name 、 Logged in terminal 、 The login time 、 Source host 、 Process operations in use, etc
Program log : Some applications choose to manage a log file independently ( Not to rsyslog)) Service management ), Used to record all kinds of event information in the process of running this program .
3、 The level of system kernel log messages , common 8 level , We use 3 Level and 4 Level 2 .
The more important the program or service , The log information with lower priority should be saved , In this way, it is convenient to check the fault
Linux Priority of system kernel log messages ( The lower the number level , The higher the priority , The more important the news is ):
0 EMERG( emergency ): It will lead to the unavailability of the host system .
1 ALERT( Warning ): A problem that must be solved immediately .
2 CRIT( serious ): A more serious situation .
3 ERR( error ): There was an error running .
4 WARNING( remind ): It may affect the function of the system , Important events that need to alert users .
5 NOTICE( Be careful ): It doesn't affect normal function , But the things that need attention .
6 INFO( Information ): General information .
7 DEBUG( debugging ): A program or system i Debugging information, etc .
summary :
To study the inode value , His differences and usage , And delete inode Value to delete the file , Classification of logs and viewing logs
边栏推荐
- Install Apache manually
- Homework in the second week
- Life warning Maxim
- 【217】#!/ The meaning of usr/bin/env
- Common commands and package management of go language
- Yiwen node installation, download and configuration
- United Nations agricultural products data analysis
- 三分钟记住20道性能测试经典面试题
- JSP tag 02
- List of problems in the re disk guidance of the project
猜你喜欢

A batch of interview questions and answers_ 20180403 latest arrangement

Leetcode sword finger offer jz25 merges two sorted linked lists

FTP服务与实验

Difference between PX and EM and REM

IP course (OSPF) comprehensive experiment

Use intranet penetration to realize public network access to the Intranet

FTP service and experiment

Leetcode refers to offer jz5 to replace the space string

Do not rent a server, build your own personal business website (how to buy a domain name)

go的环境搭建和起步
随机推荐
MySQL from basic to entry to high availability
Flink function (2): checkpointedfunction
利用sshpass批量实现基于key验证
Luckyframeweb testing platform (a full latitude free open source testing platform that supports interface automation, Web UI automation, APP automation, and distributed testing)
Mysql database - SQL summary (remember to pay attention to me! Come on in China!)
Polkadot | interprets how liberty plan, which subverts traditional social media, will be launched in Poka
进程和计划任务管理
Customize MVC 3.0
mysql 忘记退出直接关闭窗口现在要删除整个文件夹如何删除
Flink time stream processing
Remember 20 classic interview questions of performance test in three minutes
Log collection and analysis platform
FTP service and experiment
Custom MVC 1.0
Ia class summary (1)
Summary of common working methods (7S, SWOT analysis, PDCA cycle, smart principle, 6w2h, time management, WBS, 28 principles)
Pycharm set code template
OpenSSL version upgrade
系统安全及应用
How to build a website full of ritual sense and publish it on the public website 2-2