与普通硬盘比较,拥有以下优点:
1. 启动快,没有电机加速旋转的过程。
2. 不用磁头,快速随机读取,读延迟极小。根据相关测试:两台电脑在同样配置的电脑下,搭载固态硬盘的笔记本从开机到出现桌面一共只用了18秒,而搭载传统硬盘的笔记本总共用了31秒,两者几乎有将近一半的差距。
3. 相对固定的读取时间。由于寻址时间与数据存储位置无关,因此磁盘碎片不会影响读取时间。
4. 基于DRAM的固态硬盘写入速度极快。
5. 无噪音。因为没有机械马达和风扇,工作时噪音值为0分贝。某些高端或大容量产品装有风扇,因此仍会产生噪音。
6. 低容量的基于闪存的固态硬盘在工作状态下能耗和发热量较低,但高端或大容量产品能耗会较高。
7. 内部不存在任何机械活动部件,不会发生机械故障,也不怕碰撞、冲击、振动。这样即使在高速移动甚至伴随翻转倾斜的情况下也不会影响到正常使用,而且在笔记本电脑发生意外掉落或与硬物碰撞时能够将数据丢失的可能性降到最小。
8. 工作温度范围更大。典型的硬盘驱动器只能在5到55摄氏度范围内工作。而大多数固态硬盘可在-10~70摄氏度工作,一些工业级的固态硬盘还可在-40~85摄氏度,甚至更大的温度范围下工作。
9. 低容量的固态硬盘比同容量硬盘体积小、重量轻。但这一优势随容量增大而逐渐减弱。直至256GB,固态硬盘仍比相同容量的普通硬盘轻。
固态硬盘与传统硬盘比较,拥有以下缺点:
1. 成本高。每单位容量价格是传统硬盘的5~10倍(基于闪存),甚至200~300倍(基于DRAM)。
2. 容量低。目前固态硬盘最大容量远低于传统硬盘。固态硬盘的容量仍在迅速增长,据称IBM已测试过4TB的固态硬盘。
3. 由于不像传统硬盘那样屏蔽于法拉第笼中,固态硬盘更易受到某些外界因素的不良影响。如断电(基于DRAM的固态硬盘尤甚)、磁场干扰、静电等。
4. 写入寿命有限(基于闪存)。一般闪存写入寿命为1万到10万次,特制的可达100万到500万次,然而整台计算机寿命期内文件系统的某些部分(如文件分配表)的写入次数仍将超过这一极限。特制的文件系统或者固件可以分担写入的位置,使固态硬盘的整体寿命达到20年以上。
5. 基于闪存的固态硬盘在写入时比传统硬盘慢很多,也更易受到写入碎片的影响。
6. 数据损坏后难以的恢复。传统的磁盘或者磁带存储方式,如果硬件发生损坏,通过目前的数据恢复技术也许还能挽救一部分数据。但如果固态硬盘发生损坏,几乎不可能通过目前的数据恢复技术在失效(尤其是基于DRAM的)、破碎或者被击穿的芯片中找回数据。
7. 根据实际测试,使用固态硬盘的笔记本电脑在空闲或低负荷运行下,电池航程短于使用5400RPM的2.5英寸传统硬盘。
8. 基于DRAM的固态硬盘在任何时候的能耗都高于传统硬盘,尤其是关闭时仍需供电,否则数据丢失。
9. 据用户反映,使用低廉的MLC的固态硬盘在Windows操作系统下运行比传统硬盘慢。这是由于Windows操作系统的文件系统机制不适于固态硬盘。在Linux下无此问题。
本文来自: 电脑知识大全() 详细出处参考:
Ⅱ 硬盘是怎么来存储数据的
硬盘不是直接存储我们现在人看到的数据,计算机中,通过2进制,将数据转化为可以用2进制表示的数字数据,再对应机器的高电平低电平等可以用两种机器物理状态的状态。
硬盘储存数据的原理和盒式磁带类似,只不过盒式磁带上存储是模拟格式的音乐,而硬盘上存储的是数字格式的数据。写入时,磁头线圈上加电,在周围产生磁场,磁化其下的磁性材料;电流的方向不同,所以磁场的方向也不同,可以表示 0 和 1 的区别。
读取时,磁头线圈切割磁场线产生感应电流,磁性材料的磁场方向不同,所以产生的感应电流方向也不同。
(2)硬盘怎么存储字节扩展阅读
硬盘使用注意事项:
1、在工作时不能突然关机。
硬盘当硬盘开始工作时,一般都处于高速旋转之中,如果我们中途突然关闭电源,可能会导致磁头与盘片猛烈磨擦而损坏硬盘,因此要避免突然关机。关机时一定要注意面板上的硬盘指示灯是否还在闪烁,只有在其指示灯停止闪烁、硬盘读写结束后方可关闭计算机的电源开关。
2、防止灰尘进入。
灰尘对硬盘的损害是非常大的,这是因为在灰尘严重的环境下,硬盘很容易吸引空气中的灰尘颗粒,使其长期积累在硬盘的内部电路元器件上,会影响电子元器件的热量散发,使得电路元器件的温度上升,产生漏电或烧坏元件。
3、要防止温度过高或过低。
温度对硬盘的寿命也是有影响的。硬盘工作时会产生一定热量,使用中存在散热问题。温度以20~25℃为宜,过高或过低都会使晶体振荡器的时钟主频发生改变。温度还会造成硬盘电路元器件失灵,磁介质也会因热胀效应而造成记录错误。
Ⅲ 硬盘与U盘存储数据的通俗原理
U盘是以Flash Memory 作为存储单元,是一种可擦写的内存,其载体是半导体芯片。普通的内存是一种RAM,断电后即丢失所有数据,而Flash Memory 则必须通过加电才能改变数据,所以可以
长时间保持数据。
传统硬盘实际上就是一个高密度的磁盘,是在一块硬质基板上涂覆了磁粉,通过读写磁头产生的磁场改变磁盘上的每一个磁道记录单元内磁体方向的变化进行读写处理。说白了就是一张类似原来的3寸、5寸磁盘,不过是密度、可靠性等大大提高而已。
(3)硬盘怎么存储字节扩展阅读
相对而言传统的机械硬盘由于技术上比较成熟,针对其恢复的技术也比较成熟
1、机械硬盘在删除格式化时并没有对底层数据做清零的操作,只是在某个扇区做了一个标识,在出现逻辑故障时数据恢复的成功率是非常高的,当然前提是没有写入新的数据到这个硬盘或分区上。
2、机械硬盘在出现,硬盘电路板坏,硬盘有坏道,硬盘固件区问题,硬盘磁头损坏,只要没有伤到或只是轻微划伤硬盘的存储盘片,那么数据恢复的成功率是可以达到90%以上。
Ⅳ 硬盘是怎么来存储数据的
硬盘储存数据的原理和盒式磁带类似,只不过盒式磁带上存储是模拟格式的音乐,而硬盘上存储的是数字格式的数据。写入时,磁头线圈上加电,在周围产生磁场,磁化其下的磁性材料;电流的方向不同,所以磁场的方向也不同,可以表示 0 和 1 的区别。
读取时,磁头线圈切割磁场线产生感应电流,磁性材料的磁场方向不同,所以产生的感应电流方向也不同。
光盘和硬盘储存原理不一样,直接比较其储存密度和介质的体积之间的关系没有意义,例如硬盘和光盘都可以在更高的工艺水平和技术下大幅提高自己的储存密度。
简单说来,光储是靠光线传播的差异来储存信息,包括反射光的强度,相位变化等,磁储是靠磁体中磁畴(小磁针)的指向来记录信息的。
Ⅳ 扇区、磁盘块、页。磁盘是如何存储数据的:磁盘的物理结构
扇区,sector
硬盘的读写以扇区为基本单位。磁盘上的每个磁道被等分为若干个弧段,这些弧段称之为扇区。硬盘的物理读写以扇区为基本单位。通常情况下每个扇区的大小是 512 字节。linux 下可以使用 fdisk -l 了解扇区大小:
$ sudo /sbin/fdisk -l
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x7d9f5643
其中 Sector size,就是扇区大小,本例中为 512 bytes。
注意,扇区是磁盘物理层面的概念,操作系统是不直接与扇区交互的,而是与多个连续扇区组成的磁盘块交互。由于扇区是物理层面的概念,所以无法在系统中进行大小的更改。
磁盘块,IO Block
文件系统读写数据的最小单位,也叫磁盘簇。扇区是磁盘最小的物理存储单元,操作系统将相邻的扇区组合在一起,形成一个块,对块进行管理。每个磁盘块可以包括 2、4、8、16、32 或 64 个扇区。磁盘块是操作系统所使用的逻辑概念,而非磁盘的物理概念。磁盘块的大小可以通过命令 stat /boot 来查看:
$ sudo stat /boot
File: /boot
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 801h/2049d Inode: 655361 Links: 3
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2019-07-06 20:19:45.487160301 +0800
Modify: 2019-07-06 20:19:44.835160301 +0800
Change: 2019-07-06 20:19:44.835160301 +0800
Birth: -
其中 IO Block 就是磁盘块大小,本例中是 4096 Bytes,一般也是 4K。
为了更好地管理磁盘空间和更高效地从硬盘读取数据,操作系统规定一个磁盘块中只能放置一个文件,因此文件所占用的空间,只能是磁盘块的整数倍,那就意味着会出现文件的实际大小,会小于其所占用的磁盘空间的情况。
test2.txt是一个只包含一个字母的文本文档。它的理论大小是一个字节,但是由于系统的磁盘块大小是4KB(文件的最小存储大小单位),所以test2.txt占据的磁盘实际空间是4KB
操作系统不能对磁盘扇区直接寻址操写,主要原因是扇区数量庞大,因此才将多个连续扇区组合一起操作。磁盘块的大小是可以通过blockdev命令更改的。
页,page
内存的最小存储单位。页的大小通常为磁盘块大小的 2^n 倍,可以通过命令 getconf PAGE_SIZE 来获取页的大小:
$sudo getconf PAGE_SIZE
4096
本例中为 4096 Bytes,与磁盘块大小一致。
总结两个逻辑单位:
页,内存操作的基本单位
磁盘块,磁盘操作的基本单位
命令索引
扇区大小,fdisk -l
磁盘块大小,stat /boot
内存页大小,getconf PAGE_SIZE
硬盘是如何存储数据的:硬盘的物理结构
提示:硬盘分为机械硬盘和固态硬盘这2种。这里只讲解机械硬盘,固态硬盘的存储另当别论。
要想知道硬盘是如何存储数据的,就先明白硬盘的物理结构。
1、名称机械硬盘,由于信息载体为磁性物质,故又称磁盘。 2、硬盘主要结构在硬盘盒里面其实是由许许多多的圆形盘片、机械手臂、磁头与主轴马达所组成的。 3、工作情形实际的数据都是写在具有磁性物质的盘片上,而读写主要是通过在机械手臂上的磁头(head)来达成。实际运行时, 主轴马达让盘片转动,然后机械手臂可伸展让磁头在盘片上头进行读写的动作。
4、各主要部件说明(1)盘片和主马达主马达就是一个小电机,作用是让盘片转动起来。通常数据写入当然就是以圆圈转圈的方式读写啰!
对于机械硬盘,最重要的结构是这些两面涂有磁性材料的盘片,在工作时会以每分钟7200转的速度旋转。盘片的作用是记录数据,在盘片上有序的排列了很多的小颗粒材料,它们都是磁性物质,可以被永久磁化和改变磁极,这两个磁极就分别表示了计算机二进制中的0和1。由于盘片是转动后读写数据的,所以,当初设计就是在类似盘片同心圆上面切出一个一个的小区块,这些小区块整合成一个圆形,让机器手臂上的磁头去存取。这个小区块就是磁盘的最小物理储存单位,称之为扇区 (sector),那同一个同心圆的扇区组合成的圆就是所谓的磁道(track)。 扇区容量:原本硬盘的扇区都是设计成 512Byte(即0.5KB) 的容量,但因为近期以来硬盘的容量越来越大,为了减少数据量的拆解,所以新的大容量硬盘已经有 4KByte(即4KB)的扇区设计! 由于单一盘片的容量有限,因此有的硬盘内部会有两个以上的盘片喔!由于磁盘里面可能会有多个盘片,因此在所有盘片上面的同一个磁道可以组合成所谓的柱面 (cylinder)。 数据存储在盘片上的一个个扇区中。
1)1个扇区(磁道)可存储512Bytes的数据量;
2)一个平面中同一半径下的多个扇区共同组成了1个磁道;
3)一个盘片有2个盘面,每个盘面都对应一个磁头,负责读写数据;
4)一个硬盘可以有多个盘片;
5)同一半径下的多个磁道共同组成了1个柱面。
(2)磁头和机械手臂机械手臂的作用是控制来回磁头移动。磁头的作用是在盘片上读写数据。磁头通过改变盘片上小颗粒磁性物质的磁极方向来完成写入数据的功能,通过感知盘片上磁性物质的磁极方向来完成读取数据的功能。
5、扇区中是如何表示01数据的?
硬盘是在硬质盘片(一般是铝合金,以前 IBM 也尝试过使用玻璃)上涂敷薄薄的一层铁磁性材料。这些磁粉被划分成称为磁道的若干个同心圆,在每个同心圆的磁道上就好像有无数的任 意排列的小磁铁,它们分别代表着0和1的状态。当这些小磁铁受到来自磁头的磁力影响时,其排列的方向会随之改变。利用磁头的磁力控制指定的一些小磁铁方 向,使每个小磁铁都可以用来储存信息。写入时,磁头线圈上加电,在周围产生磁场,磁化其下的磁性材料;电流的方向不同,所以磁场的方向也不同,可以表示 0 和 1 的区别。读取时,磁头线圈切割磁场线产生感应电流,磁性材料的磁场方向不同,所以产生的感应电流方向也不同。
================================优美的分割线===================================
延伸:固态硬盘的存储原理(微观)
接下来来讲固态硬盘,相比较于机械硬盘里面的各种机械结构,固态硬盘就没有太多的机械机构;它主要是靠FLASH芯片来作为储存数据的介质;由主控芯片来承担数据的中转,还有调配数据储存在闪存芯片上面
FLASH芯片储存数据的方式也不是太难理解,就是FLASH芯片里面分出了很多储存单元,这些储存单元里面有电子的位置;当一颗电子的位置里面没有存放电子,它就是0;如果存放了电子,它就是1 参考:
https://zhuanlan.hu.com/p/117375905 https://www.cnblogs.com/andy9468/p/11091115.html
Ⅵ 2020-12-02 硬盘如何存储文件
系统中所有内容是以文件(文件夹是特殊的文件)存在的,而文件分为属性(元信息)和内容两部分,磁盘一部分被操作系统虚拟为块用来存储数据,同时也分出一部分虚拟为Inode用来存储文件属性,这样磁盘就分为块区和inode区。
扇区:磁盘存储数据的最小物理单元,每个扇区很小512字节左右。
读取数据:OS要想读取磁盘数据,首先让磁头径向寻道(最慢),然后旋转磁盘(较快),使磁头到达目标扇区,开始读取数据。
磁盘块:OS日常工作中,一个扇区的512字节数据很小,不足以支撑绝大部分工作场景,所以需要频繁读取单个扇区,而磁盘读取数据速度相对CPU处理太慢了,所以读磁盘时一次就多拿出几个扇区(临近的,无需耗费额外时间)的数据,于是在OS层面逻辑虚拟出磁盘块(簇)的概念,一个磁盘块一般对应8个连续扇区(也可4、16个等,由OS决定),这样OS层面就使用磁盘块作为最小数据存储单元。
这样的好处当然是更高效,缺点则是会?
inode:用于存储文件的元信息(除名称外的所有属性,名称存在文件夹的内容中)
Inode number is also known as index number. An inode is a unique number assigned to files and directories while it is created. The inode number will be unique to entire filesystem.
Disk inodes contain the following information:
Owner identifier
Type of file (regular, directory, character or block device)
Access permissions
Times and dates
· file creation time
· last file access time
· last inode modification time
Number of links to the file
Array of pointers to data blocks on disk
File size (in bytes, sometimes also in blocks)
文件:
上文提及文件属性存在磁盘inode区的inode(每个都有编号)内,而内容存储在块区的块中。
文件夹:
作为特殊文件,其组织文件及目录,属性也是存在inode内,而存储的内容是一个包含多个{ 文件名:对应inode Id} 的列表,内容亦存在块区的块中。
这样在OS中查看一个文件(比如/etc/fstab)的内容,大概是:
首先OS获取到根目录的inodeId >在inode区中读取到其属性(某项是内容所在块)>在块区读取到根目录内容>在内容中找到名为/etc对应发inodeId>/etc在inode区的属性>读取到块中/etc的内容(包含/etc/fstab对应inodeId)>/etc/fstab Inode Id > 在inode区读取到/etc/fstab属性 >/etc/fstab块。
可能有误,望指点。
Within each file system, the mapping from names to blocks is handled through a structure called an i-node. There's a pool of these things near the "bottom" (lowest-numbered blocks) of each file system (the very lowest ones are used for housekeeping and labeling purposes we won't describe here). Each i-node describes one file. File data blocks (including directories) live above the i-nodes (in higher-numbered blocks).
Every i-node contains a list of the disk block numbers in the file it describes. (Actually this is a half-truth, only correct for small files, but the rest of the details aren't important here.) Note that the i-node does not contain the name of the file.
Names of files live in directory structures. A directory structure just maps names to i-node numbers. This is why, in Unix, a file can have multiple true names (or hard links); they're just multiple directory entries that happen to point to the same i-node.
refer: https://unix.stackexchange.com/questions/432655/why-does-using-indirect-pointers-in-inodes-not-incur-the-same-amount-of-space
less:by direct list blocks in node?.
large :by two-level indirect block
larger : multi-level indirect block.
The original hierarchy of the inodes levels works roughly like this:
You can store one or a few block numbers directly in the inode. This means you use a few bytes more for the inode, but for small files, you don't have to allocate a complete block, which is mostly empty.
The next level is one indirection: You allocate a block to store the block pointers. Only the address of this indirect block is stored in the inode. This doesn't use somehow "less space", and most filesystems, even early ones, worked like that (have a pointer near the inode/filename which points to a block, which stores the block numbers of the file).
But what do you do when the space in this block runs out? You have to allocate another block, but where do you store the reference to this block? You could just add those references to the inode, but to store largers files, the inode would get large. And you want small inodes, so as many as possible inodes can fit into a single block (less disk access to read more inodes).
So you use a two-level indirect block: You just add one pointer to the inode, then you have a whole block to store pointers to indirect blocks, and the indirect blocks store the block address of the file itself.
And so on, you can add higher-level indirect blocks, or stop at some stage, until you reach the maximal size of a file possible with the structure you want.
So the point is not "use up less space in total", but "use a scheme that uses blocks efficiently for the expected distribution a files wrt. to size, i.e. many small files, some larger files, and very few huge files".
Page tables on the other hand work very differently.
Edit
To answer the questions in the comment:
Data blocks are of fixed sizes (originally 512 bytes, IIRC), which is a multiple of the block size of the underlying harddisks. So data block size can't "decrease".
As I tried to describe above, the whole point of having the inodes not use up too much space is to make inode access faster (or, alternatively, make caching inodes use up less memory - back then when the unix file system with inodes was invented, computers had a lot less memory than today). It's not about somehow saving space in total. As you say yourself, everything has to be stored somewhere, and if it doesn't use up space at location X, it will use up space at location Y.
Just adding a variable number of block pointers to the inode is not practical, because the inode must take up a fixed amount of space - you want to use the inode number to calculate the block address and the offset inside the block where the inode information is stored. You can't do that if every inode has a different size. So there must be some form of indirection.
Page tables work differently because hardware implements them differently - that's just how it is. The hierarchy has a fixed depth, always the same (though sometimes configurable. And while reading a block from disk is slow, that doesn't matter for page tables. So the design issues are completely different.
http://www.cems.uwe.ac.uk/~irjohnso/coursenotes/lrc/internals/filestore/fs3.htm
Assuming, for the purposes of illustration, that each disk data block is 1024 bytes in size, then these ten data block pointers will allow files to be created that are up to 10 Kb in size. As you can see, for the large majority of files it should be possible to access the data with nothing more than a direct lookup required to find the data block that contains any particular data byte.
With this scheme, once a file has grown to 10 Kb, there are only three block pointers in the inode left to use, whatever the eventual size of the file. Obviously, some new arrangement must be found so that the three remaining block pointers will suffice for any realistic file size, while at the same time not degrading the data access time too much.
This goal is achieved by using the idea of indirect block pointers. Specifically, when an 11th data block needs to be allocated to the file, the 11th inode block pointer is used, but instead of pointing to the block which will contain the data, the 11th pointer is a single indirect pointer which points to a data block filled with a list of direct block pointers. In our example, if we assume that a data block number is a 32-bit value, then a list of 256 of them will fit into the single indirect block. This list will point directly to the data blocks for the next 256 Kb of our file. This means that with 11 block pointers in the inode, files of up to 266 Kb (10 + 256) can be created. True, it takes a little longer to access the data beyond the first 10 Kb in the file, but it takes only one extra disk block read to find the position on the disk of the required data.
For files bigger than 266 Kb the double indirect (12th) inode block pointer is used. This is the same idea as the previous inode pointer except that the double indirect pointer points to a list of pointers in a data block, each of which is itself a single indirect block pointer which points to a list of 256 direct block pointers. This means that the 12th inode block pointer gives access to the next 65536 Kb (256x256) of data in our file.
By now, you should be able to spot the pattern and see that when the file grows bigger than 64 Mb (actually 65802 Kb), the inode's 13th data block pointer will be used, but this time as a triple indirect pointer, which will give access to a staggering 16 Gb (256x256x256 Kb) of extra file space. A single file bigger than 16Gb sounds huge. However, even though the calculation we have just done suggests that this file size is possible with the inode layout as given, in fact there are other factors which limit the maximum size of a file to a smaller value than this. For example, the size of a file, in bytes, is stored separately in its inode in a field of type unsigned long. This is a 32-bit number which limits the size of a file to 4 Gb, so that 13 data block pointers in an inode really are enough.
10.4. How a file gets looked up
Now we can look at the file system from the top down. When you open a file (such as, say, /home/esr/WWW/ldp/fundamentals.xml) here is what happens:
Your kernel starts at the root of your Unix file system (in the root partition). It looks for a directory there called ‘home’. Usually ‘home’ is a mount point to a large user partition elsewhere, so it will go there. In the top-level directory structure of that user partition, it will look for a entry called ‘esr’ and extract an i-node number. It will go to that i-node, notice that its associated file data blocks are a directory structure, and look up ‘WWW’. Extracting that i-node, it will go to the corresponding subdirectory and look up ‘ldp’. That will take it to yet another directory i-node. Opening that one, it will find an i-node number for ‘fundamentals.xml’. That i-node is not a directory, but instead holds the list of disk blocks associated with the file.
The surface area of your disk, where it stores data, is divided up something like a dartboard — into circular tracks which are then pie-sliced into sectors. Because tracks near the outer edge have more area than those close to the spindle at the center of the disk, the outer tracks have more sector slices in them than the inner ones. Each sector (or disk block ) has the same size, which under modern Unixes is generally 1 binary K (1024 8-bit bytes). Each disk block has a unique address or disk block number .
Unix divides the disk into disk partitions . Each partition is a continuous span of blocks that's used separately from any other partition, either as a file system or as swap space. The original reasons for partitions had to do with crash recovery in a world of much slower and more error-prone disks; the boundaries between them rece the fraction of your disk likely to become inaccessible or corrupted by a random bad spot on the disk. Nowadays, it's more important that partitions can be declared read-only (preventing an intruder from modifying critical system files) or shared over a network through various means we won't discuss here. The lowest-numbered partition on a disk is often treated specially, as a boot partition where you can put a kernel to be booted.
Each partition is either swap space (used to implement virtual memory ) or a file system used to hold files. Swap-space partitions are just treated as a linear sequence of blocks. File systems, on the other hand, need a way to map file names to sequences of disk blocks. Because files grow, shrink, and change over time, a file's data blocks will not be a linear sequence but may be scattered all over its partition (from wherever the operating system can find a free block when it needs one). This scattering effect is called fragmentation .
Within each file system, the mapping from names to blocks is handled through a structure called an i-node . There's a pool of these things near the "bottom" (lowest-numbered blocks) of each file system (the very lowest ones are used for housekeeping and labeling purposes we won't describe here). Each i-node describes one file. File data blocks (including directories) live above the i-nodes (in higher-numbered blocks).
Every i-node contains a list of the disk block numbers in the file it describes. (Actually this is a half-truth, only correct for small files, but the rest of the details aren't important here.) Note that the i-node does not contain the name of the file.
Names of files live in directory structures . A directory structure just maps names to i-node numbers. This is why, in Unix, a file can have multiple true names (or hard links ); they're just multiple directory entries that happen to point to the same i-node.
In the simplest case, your entire Unix file system lives in just one disk partition. While you'll see this arrangement on some small personal Unix systems, it's unusual. More typical is for it to be spread across several disk partitions, possibly on different physical disks. So, for example, your system may have one small partition where the kernel lives, a slightly larger one where OS utilities live, and a much bigger one where user home directories live.
The only partition you'll have access to immediately after system boot is your root partition , which is (almost always) the one you booted from. It holds the root directory of the file system, the top node from which everything else hangs.
The other partitions in the system have to be attached to this root in order for your entire, multiple-partition file system to be accessible. About midway through the boot process, your Unix will make these non-root partitions accessible. It will mount each one onto a directory on the root partition.
For example, if you have a Unix directory called <tt class="filename">/usr</tt>, it is probably a mount point to a partition that contains many programs installed with your Unix but not required ring initial boot.
Ⅶ 硬盘是怎么存储数据的啊
【硬盘存储数据方式】硬盘是在硬质盘片(一般是铝合金,以前
IBM
也尝试过使用玻璃)上涂敷薄薄的一层铁磁性材料。硬盘储存数据的原理和盒式磁带类似,只不过盒式磁带上存储是模拟格式的音乐,而硬盘上存储的是数字格式的数据。写入时,磁头线圈上加电,在周围产生磁场,磁化其下的磁性材料;电流的方向不同,所以磁场的方向也不同,可以表示
0
和
1
的区别。读取时,磁头线圈切割磁场线产生感应电流,磁性材料的磁场方向不同,所以产生的感应电流方向也不同。
不论是什么计算机文件,歌曲、视频、图片、文档等等,都是以一个二进制的序列存在的,也就是很多个"10010001110011......"这样的东西,硬盘上的存储的文件实际上就是存储着这些0和1的序列。硬盘的磁头能够按照指令读取相应位置的信号,并且能够改变指定位置的磁场方向,这就是数据的读和写。
Ⅷ 磁盘存储容量计算
磁盘空间按照一定的磁盘阵列排布方法,有序且很规则得划分为若干个扇区,然后再把其中的所有存储介质的电离子清除,使之上面不管有无数据,都清零。
在格式化中,要插入一些停顿位,写入一些辅助位,使得格式化后的容量小于格式化前的容量。磁盘格式化后能存储有用信息的总量称为存储容量,其计算公式如下:
存储容量 = n×t×s×b
其中n为保存数据的总盘面数;t为每面磁道数;s为每道的扇区数;b为每个扇区存储的字节数。
(8)硬盘怎么存储字节扩展阅读
磁盘的存储时间包括寻道时间和等待时间。寻道时间(查找时间,seek time)为磁头移动到目标磁道所需要的时间(movable-head disk),对于固定磁头磁盘而言,无需移动磁头,只需选择目标磁道对应的磁头即可。等待时间为等待读写的扇区旋转到磁头下方所用的时间。
一般选用磁道旋转一周所用时间的一半作为平均等待时间。寻道时间由磁盘机的性能决定,目前主流硬盘典型的AST(average seek time)一般在10ms左右,而转速则有2400r/min,5400r/min,7200r/min,等等.软盘转速较慢,一般只有360r/min(因为磁头与盘面接触性读写)。
磁盘的数据传输速率是指磁头找到地址后,单位时间写入或读出的字节数:
R = TB÷T
其中TB为一个磁道上记录的字节数,T为磁盘每转一圈所需的时间,R为数据传输速率。
Ⅸ 硬盘是如何存储信息的
常见的分两种硬盘:机械硬盘,固态硬盘。机械硬盘内部有电机驱动盘片,盘片高速运转,磁头负责在盘片上读写数据。固态硬盘靠电流读写闪存颗粒,类似于你的U盘,但它比U盘速度更快。