无法使用APFS文件系统创建更大的分区


2

我正在尝试使用Boot Camp助手为Windows创建一个100 GB的分区。但是,我无法创建该大小的分区。

尝试sudo diskutil apfs resizeContainer disk0s2 400G FAT32 BOOTCAMP 100G从Terminal 创建一个100 GB FAT32分区(通过命令)会导致以下错误,从自动执行的结果开始fsck_apfs

The volume /dev/disk0s2 appears to be OK
Storage system check exit code is 0
Shrinking APFS Physical Store disk0s2 from 500,068,036,608 to 400,000,000,000 bytes
Shrinking APFS data structures
APFS Container Resize error code is 49187
Error: -69606: A problem occurred while resizing APFS Container structures

return的输出diskutil list返回以下内容:

/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.3 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk1         500.1 GB   disk0s2

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +500.1 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume Main                    282.7 GB   disk1s1
   2:                APFS Volume Preboot                 20.2 MB    disk1s2
   3:                APFS Volume Recovery                519.0 MB   disk1s3
   4:                APFS Volume VM                      12.9 GB    disk1s4

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *64.2 GB    disk2
   1:                 DOS_FAT_32 WININSTALL              64.2 GB    disk2s1

至于diskutil apfs list输出:

APFS Container (1 found)
|
+-- Container disk1 F8CFD798-0C08-45AE-8F6D-FAAC9650F2A2
    ====================================================
    APFS Container Reference:     disk1
    Size (Capacity Ceiling):      500068036608 B (500.1 GB)
    Minimum Size:                 301437767680 B (301.4 GB)
    Capacity In Use By Volumes:   292004704256 B (292.0 GB) (58.4% used)
    Capacity Not Allocated:       208063332352 B (208.1 GB) (41.6% free)
    |
    +-< Physical Store disk0s2 DEE143FB-B604-4F51-9BB7-C358B01D5137
    |   -----------------------------------------------------------
    |   APFS Physical Store Disk:   disk0s2
    |   Size:                       500068036608 B (500.1 GB)
    |
    +-> Volume disk1s1 CFBE30B9-AE09-39D3-9F19-CF4EB5A08611
    |   ---------------------------------------------------
    |   APFS Volume Disk (Role):   disk1s1 (No specific role)
    |   Name:                      Main (Case-insensitive)
    |   Mount Point:               /
    |   Capacity Consumed:         282714124288 B (282.7 GB)
    |   FileVault:                 No
    |
    +-> Volume disk1s2 51246A8F-B84B-401C-9896-5D7CD4F4D621
    |   ---------------------------------------------------
    |   APFS Volume Disk (Role):   disk1s2 (Preboot)
    |   Name:                      Preboot (Case-insensitive)
    |   Mount Point:               Not Mounted
    |   Capacity Consumed:         20156416 B (20.2 MB)
    |   FileVault:                 No
    |
    +-> Volume disk1s3 9F0127AA-3C09-49E0-A3E7-A0487C781E5E
    |   ---------------------------------------------------
    |   APFS Volume Disk (Role):   disk1s3 (Recovery)
    |   Name:                      Recovery (Case-insensitive)
    |   Mount Point:               Not Mounted
    |   Capacity Consumed:         518995968 B (519.0 MB)
    |   FileVault:                 No
    |
    +-> Volume disk1s4 10062AED-5DC0-4764-86A3-8F9745027C51
        ---------------------------------------------------
        APFS Volume Disk (Role):   disk1s4 (VM)
        Name:                      VM (Case-insensitive)
        Mount Point:               /private/var/vm
        Capacity Consumed:         8589983744 B (8.6 GB)
        FileVault:                 No

最后,对于diskutil apfs resizecontainer disk0s2 limits

Resize limits for APFS Physical Store partition disk0s2:
  Current Physical Store partition size on map:   500.1 GB (500068036608 Bytes)
  Minimum (constrained by files/snapshots):       308.7 GB (308658987008 Bytes)
  Recommended minimum (if used with macOS):       319.4 GB (319396405248 Bytes)
  Maximum (constrained by partition map space):   500.1 GB (500068036608 Bytes)

我应该有大约200 GB的可用disk1空间,因此我剩余的空间量应该不是问题。

如的输出所示,FileVault未打开diskutil apfs list

我还禁用了Time Machine,通过tmutil disable,断开了系统偏好设置中的所有备份磁盘,禁用了“自动备份”,并通过删除了所有本地快照tmutil thinlocalsnapshots / 99999999999999。运行不tmutil listlocalsnapshots /返回任何内容,甚至不返回空行。

我已经启动到单用户模式,并且自己运行fsck_apfs -d -l disk0(以及对disk1的相同命令)。它(以及急救)说磁盘没问题。

我已经完全重新安装了macOS。

但是,尽管遇到了所有问题,我仍然可以产生40 GB的分区(通过sudo diskutil apfs resizeContainer disk0s2 460 FAT32 BOOTCAMP 40G):

The volume /dev/disk0s2 appears to be OK
Storage system check exit code is 0
Shrinking APFS Physical Store disk0s2 from 500,068,036,608 to 459,999,997,952 bytes
Shrinking APFS data structures
Shrinking partition
Modifying partition map
4096 bytes per physical sector
/dev/rdisk0s3: 78103872 sectors in 1220373 FAT32 clusters (32768 bytes/cluster)
bps=512 spc=64 res=32 nft=2 mid=0xf8 spt=32 hds=255 hid=898848768 drv=0x80 bsec=78123008 bspf=9536 rdcl=2 infs=1 bkbs=6
Mounting disk
1 new disk created or changed due to APFS operation
Disk from APFS operation: disk0s3
Finished APFS operation

最终这是否是没有足够的可用空间的问题(尽管另有说明)?我可以尝试删除文件以释放另外60 GB的空间,然后查看是否可以创建具有100 GB空间的分区。

希望能解决此问题,避免重新格式化驱动器,但是,如果这是唯一的解决方案,我将接受。

Answers:


1

您输入的命令不正确。以下是您输入的内容。

sudo diskutil apfs resizeContainer disk0s2 400G FAT32 BOOTCAMP 100G

您应该输入的内容如下。

sudo diskutil apfs resizeContainer disk0s2 400G FAT32 BOOTCAMP 0

基本上,应该让命令确定BOOTCAMP分区的大小。

如果BOOTCAMP在完全重新安装macOS之后无法获得100GB的分区,那么在重新安装之前如何创建分区。换句话说,在重新安装macOS之前,输入以下命令破坏所有内容并创建正确的分区。

sudo diskutil partitiondisk disk0 2 gpt apfs Main 400G fat32 BOOTCAMP R

同样,上述命令将确定BOOTCAMP分区的大小。

最后一点:

看来您正在尝试安装没有恢复分区的Windows。如果是这样,恢复文件将放置在BOOTCAMP分区内。这不是通常为EFI引导安装Windows的方式。另外,您还没有分配系统保留分区。虽然,Boot Camp助理也未分配系统保留分区,并且Windows在没有分区的Mac上似乎可以正常运行。


很好的分析。该OP确实具有非标准布局,这显然会引起很多问题。在细节询问,Vangekis和答案David方面都做得很好。
bmike
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.