[Note:This question is dissimilar to the other ones like this since my Bootcamp partition does not show up on listing the drives in terminal.]
I added my bootcamp partition to parrallels desktop. I removed the VM and opted to keep the files.
Naively, I ran the following commands.
diskutil list diskutil eraseVolume jhfs+ BC1 disk0s3 diskutil eraseVolume fat32 BOOTCAMP disk0s3
I then set out to restore my HD using Boot Camp Assistant. It said that there was an error so I ran First Aid on my completely empty Bootcamp partition. After clicking done to continue,the partition VANISHED.
So I was left with 100 gb space missing. Here is my output when I list all the drives:
#: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme 251.0 GB disk0 1: EFI EFI 314.6 MB disk0s1 2: Apple_APFS Container disk1 150.0 GB disk0s2 /dev/disk1 (synthesized): #: TYPE NAME SIZE IDENTIFIER 0: APFS Container Scheme - +150.0 GB disk1 Physical Store disk0s2 1: APFS Volume Macintosh HD 95.7 GB disk1s1 2: APFS Volume Preboot 56.0 MB disk1s2 3: APFS Volume Recovery 512.4 MB disk1s3 4: APFS Volume VM 2.1 GB disk1s4
Also the following command ,
diskutil cs list
..returns the following:
No CoreStorage logical volume groups found
But on the Apple forums, I saw that they should return output.
Also I was repeatedly getting this error in any attempt I made in restoring my drives.Something to do with my "object map".
error: btn: invalid btn_btree.bt_key_count (expected 152418, actual 152419)
Is there a way I could perhaps make another partition taking up the remaining space and merge it with my main HD? Any help would be appreciated!!
Edit: After executing the command
sudo diskutil apfs resizeContainer disk0s2 0
....this is what I got back:
Started APFS operation Aligning grow delta to 100,684,705,792 bytes and targeting a new physical store size of 250,685,575,168 bytes Determined the maximum size for the targeted physical store of this APFS Container to be 250,684,547,072 bytes Resizing APFS Container designated by APFS Container Reference disk1 The specific APFS Physical Store being resized is disk0s2 Verifying storage system Using live mode Performing fsck_apfs -n -x -l -S /dev/disk0s2 Checking the container superblock Checking the EFI jumpstart record Checking the space manager Checking the space manager free queue trees Checking the object map Checking volume Checking the APFS volume superblock The volume Macintosh HD was formatted by hfs_convert (748.1.47) and last modified by apfs_kext (945.200.129)
This did not work, but I can remember reformatting the Boot Camp partition to Mac OS Journaled before I sought to restore the drive.
It was something wrong with the B tree node (no idea what that is)!?? So I went into self mode by Cmd-S when restarting.
Then type in the commands:
In my case it pointed out what went wrong and then I typed in YES.
So there where a bunch of y's being printed on the screen.I am assuming it was doing some check of some sort.It ran for well over an hour.I press the power button (dont reccomend doing so,but then again it worked for me) and restarted into Mojave.
And voila I removed the "Free space " using disk utlity and it worked like a charm!