gpt icon indicating copy to clipboard operation
gpt copied to clipboard

Writes are not in whole sectors, can't create partition of FreeBSD (OS returns EINVALID for write)

Open p-kraszewski opened this issue 1 year ago • 2 comments

Linux allows partial sector writes (that's why you can dd bs=1). However in other OSes (like FreeBSD) device writes are allowed only at a sector boundary and of (multiple) sector sizes.

You try to update GPT on-disk in 128-byte increments (that is at each GPT entry), which is an invalid op.

p-kraszewski avatar Feb 09 '24 10:02 p-kraszewski

Thanks for pointing this out. I will need to take a closer look to fix this, might not be that easy.

soerenmeier avatar Feb 25 '24 16:02 soerenmeier

What comes to my mind is some form of Read-Modify-Write cache with 512B pages as an intermediate layer. I'll look into it in my free time.

p-kraszewski avatar Feb 25 '24 16:02 p-kraszewski