MacOS - 创建连续的分区空间

MacOS - 创建连续的分区空间

我有 80 GB 的可用空间,但磁盘实用程序仅显示大约 14 GB 可用于分区。我的理解是,可以通过对磁盘进行碎片整理来解决此问题。但 MacOS 没有碎片整理工具,并且驱动器是 SSD,因此碎片整理被认为是不好的。

有没有办法无需重新安装整个系统即可创建连续空间?

答案1

您是指在现有分区上添加新分区还是容器文件?如果是前者,您实际上只需要调整现有 HFS 分区的大小,将diskutil resizeVolume数据从磁盘末尾移到其他地方,这样它可能会缩小:

Usage:  diskutil resizeVolume MountPoint|DiskIdentifier|DeviceNode size
        [part1Format part1Name part1Size part2Format part2Name part2Size
         part3Format part3Name part3Size ...]

Non-destructively resize a disk.  You may increase or decrease its size.

When decreasing size, you may optionally specify new partitions to create
to fill the newly-freed space.  Specify these new partitions as in the
diskutil partitionDisk command.  A size of zero will cause a grow fit-to-fill.
Ownership of the affected disk is required.

Valid sizes are floating-point numbers with a suffix of B(ytes), S(512-byte-
blocks), K(ilobytes), M(egabytes), G(igabytes), T(erabytes), P(etabytes),
or (%)percentage of the total size of the whole disk.

A size of "limits" will print the valid range for the current conditions of
the file system and room to grow up to an immovable object (next partition).

A size of "R" for the target partition will resize it to the maximum
possible; "R" cannot be used for the size of new partition triples, if any.

resizeVolume is only supported on a Journaled HFS+ file system.

理论上,您可以使用它将分区压缩到已占用的空间,然后重新扩展它,从而在现有分区中创建一个连续的可用区域,以供容器文件使用(如果您的意思是后者)。

相关内容