Skip to content

diskspace command reports incorrect block size (512 bytes) #640

@briankrznarich

Description

@briankrznarich

Describe the bug
Block size is inexplicably divided by 8 before printing, reporting 512bytes on my SE2 (iOS26 and iOS18). Block size on a modern iPhone is 4096 bytes.

To Reproduce
../go-ios/go-ios diskspace --address ... --rsd-port ...

Smartphone (please complete the following information):
SE2, iOS26, SE2 iOS18

Current output:

      Model: iPhone12,8
  BlockSize: 512
  FreeSpace: 36.7GB
  UsedSpace: 27.3GB
 TotalSpace: 64.0GB

Actual source code in main.c:

                fmt.Printf("  BlockSize: %d\n", info.BlockSize/8)

iOS uses apfs since 2017
https://en.wikipedia.org/wiki/Apple_File_System
Minimum block size on apfs is 4k:
https://developer.apple.com/support/downloads/Apple-File-System-Reference.pdf

#define NX_MINIMUM_BLOCK_SIZE 4096
#define NX_DEFAULT_BLOCK_SIZE 4096
#define NX_MAXIMUM_BLOCK_SIZE 65536

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions