Skip to content

Conversation

@SmartArray
Copy link

@SmartArray SmartArray commented Feb 7, 2025

- What I did
Add an option to linuxkit/format that allows specifying multiple partitions.

- How I did it
I modified the format.go source code by adding a partitionLayoutVar that allows specifying a different value than ";" (create one partition)

- How to verify it

/usr/bin/format --layout "size=20M,type=83\nsize=30M,type=83\n" /dev/vda

should create two partition.

This PR is a WIP because I still have to verify this in my production setup.

- Description for the changelog

allow specification of partition layout in linuxkit/format

- A picture of a cute animal (not mandatory but encouraged)
Screenshot 2025-02-07 at 07 42 25

…/format

Signed-off-by: Yoshi Jaeger <github@jaeger.berlin>
Signed-off-by: Yoshi Jaeger <github@jaeger.berlin>
@SmartArray SmartArray changed the title feat(format): allow custom partition layout specification in linuxkit format [WIP] feat(format): allow custom partition layout specification in linuxkit format Feb 7, 2025
@deitch
Copy link
Collaborator

deitch commented Feb 7, 2025

This makes sense. You are saying that the partition command used is sfdisk, it partitions it by passing stdin, which, if it is is ;, just does the whole disk. So make that the default, and you can override it by passing any valid sfdisk options?

In that case, can it be documented and an example provided?

@SmartArray
Copy link
Author

Yeah this was the goal! I would have edited exactly this documentation without you pointing it out! 🙂

I need to work out the specifics and I am currently checking whether the tooling is working as expected. It looks good so far!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants