硬盘驱动器、SSD(SSDs)和其他存储设备需要某种系统来将它们的物理数据存储组织成计算设备可以理解的东西。
分区、卷和逻辑驱动器都是绘制存储设备空间的不同方式的示例。尽管它们的工作相似,但它们之间存在本质区别。
从顶部开始:物理驱动器
计算机将所有数据存储在某种形式的物理介质上——通常是硬盘驱动器 ( HDD ) 或固态驱动器(Solid State Drive)( SSD )。物理存储是您可以触摸的东西,实际数据以某种物理方式表示。光盘上的凹坑和平台代表 1 和 0。在SSD中,这些数据位由保持不同电荷水平的存储单元表示。
卷和分区都是在物理磁盘内和跨物理磁盘的数据结构。您的物理磁盘将完全包含您为大多数家庭用户使用的卷。然而,相反的情况也可能发生,我们在下面的“逻辑卷与物理卷(Volumes)”下进行了解释。
要理解的最重要的事实是,整个物理磁盘可以是单个卷,多个卷可以位于一个物理磁盘上,并且一个卷可以跨越多个物理磁盘。
什么是分区?
描述分区的最简单方法是作为存储设备(如硬盘驱动器)的物理细分。分区在硬盘驱动器上的特定点开始和结束,或者在更高级的多磁盘设置中,它可能是虚拟驱动器的一部分。
把它想象成把一块田地分成几块土地。每块用围栏围起来的土地就像驱动器上的一个分区。
操作系统通常将分区视为单独的物理硬盘驱动器。作为用户,您不会发现在您的计算机中有两个硬盘驱动器与将一个驱动器拆分为两个分区之间有任何实际区别。
什么是卷?
术语“卷”通常与“磁盘”甚至“分区”互换使用,但它们之间存在根本区别。不同的操作系统和计算机文献松散地和互换地使用其中一些术语并没有帮助。混乱是不可避免的,但我们会尽量澄清一些事情。
卷是一个独立的数据单元。它具有卷标(名称)、单个文件系统(例如NTFS或FAT32),并且通常占用整个磁盘或分区。
当您看到您的驱动器(例如 C: 或 D:)时,您看到的是一个卷。因为卷通常是磁盘大小或分区大小的,所以很容易忘记它们不是一回事,而是两个不同的概念。
为了证明这一点,请考虑您可以将卷存储为文件,例如DVD或磁盘映像。然后,您可以将这些映像文件作为卷“挂载”到您的操作系统中,它们的行为和外观就像物理驱动器或格式化的分区一样。
卷和分区区别的另一个典型例子是你不能对软盘进行分区,但它仍然是一个存储卷。没有分区的驱动器也是如此,这只是意味着它有一个恰好使用整个磁盘的分区。没有分区,但它仍然是一个卷。
希望(Hopefully)这能证明卷与驱动器或分区等概念的区别。
逻辑卷与物理卷
既然我们已经确定卷不一定与HDD或分区相同,那么简要讨论“逻辑”卷是个好主意。虽然您可以在一个物理磁盘上拥有多个卷,但在某些情况下,卷的大小会超出单个磁盘的容量。
这就是逻辑卷发挥作用的地方。逻辑卷在用户看来就像一个大的连续存储空间。尽管如此,它在物理上位于单个磁盘上的不同位置,甚至位于跨多个磁盘的位置上。
逻辑驱动器
不要将逻辑卷与逻辑驱动器混淆。如果您将一个物理驱动器划分为多个分区,然后将每个分区格式化为一个卷,每个分区都有其驱动器号,那么这些驱动器就是“逻辑”驱动器。严格来说,所有卷都是合乎逻辑的,因为它们不一定链接到单个或整个物理驱动器。尽管如此,术语“逻辑卷”似乎更常见的是指跨多个驱动器的卷。
所有这一切意味着,从操作系统的角度来看,只有一个驱动器具有一个存储地址集合。逻辑驱动器的后台机制只是确保将数据写入映射到逻辑驱动器存储地址的正确物理位置,而不管可能是哪个物理驱动器。
基本磁盘与动态磁盘
在Windows中,有两种类型的硬盘配置:基本磁盘(Disks)和动态磁盘(Dynamic Disks)。
您的Windows计算机很可能将其驱动器配置为Basic Disk。基本磁盘(Basic Disk)有两种类型。使用主引导记录(Master Boot Record)( MBR ) 的那些可以有四个主分区或三个主分区和一个扩展分区,可以分为许多逻辑分区。使用GUID 分区表(GUID Partition Table)( GPT ) 的(GPT)新(New)计算机可以有 128 个分区,远远超过MBR分区。
要了解有关差异的更多信息,请查看MBR 与 GPT:哪种格式更适合 SSD 驱动器?(MBR vs. GPT: Which Format Is Better for an SSD Drive?).
无论是 MBR(Whether MBR)还是GPT,所有基本磁盘都使用分区表来管理磁盘上的分区。另一方面,动态磁盘使用逻辑磁盘管理器(Logical Disk Manager)( LDM ) 数据库。此数据库保存有关驻留在动态磁盘上的卷的信息,例如它们的大小、它们的开始和结束位置以及它们的文件系统。动态(Dynamic)磁盘也支持GPT和MBR分区,但不止于此。
动态(Dynamic)磁盘允许一些基本磁盘没有的技巧。最重要的是能够创建跨区卷和条带卷。换言之,卷存在于多个物理磁盘上。
跨区(spanned )卷在操作系统中表现为单个卷,但物理数据存在于多个磁盘上。该卷由多个磁盘的多个未分配空间段组成,并且可以扩展。
条带(striped )卷还将多个物理驱动器组合成一个逻辑卷,但数据在所有磁盘上交错,以便可以组合驱动器的读取和写入速度。条带化也称为RAID 0,可为机械硬盘提供最快的速度。这种提速技术与 SSD 不太相关(less relevant for SSDs)。
未分配空间
当您使用分区管理器或其他类似的磁盘实用程序在磁盘上创建或删除卷时,您可能会看到给定物理驱动器的一部分标记为“未分配空间”。
这意味着驱动器上的物理空间当前不属于任何结构。未分配的空间可以位于磁盘的末尾、中间或其他任何地方。如果删除磁盘总空间中间的磁盘分区,则该存储空间区域将变为未分配空间。
如果您看到未分配或可用空间,您可以在该空间中创建一个或多个分区或卷。在某些情况下,您可以扩展相邻分区以包含该未分配空间。
调整分区、卷(Volumes)和逻辑(Logical)驱动器的大小
根据您拥有的分区类型及其所在磁盘的位置,您可以调整分区大小。例如,假设您在一个驱动器上有两个分区,但一个分区空间不足,另一个分区空间充足。您可以缩小一个分区,创建未分配的空间,然后扩展另一个分区。
如何在Windows、Ubuntu Linux和 macOS中检查您的磁盘(Disk)结构
Windows、Linux和 macOS 是三个主要的桌面操作系统,它们都有自己的磁盘或分区管理实用程序。不同的(Different)Linux发行版可能具有看起来不同的管理器,但它们都具有相同的广泛功能。
Windows 磁盘管理
Microsoft Windows 磁盘管理(Microsoft Windows Disk Management)实用程序非常复杂,允许您执行几乎所有与分区、卷等相关的操作。您可以通过多种方式打开它,但最简单的方法是右键单击“开始”按钮(Start Button)并选择“磁盘管理(Disk management)” 。
打开应用程序后,您将看到计算机上的每个磁盘和卷。磁盘管理(Disk Management)应用程序可让您轻松查看计算机上的卷以及它们所在的物理磁盘。您还可以在此处分配驱动器号并诊断磁盘或卷是否未正确安装。磁盘图形还清楚地显示了每个卷使用的分区类型。
Ubuntu Linux 磁盘工具
在Ubuntu Linux中,包含的磁盘管理实用程序简称为Disks。与Windows实用程序一样,它为您提供物理驱动器及其上的卷的清晰可视化细分。
您还可以在此处管理您的卷和分区,但请记住,Linux的默认分区集比(Linux)Windows更复杂。例如,交换分区是Linux用作RAM交换空间的地方,而Windows只是使用现有分区上的 文件。(file)
虽然除非您知道它是安全的,否则您不应该到处删除分区,这在Linux上更是如此。
macOS 磁盘工具
macOS磁盘实用程序(Disk Utility)不像其他操作系统那样忙于处理信息。尽管如此,它仍然提供了您在设置或修改磁盘结构时所需的最关键的功能。
启动磁盘工具(Disk Utility)最简单的方法是使用Spotlight Search。所以按Command + Space然后输入Disk Utility。然后按Enter启动程序。
这将向您显示连接到Mac的所有驱动器,以及这些驱动器的结构。请(Just)记住,如果没有特殊的第三方软件,macOS 无法理解某些文件格式,例如NTFS 。
谨慎使用!
在了解了有关驱动器分区、卷和逻辑驱动器的所有这些信息之后,您还应该注意一件事。弄乱分区和驱动器结构很容易破坏您的数据。使用分区的最安全时间是当您的驱动器仍然是空白时,您执行初始设置。
虽然可以在正在使用的驱动器上创建分区或修改、删除和调整它们的大小,但如果不备份您不愿意丢失的信息,则不应这样做。
What Is the Difference Between a Partition, a Volume, and a Logical Drive?
Hard drives, SSDs, and other storage devices require some sort of system to organize their physical data storage into something a computing device can understand.
Partitions, volumes, and logical drives are all examples of different ways you can map out your storage device real estate. Although they do a similar job, there are essential differences between them.
Start at the Top: Physical Drives
Computers store all data on some form of physical media—usually a hard disk drive (HDD) or Solid State Drive (SSD). Physical storage is something you can touch, and the actual data is represented in some physical way. Pits and lands on an optical disc represent ones and zeroes. In an SSD, those data bits are expressed by memory cells that hold varying charge levels.
Both volumes and partitions are data structures found within and across physical disks. Your physical disk will fully contain the volumes you use for most home users. However, the opposite can also happen, which we’ve explained below under “Logical vs. Physical Volumes.”
The most important facts to understand are that the entirety of a physical disk can be a single volume, that multiple volumes can be on one physical disk, and that one volume can span across multiple physical disks.
What Is a Partition?
The simplest way to describe a partition is as a physical subdivision of a storage device like a hard disk drive. A partition starts and ends at a specific point on the hard drive or in more advanced multi-disk setups it may be a segment of a virtual drive.
Think of it as dividing a field into plots of land. Each fenced-off plot of land is like a partition on a drive.
Operating systems generally treat partitions as if they were separate physical hard drives. As a user, you won’t see any practical difference between having two hard drives in your computer and having one drive split into two partitions.
What Is a Volume?
The term “volume” is often used interchangeably with “disk” and even “partition,” but there’s a fundamental difference between them. It doesn’t help that different operating systems and computer literature use some of these terms loosely and interchangeably. Confusion is inevitable, but we’ll try to clarify things somewhat.
A volume is a self-contained data unit. It has a volume label (name), a single file system (e.g., NTFS or FAT32), and usually takes up an entire disk or partition.
When you see your drives, such as C: or D:, what you’re seeing is a volume. Because volumes are usually disk-sized or partition-sized, it’s easy to forget that they are not one and the same thing, but two distinct concepts.
For evidence of this, consider that you can store a volume as a file, such as a DVD or a disk image. You can then “mount” these image files as volumes in your operating system, and they’ll act and look just like a physical drive or a formatted partition.
Another typical example of the difference between volumes and partitions is that you cannot partition a floppy disk, but it is still a storage volume. The same goes for a drive with no partitions, which just means that it has a single partition that happens to use the entire disk. There are no partitions, but it’s still a volume.
Hopefully, that demonstrates a volume’s distinction from concepts like drive or partition.
Logical vs. Physical Volumes
Now that we’ve established that a volume isn’t necessarily the same as an HDD or partition, it’s a good idea to discuss “logical” volumes briefly. While you can have multiple volumes on one physical disk, there are also situations where the size of a volume exceeds what a single disk can accommodate.
This is where logical volumes come into play. A logical volume looks like a large continuous storage space to the user. Still, physically it is on different locations on a single disk or even on locations that span several disks.
Logical Drives
Don’t confuse a logical volume with a logical drive. If you partition a physical drive into multiple partitions and then format each partition as a volume, each with its drive letter, those drives are “logical” drives. Strictly speaking, all volumes are logical since they are not necessarily linked to a single or entire physical drive. Still, it seems more common for the term “logical volume” to refer to a volume that spans multiple drives.
All this means is that from the operating system’s perspective, there is just one single drive with a single collection of storage addresses. The background mechanisms of the logical drive simply make sure that data is written to the correct physical location mapped to the logical drives storage addresses, regardless of which physical drive that may be.
Basic Disks vs. Dynamic Disks
In Windows, there are two types of hard drive configuration: Basic Disks and Dynamic Disks.
It’s most likely that your Windows computer has its drives configured as Basic Disks. There are two types of Basic Disk. Those that use a Master Boot Record (MBR) can have four primary partitions or three primary partitions and one extended partition, which can be divided into many logical partitions. New computers that use the GUID Partition Table (GPT) can have 128 partitions, far more than an MBR partition.
To learn more about the differences, check out MBR vs. GPT: Which Format Is Better for an SSD Drive?.
Whether MBR or GPT, all basic disks use a partition table to manage the partitions on a disk. On the other hand, dynamic disks use the Logical Disk Manager (LDM) database. This database holds information on the volumes that reside on the dynamic disk, such as their size, where they begin and end, and their file systems. Dynamic disks also support GPT and MBR partitions but go beyond that.
Dynamic disks allow a few tricks that basic disks don’t. The most important one is the ability to create spanned and striped volumes. In other words, volumes exist on more than one physical disk.
A spanned volume presents itself as a single volume to the operating system, but the physical data exists on multiple disks. The volume is built up from multiple segments of unallocated space from multiple disks and can be expanded.
A striped volume also combines multiple physical drives into a single logical volume, but data is interleaved across all disks so that the read and write speeds of the drives can be combined. Striping is also known as RAID 0 and offers the fastest speeds for mechanical hard drives. This speed-boosting technique is less relevant for SSDs.
Unallocated Space
When you use a partition manager or other similar disk utility to create or delete volumes on a disk, you may see a section of a given physical drive marked as “unallocated space.”
This means that the physical space on the drive isn’t currently part of any structure. Unallocated space can be at the end of a disk, in the middle, or anywhere else. If you delete a disk partition in the middle of the disk’s total space, then that storage space region becomes unallocated space.
If you see unallocated or free space, you can create one or more partitions or volumes in that space. In some cases, you can expand an adjacent partition to include that unallocated space.
Resizing Partitions, Volumes, and Logical Drives
Depending on the type of partition you have and where on the disk it’s located, you can resize partitions. For example, let’s say you have two partitions on a drive, but you’re running out of space on one and have plenty of space on the other. You might shrink one partition, creating unallocated space, and then expand the other partition.
How to Check Your Disk Structure in Windows, Ubuntu Linux & macOS
Windows, Linux, and macOS are the three primary desktop operating systems, and all have their own disk or partition management utilities. Different distros of Linux may have managers that look different, but they all have the same broad functionality.
Windows Disk Management
The Microsoft Windows Disk Management utility is quite sophisticated and allows you to do almost all operations related to partitions, volumes, and more. You can open it in various ways, but the easiest is to right-click on the Start Button and select Disk management.
Once you’ve got the app open, you’ll see every disk and volume on your computer. The Disk Management app makes it easy to see which volumes are on your computer and what physical disks they are on. You can also assign drive letters here and diagnose if disks or volumes aren’t mounting correctly. The disk graphics also clearly show what type of partition each volume uses.
Ubuntu Linux Disk Utility
In Ubuntu Linux, the included disk management utility is simply called Disks. Like the Windows utility, it gives you a clear visual breakdown of the physical drives and the volumes that reside on them.
You can also manage your volumes and partitions here, but remember that Linux has a more complicated set of default partitions than Windows. For example, the swap partition is what Linux uses as RAM swap space, whereas Windows simply uses a file on an existing partition.
While it’s always true that you should not go around deleting partitions unless you know it’s safe, that’s doubly true on Linux.
macOS Disk Utility
The macOS Disk Utility isn’t as busy with information as other operating systems. Still, it offers the most critical functions you need when setting up or modifying a disk’s structure.
The easiest way to launch Disk Utility is to use Spotlight Search. So press Command + Space and then type Disk Utility. Then press Enter to launch the program.
This will show you all the drives connected to your Mac, as well as the structure of those drives. Just remember that macOS can’t understand certain file formats, such as NTFS, without special third-party software.
Use Caution!
After learning all this information about drive partitions, volumes, and logical drives, there’s one more thing you should be aware of. Messing around with partitions and drive structures can easily destroy your data. The safest time to work with partitions is when your drive is blank anyway, and you perform the initial setup.
While it is possible to create partitions or modify, delete, and resize them on a drive that’s being used, you shouldn’t do it without backing up information that you’re not willing to lose.