代码改变世界

格式化磁盘时数据真的丢失了吗?数据是如何存放的?什么又是碎片整理?

2015-05-07 21:37  星星之火✨🔥  阅读(1136)  评论(0)    收藏  举报

这部分内容是我在哈佛大学公开课CS50中记录的:

格式化磁盘时发生了什么?

What happens when you format a hard drive? To be honest, not very much, and this is one of the reasons that forensic investigators are actually able to do such a good job for the police and FBI or the like because so many computer programs, Mac OS and Windows, they'll say, are you sure you want to do this, this will erase everything from your disk, if you so called format it or partition it. It's another piece of jargon you often hear. That generally is just modifying a few bytes, a few kilobytes worth of information. The end result of whilch is that the computer forgets where all of your files and folders are. But the bits that actually compose those files and folders are in fact exactly where you left them.

比如,一个JPEG图片通常是由几兆字节组成的,所谓的格式化操作不过使我们丢失了最开头的几千个字节,也就是说这些数据的大部分仍然存在于磁盘中,如果你知道如何去发现这些0 和1 的排列规则(PS:该知道一些数据恢复软件为什么收费了吧),你就能恢复这些大量的数据,简而言之,格式化硬盘是为了准备放置新数据,但它没有清除你的旧数据。直到最近,苹果和微软才意识到为了隐私、财物或是其他原因,需要彻底的删除他们的信息。但至今为止,还有一些操作系统,实际上很难做到完全删除。

 

碎片整理:

我们开始对硬盘驱动器进行读写时,你可以保存一个文件到磁盘的某处,接着下一个,再下一个,如此等等,但有时你可能想掉头删除其中的一个文件,现在在你的数据中就有一块空白区域(指的是可以存放其他的数据),现代化的操作系统允许你把文件分块,它们可能分散在磁盘的各个不同的角落里,最终的结果就是你的文件变成了分片的,操作系统根据文件块的地址仍然能找到这一整个文件,这也潜在的导致了速度变慢,在硬件性能如此好的今天,碎片处理显得并不那么重要。

 

一些生词:

forensic: 法院的  investigator: 研究者;调查者;侦查员  partition: 分区
jargon: 行话,术语 kilobytes: 千字节 compose: 组成

(本文完)