当前位置:网站首页>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 .
边栏推荐
- Animation curves are used every day. Can you make one by yourself? After reading this article, you will!
- GPON介绍及华为OLT网关注册配置流程
- PE format: analyze and implement IATHOOK
- Automatic assembly and fuse degradation of feign
- 分享|智慧消防应急管理平台解决方案(附PDF)
- 立创EDA——我为什么要学EDA
- 【饭谈】Web3.0到来后,测试人员该何去何从?(十条预言和建议)
- 【饭谈】那些看似为公司着想,实际却很自私的故事 (一:造轮子)
- Solutions to the failure of win key in ikbc keyboard
- 【饭谈】如何设计好一款测试平台?
猜你喜欢

3. Editors (vim)

【leetcode天梯】链表 · 876 查找链表中间结点

【饭谈】那些看似为公司着想,实际却让人无法理解的事(二:面试时的软素质“眼缘”)
![[hand torn STL] unordered_ set、unordered_ Map (encapsulated with hash table)](/img/33/08f7b72ce99e07821a1f4b6e594e13.png)
[hand torn STL] unordered_ set、unordered_ Map (encapsulated with hash table)

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

Pyg tutorial (8): calculate a more efficient sparse matrix form

jenkins+SVN配置

面了个腾讯三年经验的测试员,让我见识到了真正的测试天花板

2022最新软件测试八股文,能不能拿心仪Offer就看你背得怎样了

【leetcode天梯】链表 · 021 合并两个有序链表
随机推荐
Dovecot set mailbox quota
Performance debugging -- chrome performance
Why do independent sellers like to do e-mail marketing? The original conversion rate can be improved so much!
Preliminary study on Tesseract OCR
919. Complete binary tree inserter: simple BFS application problem
Golang: MVC models
手机端微信发朋友圈功能测试点总结
At present, flynk CDC does not support mysql5.5. If you change the source code and release this restriction, there will be a lot of data problems?
Come again
如何用 Redis 实现分布式锁的?
Basic knowledge in the project
Jmeter--- set proxy recording request
新版Maixhub部署(V831与K210)
PE格式: 分析IatHook并实现
立创EDA——器件的创建01-电阻(二)
The second short contact of gamecloud 1608
Summary of function test points of wechat sending circle of friends on mobile terminal
C语言:随机生成数+选择排序
『SignalR』.NET使用 SignalR 进行实时通信初体验
[hand torn STL] unordered_ set、unordered_ Map (encapsulated with hash table)