Skip to content

Prefer the physical block size over logical block size #277

@nl6720

Description

@nl6720

When running mkfs.exfat on a block device with a 4096 byte physical block size and 512 byte logical block size (so called 512e), mkfs.exfat chooses 512 bytes as the file system sector size.

# lsblk -t /dev/sdb
NAME   ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC ROTA SCHED RQ-SIZE  RA WSAME
sdb            0   4096      0    4096     512    1 none      256 128    0B
└─sdb1         0   4096      0    4096     512    1 none      256 128    0B
# dump.exfat /dev/sdb1
exfatprogs version : 1.2.5
-------------- Dump Boot sector region --------------
Volume Length(sectors): 		67104768
FAT Offset(sector offset): 		2048
FAT Length(sectors): 			8191
Cluster Heap Offset (sector offset): 	10240
Cluster Count: 				1048352
Root Cluster (cluster offset): 		7
Volume Serial: 				0x673ef5a1
Bytes per Sector: 			512
Sectors per Cluster: 			64

----------------- Dump Root entries -----------------
Volume entry type: 			0x83
Volume label: 				
Volume label character count: 		0
Bitmap entry type: 			0x20
Bitmap start cluster: 			0
Bitmap size: 				0
Upcase table entry type: 		0x81
Upcase table start cluster: 		2
Upcase table size: 			131044

---------------- Show the statistics ----------------
Cluster size:  				32768
Total Clusters: 			1048352
Free Clusters: 				1048352

The physical block size of a block device should generally be preferred over the logical block size and many other file system mkfs utilities do so. Unless I'm mistaken, this means trying BLKPBSZGET before BLKSSZGET.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions