mac-fdisk with different block size

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

mac-fdisk with different block size

Nuno J. Silva-4
I am trying to create an Apple partition map with a block size of 4096
bytes, but I can't find an option to change the block size in mac-fdisk,
which defaults to 512 bytes.

Does anybody know of a utility that can create and modify such partition
maps under Gentoo?

--
Nuno Silva


Reply | Threaded
Open this post in threaded view
|

Re: mac-fdisk with different block size

Andrew Udvare


> On 2019-01-13, at 07:49, (Nuno Silva) <[hidden email]> wrote:
>
> I am trying to create an Apple partition map with a block size of 4096
> bytes, but I can't find an option to change the block size in mac-fdisk,
> which defaults to 512 bytes.
>
> Does anybody know of a utility that can create and modify such partition
> maps under Gentoo?


Quick look and it seems that for mac-fdisk the 512 size is hard-coded:

https://github.com/glaubitz/mac-fdisk-debian/blob/bda743065fa2c75a83fec60166bc2e317059ef7a/io.h#L32
Reply | Threaded
Open this post in threaded view
|

Re: mac-fdisk with different block size

Nuno J. Silva-4
On 2019-01-13, Andrew Udvare wrote:

>> On 2019-01-13, at 07:49, (Nuno Silva) <[hidden email]> wrote:
>>
>> I am trying to create an Apple partition map with a block size of 4096
>> bytes, but I can't find an option to change the block size in mac-fdisk,
>> which defaults to 512 bytes.
>>
>> Does anybody know of a utility that can create and modify such partition
>> maps under Gentoo?
>
>
> Quick look and it seems that for mac-fdisk the 512 size is hard-coded:
>
> https://github.com/glaubitz/mac-fdisk-debian/blob/bda743065fa2c75a83fec60166bc2e317059ef7a/io.h#L32


That code appears to be version 0.4 from early 1997. Under Gentoo, the
README file installed at /usr/share/doc/mac-fdisk-0.1_p18/ mentions 0.4
as well.

According to a changelog at apple.com[1], variable block size support
was added after that, and should be present in version 0.5.

[1] https://opensource.apple.com/source/pdisk/pdisk-9/HISTORY.auto.html

If there is no other utility that can do this, I'll have a look at the
newer source code from apple.com...

--
Nuno Silva


Reply | Threaded
Open this post in threaded view
|

Re: mac-fdisk with different block size

Andrew Udvare


> On Jan 13, 2019, at 09:24, (Nuno Silva) <[hidden email]> wrote:
>
> On 2019-01-13, Andrew Udvare wrote:
>
>>> On 2019-01-13, at 07:49, (Nuno Silva) <[hidden email]> wrote:
>>>
>>> I am trying to create an Apple partition map with a block size of 4096
>>> bytes, but I can't find an option to change the block size in mac-fdisk,
>>> which defaults to 512 bytes.
>>>
>>> Does anybody know of a utility that can create and modify such partition
>>> maps under Gentoo?
>>
>>
>> Quick look and it seems that for mac-fdisk the 512 size is hard-coded:
>>
>> https://github.com/glaubitz/mac-fdisk-debian/blob/bda743065fa2c75a83fec60166bc2e317059ef7a/io.h#L32
>
>
> That code appears to be version 0.4 from early 1997. Under Gentoo, the
> README file installed at /usr/share/doc/mac-fdisk-0.1_p18/ mentions 0.4
> as well.
>
> According to a changelog at apple.com[1], variable block size support
> was added after that, and should be present in version 0.5.

On actual macOS latest, there's a -b option for block size.

Reply | Threaded
Open this post in threaded view
|

Re: mac-fdisk with different block size

Nuno J. Silva-4
On 2019-01-13, Andrew Udvare wrote:

>> On Jan 13, 2019, at 09:24, (Nuno Silva) <[hidden email]> wrote:
>>
>> On 2019-01-13, Andrew Udvare wrote:
>>
>>>> On 2019-01-13, at 07:49, (Nuno Silva) <[hidden email]> wrote:
>>>>
>>>> I am trying to create an Apple partition map with a block size of 4096
>>>> bytes, but I can't find an option to change the block size in mac-fdisk,
>>>> which defaults to 512 bytes.
>>>>
>>>> Does anybody know of a utility that can create and modify such partition
>>>> maps under Gentoo?
>>>
>>>
>>> Quick look and it seems that for mac-fdisk the 512 size is hard-coded:
>>>
>>> https://github.com/glaubitz/mac-fdisk-debian/blob/bda743065fa2c75a83fec60166bc2e317059ef7a/io.h#L32
>>
>>
>> That code appears to be version 0.4 from early 1997. Under Gentoo, the
>> README file installed at /usr/share/doc/mac-fdisk-0.1_p18/ mentions 0.4
>> as well.
>>
>> According to a changelog at apple.com[1], variable block size support
>> was added after that, and should be present in version 0.5.
>
> On actual macOS latest, there's a -b option for block size.

GNU parted does not seem to have an option to *change* the block size,
but it will use the drive's block size when creating a new Apple
partition table.

--
Nuno Silva