I know usually the sector size is 512 B but some drives use 4 KiB (advanced format).
How can I check which one is used by a drive? Is the sector size somewhere stored on the drive - e.g. in the MBR or GUID-partitiontable?
I'm interested in solutions for Windows 10 and Linux. It would be also great to know how to read it with a Python script or a hex editor.