当前位置:网站首页>Three ways to allocate disk space
Three ways to allocate disk space
2022-07-25 21:59:00 【Nancy-sn】
at present , Common external memory allocation methods for disks are Continuous distribution 、 Link assignments and Index allocation Three . When using different distribution methods , Different file physical structures will be formed .

1 Continuous distribution
The continuous allocation method requires each file to occupy a continuous set of blocks on the disk , As shown in the figure . The file structure formed in this way is called Sequential file structure , The physical file at this time is called Sequence file . This allocation method ensures that the order of recording in the logical file and the order of disk blocks occupied by the files in the memory are coincident .
2 Link assignments
Link allocation adopts discrete allocation , Eliminate the external debris , Therefore, the utilization rate of disk space is significantly improved ; And because it is based on the current needs of the document , Assign it the necessary disk blocks , When files grow dynamically , It can be reallocated dynamically , Therefore, there is no need to know the size of the file in advance . Besides , The addition of documents 、 Delete 、 It is also very convenient to change .
Link assignment can be divided into implicit link and explicit link .
2.1 Implicit linking
file , Each directory entry in the directory includes pointers to the first disk block and the last disk block of the linked file . Disk blocks are distributed anywhere on the disk , Except for the last disc , Each disk block has a pointer to the next disk block , These pointers are transparent to the user .
2.2 Explicit links
Explicit linking is used to link the pointer of each physical block of the file , Explicitly stored in a linked table in memory . This table only has one set on the whole disk .
3 Index allocation
When opening a file , Just call the number of the disk block number occupied by the file into the memory , There is no need to put the whole FAT Call in memory . So , Put the disk block numbers corresponding to each file together , Index allocation method is an allocation method based on this idea .
3.1 Single level index
It assigns an index table to each file , Record all disk block numbers allocated to the file in the index block , Therefore, the index block is an array containing many disk block numbers . When creating a file , Just fill in the directory entry created for it with a pointer to the index block .
3.2 Multi level index
When the file is too large , Too many index blocks , Single level indexing is inefficient . here , Build another level of index for these index blocks , It is called the first level index , You can also index , It is called the second level index and so on . It is called multi-level index allocation .
3.3 Mixed index allocation
take A combination of multiple index allocation methods And form a distribution mode , Such as direct address , Primary indirect address , Multiple indirect addresses .
边栏推荐
猜你喜欢
![[MAIXPY]kpu: load error:2005, ERR_ READ_ File: read file failed problem solving](/img/0b/da67b5a361a2cdfaf81568d34cf5f7.png)
[MAIXPY]kpu: load error:2005, ERR_ READ_ File: read file failed problem solving

Guiding principles of information security construction

GPON introduction and Huawei OLT gateway registration and configuration process

ORIGYN基金会正式启动$OGY Staking,引领新一轮生态利好

Oxford University: many common insomnia drugs lack long-term safety data

New maixhub deployment (v831 and k210)

Bitcoin.com:usdd represents a truly decentralized stable currency

3. Editors (vim)

如何用 Redis 实现分布式锁的?

Sofa weekly | open source person - Niu Xuewei, QA this week, contributor this week
随机推荐
Tesseract OCR初探
Redisv6.0为何引入多线程?
如何用 Redis 实现分布式锁的?
[MAIXPY]kpu: load error:2005, ERR_ READ_ File: read file failed problem solving
6-18漏洞利用-后门连接
sql语句练习题整理
Simple use of protobuf
c sqlite ... ...
磁盘空间的三种分配方式
Ijcai2022 meeting! Microsoft and other tutorials on domain generalization
手机端微信发朋友圈功能测试点总结
Redis 使用详解
Unity performance optimization direction
[hand tear STL] BitSet (bitmap), bloom filter
Detailed summary of C language game dual cache to solve the flash screen problem [easy to understand]
Animation curves are used every day. Can you make one by yourself? After reading this article, you will!
Origen foundation officially launched $ogy stacking, leading a new round of ecological benefits
Dovecot set mailbox quota
Basic knowledge in the project
ZigBee development board (nxpzigbee Development)