In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces you how to achieve ext2 block fragment processing, the content is very detailed, interested friends can refer to, hope to be helpful to you.
0x01 disk fragment 1.1 generated
The data in the mechanical hard disk is scattered in a block. The scene shown below will produce fragments.
1.2 influence
When creating or writing to a file, continuous block needs to be allocated, and the existence of fragments can make it difficult or even impossible to allocate.
When reading the file, the fragment can not be read continuously, the head seek time of the mechanical hard disk increases, and the file read and write slows down.
What does 0x02 do with the fragments?
The algorithm of block allocation is improved to reduce the generation of fragments. This can not fundamentally avoid the generation of fragments.
After fragmentation occurs, fragmentation is carried out, and Windows disks need to be regularly defragmented. That is, move the data blocks of the file to make the remaining block as continuous as possible.
The Design of 0x03 ext2 File system
Ext2 reduces disk fragmentation in the following ways.
The block assigned by block; through block group is all in block group, which reduces the possibility of repeated creation and deletion of files.
When assigning block to each inode, reserve a portion of the block. After the reservation, the re-allocation is likely to be allocated to the block in the reservation window, so that there is no fragmentation.
0x04 ext2 reservation window mechanism
Each inode has an associated node; will it take up a lot of resources? No, because the number of files opened in a file system is limited, and if the user opens a lot of files, it is reasonable to increase consumption.
The reserved window is processed at run time and will not be written to disk
The reserved window is organized using the kernel infrastructure rbtree; the value of the tree is the block number at the beginning and end of the window
Can be extended at run time
Reservation window can span block group
On how to achieve ext2 block fragmentation processing to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.