Jump to content

MacOS: Cannot re-allocate free space to main disk

I have a Boot Camp partition that I wanted to make smaller, so I would have more space on my main macOS container. I followed this tutorial, but I'm struggling with the last step. I successfully used the MiniTool Partition wizard to make the Boot Camp partition smaller. The free space is now visible in the macOS Disk Utility:

image.thumb.png.a2f39e844a1060221c0f8939dc1a6d93.png

 

I then used the following commands:

df -h
diskutil apfs list
sudo diskutil apfs resizeContainer disk0s2 0

However when using the "sudo diskutil apfs resizeContainer disk0s2 0" command, I get the following output in Terminal:

 

Started APFS operation
Aligning grow delta to 79.263.285.248 bytes and targeting a new physical store size of 429.316.349.952 bytes
Determined the maximum size for the targeted physical store of this APFS Container to be 429.316.349.952 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 /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 the encryption key structures
Checking volume /dev/rdisk1s1
Checking the APFS volume superblock
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking snapshot 1 of 1 (com.apple.os.update-D296176C9F1447A402795DE19045A404D91C61D21590F8E018EB80C949FBD899)
Checking the fsroot tree
Checking the file extent tree
Checking the extent ref tree
Verifying volume object map space
The volume /dev/rdisk1s1 appears to be OK
Checking volume /dev/rdisk1s2
Checking the APFS volume superblock
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the document ID tree
Checking the fsroot tree
error: refcnt (1) of dstream id object (id 1246626) is less than expected (2)
error: refcnt (1) of dstream id object (id 1247707) is less than expected (2)
error: refcnt (1) of dstream id object (id 7540510) is less than expected (2)
error: refcnt (1) of dstream id object (id 8451233) is less than expected (2)
error: refcnt (1) of dstream id object (id 9838001) is less than expected (2)
error: dstream (id 120785108) does not have an associated dstream id object
error: alloced_size (1613824) of dstream (id 120785108) does not match calculated size (0)
Checking the extent ref tree
Verifying volume object map space
The volume /dev/rdisk1s2 was found to be corrupt and needs to be repaired
Checking volume /dev/rdisk1s3
Checking the APFS volume superblock
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the fsroot tree
Checking the extent ref tree
Verifying volume object map space
The volume /dev/rdisk1s3 appears to be OK
Checking volume /dev/rdisk1s4
Checking the APFS volume superblock
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the fsroot tree
Checking the extent ref tree
Verifying volume object map space
The volume /dev/rdisk1s4 appears to be OK
Checking volume /dev/rdisk1s5
Checking the APFS volume superblock
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the fsroot tree
Checking the extent ref tree
Verifying volume object map space
The volume /dev/rdisk1s5 appears to be OK
Checking volume /dev/rdisk1s6
Checking the APFS volume superblock
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the fsroot tree
Checking the extent ref tree
Verifying volume object map space
The volume /dev/rdisk1s6 appears to be OK
Verifying allocated space
Performing deferred repairs
error: refcnt of dstream id object (id 1246626) less than expected
Skipped 5/5 repairs of this type in total
error: dstream (id 120785108) does not have an associated dstream id object
Skipped 2/2 repairs of this type in total
Deferred repairs skipped
The container /dev/disk0s2 could not be verified completely
Storage system check exit code is 8
Error: -69716: Storage system verify or repair failed

Can someone help me?

I would prefer not reformatting / erasing my entire drive.
Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, zoodje said:

I have a Boot Camp partition that I wanted to make smaller, so I would have more space on my main macOS container. I followed this tutorial, but I'm struggling with the last step. I successfully used the MiniTool Partition wizard to make the Boot Camp partition smaller. The free space is now visible in the macOS Disk Utility:

image.thumb.png.a2f39e844a1060221c0f8939dc1a6d93.png

 

I then used the following commands:

df -h
diskutil apfs list
sudo diskutil apfs resizeContainer disk0s2 0

However when using the "sudo diskutil apfs resizeContainer disk0s2 0" command, I get the following output in Terminal:

 

Started APFS operation
Aligning grow delta to 79.263.285.248 bytes and targeting a new physical store size of 429.316.349.952 bytes
Determined the maximum size for the targeted physical store of this APFS Container to be 429.316.349.952 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 /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 the encryption key structures
Checking volume /dev/rdisk1s1
Checking the APFS volume superblock
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking snapshot 1 of 1 (com.apple.os.update-D296176C9F1447A402795DE19045A404D91C61D21590F8E018EB80C949FBD899)
Checking the fsroot tree
Checking the file extent tree
Checking the extent ref tree
Verifying volume object map space
The volume /dev/rdisk1s1 appears to be OK
Checking volume /dev/rdisk1s2
Checking the APFS volume superblock
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the document ID tree
Checking the fsroot tree
error: refcnt (1) of dstream id object (id 1246626) is less than expected (2)
error: refcnt (1) of dstream id object (id 1247707) is less than expected (2)
error: refcnt (1) of dstream id object (id 7540510) is less than expected (2)
error: refcnt (1) of dstream id object (id 8451233) is less than expected (2)
error: refcnt (1) of dstream id object (id 9838001) is less than expected (2)
error: dstream (id 120785108) does not have an associated dstream id object
error: alloced_size (1613824) of dstream (id 120785108) does not match calculated size (0)
Checking the extent ref tree
Verifying volume object map space
The volume /dev/rdisk1s2 was found to be corrupt and needs to be repaired
Checking volume /dev/rdisk1s3
Checking the APFS volume superblock
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the fsroot tree
Checking the extent ref tree
Verifying volume object map space
The volume /dev/rdisk1s3 appears to be OK
Checking volume /dev/rdisk1s4
Checking the APFS volume superblock
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the fsroot tree
Checking the extent ref tree
Verifying volume object map space
The volume /dev/rdisk1s4 appears to be OK
Checking volume /dev/rdisk1s5
Checking the APFS volume superblock
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the fsroot tree
Checking the extent ref tree
Verifying volume object map space
The volume /dev/rdisk1s5 appears to be OK
Checking volume /dev/rdisk1s6
Checking the APFS volume superblock
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the fsroot tree
Checking the extent ref tree
Verifying volume object map space
The volume /dev/rdisk1s6 appears to be OK
Verifying allocated space
Performing deferred repairs
error: refcnt of dstream id object (id 1246626) less than expected
Skipped 5/5 repairs of this type in total
error: dstream (id 120785108) does not have an associated dstream id object
Skipped 2/2 repairs of this type in total
Deferred repairs skipped
The container /dev/disk0s2 could not be verified completely
Storage system check exit code is 8
Error: -69716: Storage system verify or repair failed

Can someone help me?

I would prefer not reformatting / erasing my entire drive.

Looks like you need to run repairs on the .2 volume which usually means locking out sections of it which will make it smaller so sizes will have to change (though not very much.  If that is a mechanical HDD I personally find that where one disk errors exist, more will come up soon.  That drive may be slowly dying.

Not a pro, not even very good.  I’m just old and have time currently.  Assuming I know a lot about computers can be a mistake.

 

Life is like a bowl of chocolates: there are all these little crinkly paper cups everywhere.

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, zoodje said:

I have a Boot Camp partition that I wanted to make smaller, so I would have more space on my main macOS container. I followed this tutorial, but I'm struggling with the last step. I successfully used the MiniTool Partition wizard to make the Boot Camp partition smaller. The free space is now visible in the macOS Disk Utility:

image.thumb.png.a2f39e844a1060221c0f8939dc1a6d93.png

 

I then used the following commands:

df -h
diskutil apfs list
sudo diskutil apfs resizeContainer disk0s2 0

However when using the "sudo diskutil apfs resizeContainer disk0s2 0" command, I get the following output in Terminal:

 

Started APFS operation
Aligning grow delta to 79.263.285.248 bytes and targeting a new physical store size of 429.316.349.952 bytes
Determined the maximum size for the targeted physical store of this APFS Container to be 429.316.349.952 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 /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 the encryption key structures
Checking volume /dev/rdisk1s1
Checking the APFS volume superblock
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking snapshot 1 of 1 (com.apple.os.update-D296176C9F1447A402795DE19045A404D91C61D21590F8E018EB80C949FBD899)
Checking the fsroot tree
Checking the file extent tree
Checking the extent ref tree
Verifying volume object map space
The volume /dev/rdisk1s1 appears to be OK
Checking volume /dev/rdisk1s2
Checking the APFS volume superblock
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the document ID tree
Checking the fsroot tree
error: refcnt (1) of dstream id object (id 1246626) is less than expected (2)
error: refcnt (1) of dstream id object (id 1247707) is less than expected (2)
error: refcnt (1) of dstream id object (id 7540510) is less than expected (2)
error: refcnt (1) of dstream id object (id 8451233) is less than expected (2)
error: refcnt (1) of dstream id object (id 9838001) is less than expected (2)
error: dstream (id 120785108) does not have an associated dstream id object
error: alloced_size (1613824) of dstream (id 120785108) does not match calculated size (0)
Checking the extent ref tree
Verifying volume object map space
The volume /dev/rdisk1s2 was found to be corrupt and needs to be repaired
Checking volume /dev/rdisk1s3
Checking the APFS volume superblock
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the fsroot tree
Checking the extent ref tree
Verifying volume object map space
The volume /dev/rdisk1s3 appears to be OK
Checking volume /dev/rdisk1s4
Checking the APFS volume superblock
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the fsroot tree
Checking the extent ref tree
Verifying volume object map space
The volume /dev/rdisk1s4 appears to be OK
Checking volume /dev/rdisk1s5
Checking the APFS volume superblock
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the fsroot tree
Checking the extent ref tree
Verifying volume object map space
The volume /dev/rdisk1s5 appears to be OK
Checking volume /dev/rdisk1s6
Checking the APFS volume superblock
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the fsroot tree
Checking the extent ref tree
Verifying volume object map space
The volume /dev/rdisk1s6 appears to be OK
Verifying allocated space
Performing deferred repairs
error: refcnt of dstream id object (id 1246626) less than expected
Skipped 5/5 repairs of this type in total
error: dstream (id 120785108) does not have an associated dstream id object
Skipped 2/2 repairs of this type in total
Deferred repairs skipped
The container /dev/disk0s2 could not be verified completely
Storage system check exit code is 8
Error: -69716: Storage system verify or repair failed

Can someone help me?

I would prefer not reformatting / erasing my entire drive.

 

1 hour ago, Bombastinator said:

Looks like you need to run repairs on the .2 volume which usually means locking out sections of it which will make it smaller so sizes will have to change (though not very much.  If that is a mechanical HDD I personally find that where one disk errors exist, more will come up soon.  That drive may be slowly dying.

hi, unfortunately I haven't a mac from a couple of years. I don't think that the disk don’t works. Perhaps TimeMachine was running and it compromised the diskutil process in progress ... In any case I suggest to you to save all your files and to perform a clean installation of mac os from the osx base system or recovery (the commands to run osx base system or recovery depend on the processor in use - Intel or Apple silicon). In osx base system or recovery you can use the disk utility tool in order to manage the disk and its partitions.

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, Bombastinator said:

Looks like you need to run repairs on the .2 volume which usually means locking out sections of it which will make it smaller so sizes will have to change (though not very much.  If that is a mechanical HDD I personally find that where one disk errors exist, more will come up soon.  That drive may be slowly dying.

 

2 hours ago, FUIT1985 said:

 

hi, unfortunately I haven't a mac from a couple of years. I don't think that the disk don’t works. Perhaps TimeMachine was running and it compromised the diskutil process in progress ... In any case I suggest to you to save all your files and to perform a clean installation of mac os from the osx base system or recovery (the commands to run osx base system or recovery depend on the processor in use - Intel or Apple silicon). In osx base system or recovery you can use the disk utility tool in order to manage the disk and its partitions.

Hey, thank you for the useful replies 🙂 

 

it's an intel 16 MBP from 2019, it has a 500GB SSD. I don't think that the issue is with the SSD itself, but maybe more so with the free space that MiniTool Partition created. I know that SSD's don't need defragmenting, but maybe if I boot back into Windows and defragment the free space or something it will work again? I would prefer to find a way that doesn't require re-installing, erasing etc. Thank you 🙂

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, zoodje said:

 

Hey, thank you for the useful replies 🙂 

 

it's an intel 16 MBP from 2019, it has a 500GB SSD. I don't think that the issue is with the SSD itself, but maybe more so with the free space that MiniTool Partition created. I know that SSD's don't need defragmenting, but maybe if I boot back into Windows and defragment the free space or something it will work again? I would prefer to find a way that doesn't require re-installing, erasing etc. Thank you 🙂

Save your important files on an external hard drive. Disable time machine, delete time machine snapshots and repeat the diskutil command. If the operation fails and the file system becomes corrupted, reinstall the Mac OS.

Link to comment
Share on other sites

Link to post
Share on other sites

Select your Macintosh HD patition and do an "SOS" (filesystem check/repair. Seems it found a filesystem error and won't continue unless it's fixed first.

F@H
Desktop: i9-13900K, ASUS Z790-E, 64GB DDR5-6000 CL36, RTX3080, 2TB MP600 Pro XT, 2TB SX8200Pro, 2x16TB Ironwolf RAID0, Corsair HX1200, Antec Vortex 360 AIO, Thermaltake Versa H25 TG, Samsung 4K curved 49" TV, 23" secondary, Mountain Everest Max

Mobile SFF rig: i9-9900K, Noctua NH-L9i, Asrock Z390 Phantom ITX-AC, 32GB, GTX1070, 2x1TB SX8200Pro RAID0, 2x5TB 2.5" HDD RAID0, Athena 500W Flex (Noctua fan), Custom 4.7l 3D printed case

 

Asus Zenbook UM325UA, Ryzen 7 5700u, 16GB, 1TB, OLED

 

GPD Win 2

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, zoodje said:

 

Hey, thank you for the useful replies 🙂 

 

it's an intel 16 MBP from 2019, it has a 500GB SSD. I don't think that the issue is with the SSD itself, but maybe more so with the free space that MiniTool Partition created. I know that SSD's don't need defragmenting, but maybe if I boot back into Windows and defragment the free space or something it will work again? I would prefer to find a way that doesn't require re-installing, erasing etc. Thank you 🙂

That’s not impossible.  APFS is an old and weird system created for a reason that no longer exists which implies it was designed before SSDs existed, so it may not talk to SSDs all that well. It’s a problem with basically every filesystem though. An error is still an error.

Not a pro, not even very good.  I’m just old and have time currently.  Assuming I know a lot about computers can be a mistake.

 

Life is like a bowl of chocolates: there are all these little crinkly paper cups everywhere.

Link to comment
Share on other sites

Link to post
Share on other sites

10 minutes ago, Bombastinator said:

 APFS is an old and weird system created for a reason that no longer exists which implies it was designed before SSDs existed, so it may not talk to SSDs all that well.

APFS is 4 years old which is basically brand new for a filesystem.

F@H
Desktop: i9-13900K, ASUS Z790-E, 64GB DDR5-6000 CL36, RTX3080, 2TB MP600 Pro XT, 2TB SX8200Pro, 2x16TB Ironwolf RAID0, Corsair HX1200, Antec Vortex 360 AIO, Thermaltake Versa H25 TG, Samsung 4K curved 49" TV, 23" secondary, Mountain Everest Max

Mobile SFF rig: i9-9900K, Noctua NH-L9i, Asrock Z390 Phantom ITX-AC, 32GB, GTX1070, 2x1TB SX8200Pro RAID0, 2x5TB 2.5" HDD RAID0, Athena 500W Flex (Noctua fan), Custom 4.7l 3D printed case

 

Asus Zenbook UM325UA, Ryzen 7 5700u, 16GB, 1TB, OLED

 

GPD Win 2

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, Kilrah said:

APFS is 4 years old which is basically brand new for a filesystem.

Really?  I thought it was much much older.  My memory of being told it was originally designed for something else may also not be then.  Perhaps the issue is that the thing is a rework of an older thing that was used fo another purpose.  I got the impression there was a lot of “why” attached to APFS and it was mostly a case of “whelp we got it” 

Not a pro, not even very good.  I’m just old and have time currently.  Assuming I know a lot about computers can be a mistake.

 

Life is like a bowl of chocolates: there are all these little crinkly paper cups everywhere.

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, Bombastinator said:

That’s not impossible.  APFS is an old and weird system created for a reason that no longer exists which implies it was designed before SSDs existed, so it may not talk to SSDs all that well. It’s a problem with basically every filesystem though. An error is still an error.

You might be talking about HFS+

APFS was specifically optimised for SSDs

"A high ideal missed by a little, is far better than low ideal that is achievable, yet far less effective"

 

If you think I'm wrong, correct me. If I've offended you in some way tell me what it is and how I can correct it. I want to learn, and along the way one can make mistakes; Being wrong helps you learn what's right.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, J-from-Nucleon said:

You might be talking about HFS+

APFS was specifically optimised for SSDs

HFS+ was an extension of hfs which was mostly for hard drives but basically pretty generic.  That conflicts pretty directly with the source i have, who is a pretty knowledgable dude, he’s human though and any human can be wrong.  One of you is right and the other one isn’t, unless both are wrong or I misunderstood what he was saying, which is also possible.  Dude is a long time Mac user and might just not like APFS so he spoke badly of it.  I don’t know.  I’ll ask him about it next I see him.

Edited by Bombastinator

Not a pro, not even very good.  I’m just old and have time currently.  Assuming I know a lot about computers can be a mistake.

 

Life is like a bowl of chocolates: there are all these little crinkly paper cups everywhere.

Link to comment
Share on other sites

Link to post
Share on other sites

The truth really isn't hard to find.

 

https://en.wikipedia.org/wiki/Apple_File_System

F@H
Desktop: i9-13900K, ASUS Z790-E, 64GB DDR5-6000 CL36, RTX3080, 2TB MP600 Pro XT, 2TB SX8200Pro, 2x16TB Ironwolf RAID0, Corsair HX1200, Antec Vortex 360 AIO, Thermaltake Versa H25 TG, Samsung 4K curved 49" TV, 23" secondary, Mountain Everest Max

Mobile SFF rig: i9-9900K, Noctua NH-L9i, Asrock Z390 Phantom ITX-AC, 32GB, GTX1070, 2x1TB SX8200Pro RAID0, 2x5TB 2.5" HDD RAID0, Athena 500W Flex (Noctua fan), Custom 4.7l 3D printed case

 

Asus Zenbook UM325UA, Ryzen 7 5700u, 16GB, 1TB, OLED

 

GPD Win 2

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Kilrah said:

The truth really isn't hard to find.

 

https://en.wikipedia.org/wiki/Apple_File_System

That one implies designed more or less from scratch just prior to 2016.  The impression I got was he was saying it’s actually a rework of another earlier and rather specialized thing and was turned into APFS.  The wiki page doesn’t treat that one way or another. 

Not a pro, not even very good.  I’m just old and have time currently.  Assuming I know a lot about computers can be a mistake.

 

Life is like a bowl of chocolates: there are all these little crinkly paper cups everywhere.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×