macbook删除windows后合并磁盘分区

时间:2024-04-17 08:12:11

由于我直接使用磁盘工具格式化了windows分区,不能合并到主分区

打开终端,列出卷

$ diskutil list
可以看到我给windows卷格式化后是 disk2 90.2G
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: EFI EFI 314.6 MB disk0s1
2: Apple_APFS Container disk1 910.0 GB disk0s2
3: Apple_APFS Container disk2 90.2 GB disk0s3

/dev/disk1 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +910.0 GB disk1
Physical Store disk0s2
1: APFS Volume Macintosh HD - 数据 892.2 GB disk1s1
2: APFS Volume Preboot 287.5 MB disk1s2
3: APFS Volume Recovery 652.6 MB disk1s3
4: APFS Volume VM 1.1 GB disk1s4
5: APFS Volume Macintosh HD 14.9 GB disk1s5
6: APFS Snapshot com.apple.os.update-... 14.9 GB disk1s5s1

/dev/disk2 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +90.2 GB disk2
Physical Store disk0s3



删除卷

$ diskutil apfs deleteContainer disk2

Started APFS operation on disk2
Deleting APFS Container with all of its APFS Volumes
Unmounting Volumes
Deleting Volumes
Deleting Container
Wiping former APFS disks
Switching content types
1 new disk created or changed due to APFS operation
Disk from APFS operation: disk0s3
Finished APFS operation on disk2
Removing disk0s3 from partition map

检查卷
发现多了(free space) 90.2G
$ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: EFI EFI 314.6 MB disk0s1
2: Apple_APFS Container disk1 910.0 GB disk0s2
(free space) 90.2 GB -

/dev/disk1 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +910.0 GB disk1
Physical Store disk0s2
1: APFS Volume Macintosh HD - 数据 892.2 GB disk1s1
2: APFS Volume Preboot 287.5 MB disk1s2
3: APFS Volume Recovery 652.6 MB disk1s3
4: APFS Volume VM 1.1 GB disk1s4
5: APFS Volume Macintosh HD 14.9 GB disk1s5
6: APFS Snapshot com.apple.os.update-... 14.9 GB disk1s5s1

合并分区
再进入磁盘管理,点击mac分区后,你会发现+ 可以点了,点击合并分区后等5分钟左右,中间会卡死一下。