当前位置:网站首页>磁盘空间的三种分配方式
磁盘空间的三种分配方式
2022-07-25 21:50:00 【Nancy-sn】
目前,磁盘常用的外存分配方法有连续分配、链接分配和索引分配三种。采用不同的分配方式时,将形成不同的文件物理结构。

1 连续分配
连续分配方法要求每个文件在磁盘上占有一组连续的块,如图所示。这样所形成的文件结构称为顺序文件结构,此时的物理文件称为顺序文件。这种分配方式保证了逻辑文件中的的记录顺序与存储器中的文件占用盘块的顺序是一致的。
2 链接分配
链接分配是釆取离散分配的方式,消除了外部碎片,故而显著地提高了磁盘空间的利用率;又因为是根据文件的当前需求,为它分配必需的盘块,当文件动态增长时,可以动态地再为它分配盘块,故而无需事先知道文件的大小。此外,对文件的增、删、改也非常方便。
链接分配又可以分为隐式链接和显式链接两种形式。
2.1 隐式链接
文件,目录中每个目录项都包括指向链接文件第一盘块和最后一个盘块的指针。磁盘块分布在磁盘的任何地方,除最后一个盘块外,每一个盘块都有指向下一个盘块的指针,这些指针对用户是透明的。
2.2 显式链接
显式链接把用于链接文件各物理块的指针,显式地存放在内存的一张链接表中。该表在整个磁盘仅设置一张。
3 索引分配
在打开某个文件时,只需把该文件占用的盘块号的编号调入内存即可,无需把整个FAT调入内存。为此,将每个文件所对应的盘块号集中地放在一起,索引分配方式就是基于此想法所形成的一种分配方式。
3.1 单级索引
其为每个文件分配一个索引表,再把分配给该文件的所有盘块号都记录在该索引块中,因而该索引块就是一个含有许多磁盘块号的数组。在建立一个文件时,只需要在为之建立的目录项中填上指向该索引块的指针。
3.2 多级索引
当文件太大时,索引块太多,单级索引是低效的。此时,为这些索引块再建立一级索引,称为第一级索引,还可再建立索引,称为第二级索引等等。称为多级索引分配。
3.3 混合索引分配
将多种索引分配方式相结合而形成的一种分配方式,如直接地址,一次间接地址,多次间接地址。
边栏推荐
- 【面试:并发篇23:多线程:join】join再理解
- I'm also drunk. Eureka delayed registration and this pit!
- Create files, file permissions, ownership, and sticky bits
- 【饭谈】细说:下克上,向上管理,向上画饼。
- 新版Maixhub部署(V831与K210)
- 【Redis底层解析】链表类型
- 再次来光顾
- 2022-07-18: what is the output of the following go language code? A:Groutine; B:Main; C:Goroutine; D:GoroutineMain。 package m
- New maixhub deployment (v831 and k210)
- 【leetcode天梯】链表 · 021 合并两个有序链表
猜你喜欢

Jmeter---设置代理录制请求

5、 Pinda general permission system__ PD tools XXS (anti cross site script attack)
![[interview: concurrent 25: multithreading: volatile] visibility](/img/03/6b44242a019775222fdf9c7a920ae5.png)
[interview: concurrent 25: multithreading: volatile] visibility
![[leetcode ladder] linked list · 876 find the middle node of the linked list](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[leetcode ladder] linked list · 876 find the middle node of the linked list

函数栈帧的创建和销毁

【面试:并发篇23:多线程:join】join再理解

CNN structural design skills: taking into account speed accuracy and engineering implementation

Redis 使用详解

Face and key point detection: yolo5face practice
![[hand tear STL] BitSet (bitmap), bloom filter](/img/bc/a6e3c2ccce478460a2742852eee9cf.png)
[hand tear STL] BitSet (bitmap), bloom filter
随机推荐
What are the application characteristics of NTU general database gbase Bi?
2 lines of code to generate a solid desktop background
PE格式: 分析IatHook并实现
[interview: concurrent Article 23: multithreading: Join] re understanding of join
[51Nod1676 无向图同构]无向图哈希[通俗易懂]
Jmeter---设置代理录制请求
全志芯片bsp命名规则
信息安全建设原则指导
CNN structural design skills: taking into account speed accuracy and engineering implementation
Ability to choose
Handwriting distributed configuration center (1)
Collation of SQL statement exercises
Is there any document for synchronizing from Oracle to ODPs?
Detailed explanation of JVM memory model and structure (five model diagrams)
动画曲线天天用,你能自己整一个吗?看完这篇你就会了!
Simple use of protobuf
[MAIXPY]kpu: load error:2005, ERR_ READ_ File: read file failed problem solving
mysql8.0 mha实现高可用《mha》
ansible+Crontab批部署巡检
Vivo official website app full model UI adaptation scheme