Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Mike Boreham

macrumors 68040
Aug 10, 2006
3,904
1,894
UK
I get similar for my two T5s (and the boot SSD). But the disks referred too are all APFS containers - never the physical disk. So my question:

Are you sure (and why) that the log entries refer to SSD TRIMs rather than some trimming (not uppercase) of APFS space?

No not sure at all. I think all my entries are APFS containers as well. The Samsung T7 I mentioned earlier had three containers which appeared separately in the spaceman log entries (but with 'no trims').

So you are suggesting there is TRIMMING and trimming and unless it is at physical drive level it is small trimming, not the same.....or is it.

What you say reminds me that for a long time Disk Utility repair sometimes mentions 'trimming unused blocks' which has caused discussion about whether it is TRIMMING or trimming.

What you are implying might explain why so little publicity about the issue.
 
  • Like
Reactions: gilby101

white7561

macrumors 6502a
Jun 28, 2016
934
386
World
No not sure at all. I think all my entries are APFS containers as well. The Samsung T7 I mentioned earlier had three containers which appeared separately in the spaceman log entries (but with 'no trims').

So you are suggesting there is TRIMMING and trimming and unless it is at physical drive level it is small trimming, not the same.....or is it.

What you say reminds me that for a long time Disk Utility repair sometimes mentions 'trimming unused blocks' which has caused discussion about whether it is TRIMMING or trimming.

What you are implying might explain why so little publicity about the issue.
Yes disk utility shows that . It used to show that on HFS+ partitions.
 
  • Like
Reactions: gilby101

Mike Boreham

macrumors 68040
Aug 10, 2006
3,904
1,894
UK
Neither am I. Just suspicious it is APFS trimming and not TRIMing.

Yes it would. Sadly.
Howard Oakley wrote this about Spaceman in an article about APFS and TRIM in 2019:

"Apple has still released very limited information about APFS, and its latest reference manual doesn’t mention TRIM at all, for instance. Two important sub-systems within APFS are its Space Manager (‘Spaceman’) and the Reaper.

Spaceman is responsible for allocating and freeing blocks to store file system objects and file data. Each APFS container has just one Spaceman, which has to manage all space within that container, for as many volumes as share that space. The Reaper is the mechanism by which APFS deletes large objects, which require multiple transactions within the file system. Again, there is only one Reaper for each APFS container. It’s the Reaper which is responsible for cleaning up deleted snapshots, for example".


Not sure where that leaves the idea that macOS has recently started TRIMming USB externals, but does seem to confirm there is nothing new about Spaceman.
 
Last edited:
  • Like
Reactions: gilby101

Varoudis

macrumors member
Aug 17, 2009
59
3
are there any new developments on this?

I have checked my UGREEN SSD UASP USB-C enclosure against a T7Touch and both seem to say that they support unmap.

Is it better to work with APFS or HFS+? Is there a verdict on if APFS is actually doing hardware level 'trimming" or just FS?
 
  • Like
Reactions: Basic75

Varoudis

macrumors member
Aug 17, 2009
59
3
APFS.

I think that @Mike Boreham gave the answer in his quotes from Howard Oakley - APFS does file system trimming.

Why do you want TRIM for your SSDs?
I have a enterprise 7.85tb SSD in an enclosure in order to push some local restic backup copies (additional to 3-2-1 etc...). So it will work almost 70% full all the time with older snapshots being deleted. So unused space is nice to be available for full speed write. (10Gbe net)
 
  • Like
Reactions: Basic75

awert_8

macrumors newbie
Mar 24, 2020
8
1
Just for sharing:

Here's my result of T7 trimmed by spaceman. It seems that USB external drive with apfs container fs should work when usap feature is supported and enabled naturally by both os and bridge-chip

It didn't support before with Big Sur (shows "IOStorageFeatures" = {"UnmapCapable"=No}) until I upgraded it to Monterey.

Code:
| |   |       |       |   |         +-o IOSCSIHierarchicalLogicalUnit@0000000000000000  <class IOSCSIHierarchicalLogicalUnit, id 0x100000583, registered, matched, active, busy 0 (83 ms), retain 10>

    | |   |       |       |   |           | {

    | |   |       |       |   |           |   "SCSI Logical Unit Bytes" = <0000000000000000>

    | |   |       |       |   |           |   "IOPowerManagement" = {"CapabilityFlags"=49152,"ChildProxyPowerState"=1,"MaxPowerState"=1,"DevicePowerState"=1,"DriverPowerState"=1,"ChildrenPowerState"=1,"CurrentPowerState"=1}

    | |   |       |       |   |           |   "CurrentPowerState" = 1

    | |   |       |       |   |           |   "Peripheral Device Type" = 0

    | |   |       |       |   |           |   "SCSI Logical Unit Number" = 0

    | |   |       |       |   |           |   "IOMatchCategory" = "SCSITaskUserClientIniter"

    | |   |       |       |   |           |   "Protocol Characteristics" = {"Write Time Out Duration"=30000,"Read Time Out Duration"=30000,"Physical Interconnect"="USB","SCSI Logical Unit Number"=0,"Physical Interconnect Location"="External","SCSI Logical Unit Bytes"=<0000000000000000>,"Retry Count"=20}

    | |   |       |       |   |           |   "Vendor Identification" = "Samsung"

    | |   |       |       |   |           |   "INQUIRY Device Identification" = ({"Identifier Type"=3,"Code Set"=1,"Identifier"=<5000000000000001>,"Association"=0})

    | |   |       |       |   |           |   "Product Revision Level" = "0"

    | |   |       |       |   |           |   "Product Identification" = "PSSD T7"

    | |   |       |       |   |           |   "IOUnitLUN" = 0

    | |   |       |       |   |           |   "TPGS Information" = 0

    | |   |       |       |   |           |   "IOUnitLUNBytes" = <0000000000000000>

    | |   |       |       |   |           | }

    | |   |       |       |   |           |

    | |   |       |       |   |           +-o IOSCSIPeripheralDeviceType00  <class IOSCSIPeripheralDeviceType00, id 0x10000058d, !registered, !matched, active, busy 0 (80 ms), retain 8>

    | |   |       |       |   |             | {

    | |   |       |       |   |             |   "IOClass" = "IOSCSIPeripheralDeviceType00"

    | |   |       |       |   |             |   "CFBundleIdentifier" = "com.apple.iokit.IOSCSIBlockCommandsDevice"

    | |   |       |       |   |             |   "IOProviderClass" = "IOSCSIPeripheralDeviceNub"

    | |   |       |       |   |             |   "IOMaximumBlockCountRead" = 2048

    | |   |       |       |   |             |   "IOPowerManagement" = {"CapabilityFlags"=49216,"MaxPowerState"=4,"ActivityTickles"=818168,"DevicePowerState"=4,"IdleTimerPeriod"=200000,"TimeSinceLastTickle"=80,"DriverPowerState"=1,"IdleTimerElapsedTime"=123057,"CurrentPowerState"=4}

    | |   |       |       |   |             |   "IOMaximumBlockCountWrite" = 2048

    | |   |       |       |   |             |   "Medium Type" = "Solid State"

    | |   |       |       |   |             |   "IOProbeScore" = 5000

    | |   |       |       |   |             |   "Peripheral Device Type" = 0

    | |   |       |       |   |             |   "IOMatchedAtBoot" = Yes

    | |   |       |       |   |             |   "IOMatchCategory" = "IODefaultMatchCategory"

    | |   |       |       |   |             |   "IOMediaIcon" = {"IOBundleResourceFile"="USBHD.icns","CFBundleIdentifier"="com.apple.iokit.IOSCSIArchitectureModelFamily"}

    | |   |       |       |   |             |   "IOMaximumByteCountWrite" = 1048576

    | |   |       |       |   |             |   "IOPersonalityPublisher" = "com.apple.iokit.IOSCSIBlockCommandsDevice"

    | |   |       |       |   |             |   "IOStorageFeatures" = {"Unmap"=Yes}

    | |   |       |       |   |             |   "CFBundleIdentifierKernel" = "com.apple.iokit.IOSCSIBlockCommandsDevice"

    | |   |       |       |   |             |   "WriteCacheState" = Yes

    | |   |       |       |   |             |   "IOMaximumByteCountRead" = 1048576

    | |   |       |       |   |             |   "IOPrimaryDriverTerminateOptions" = Yes

    | |   |       |       |   |             | }

Code:
2023-03-19 10:12:21.987949+0800 0x2a4      Default     0x0                  0      0    kernel: (apfs) spaceman_scan_free_blocks:3154: disk3 scan took 319.609142 s, trims took 319.248567 s
2023-03-19 10:12:21.987959+0800 0x2a4      Default     0x0                  0      0    kernel: (apfs) spaceman_scan_free_blocks:3156: disk3 57687145 blocks free in 234279 extents
2023-03-19 10:12:21.987968+0800 0x2a4      Default     0x0                  0      0    kernel: (apfs) spaceman_scan_free_blocks:3164: disk3 57687145 blocks trimmed in 234279 extents (1362 us/trim, 733 trims/s)
2023-03-19 10:12:21.987978+0800 0x2a4      Default     0x0                  0      0    kernel: (apfs) spaceman_scan_free_blocks:3167: disk3 trim distribution 1:64549 2+:37682 4+:60646 16+:30957 64+:17265 256+:23180

Code:
/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +499.9 GB   disk3
                                 Physical Store disk2s2
   1:                APFS Volume macOS - Data            242.2 GB   disk3s1
   2:                APFS Volume Preboot                 2.2 GB     disk3s2
   3:                APFS Volume Recovery                1.1 GB     disk3s3
   4:                APFS Volume VM                      1.1 MB     disk3s4
   5:                APFS Volume macOS                   20.6 GB    disk3s5
   6:              APFS Snapshot com.apple.os.update-... 20.6 GB    disk3s5s1
 
Last edited:
  • Like
Reactions: Basic75

ARMunix

macrumors newbie
Mar 25, 2021
17
6
Just for sharing:

Here's my result of T7 trimmed by spaceman. It seems that USB external drive with apfs container fs should work when usap feature is supported and enabled naturally by both os and bridge-chip

It didn't support before with Big Sur (shows "IOStorageFeatures" = {"UnmapCapable"=No}) until I upgraded it to Monterey.
I'm a little late to the party, but do you remember if you had the Samsung Magician software installed on your system when you posted the above (and the kernel extensions it provides activated)?

When the Samsung drivers are active, my T7 definitely performs TRIM, but without them, seems like it does not (even though I ran the "trimforce enable" command).
 
  • Wow
Reactions: Basic75
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.