Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cmd] Prevent fdisk from creating partition beyond end of medium. #93

Merged
merged 1 commit into from
Oct 19, 2024

Conversation

Mellvik
Copy link
Owner

@Mellvik Mellvik commented Oct 19, 2024

Apparently since the beginning of time, fdisk has allowed creation of partitions 1 cylinder beyond the end of medium (by equating cylinder count with cylinder numbers). This minor update fixes that.

@ghaerr
Copy link

ghaerr commented Oct 19, 2024

Wow, nice find! I'm surprised this has been in there so long, as it would seem many users might have selected max cylinders when creating a partition. Did this come to light by using an image that actually ran out of cylinders?

@Mellvik
Copy link
Owner Author

Mellvik commented Oct 19, 2024

What happens is that when initializing a minix fs in a partition that goes past physical, it tries to write (inodes presumably) beyond the end of the device and dies. So it has been an irritation (aka itch) for some time and I finally decided to get rid of it - having a blank 256M CF card available to play with..

@Mellvik Mellvik merged commit d02676a into master Oct 19, 2024
@Mellvik
Copy link
Owner Author

Mellvik commented Oct 19, 2024

Completely off topic, @ghaerr: I finally got a complete from scratch copy of ELKS downloaded and cross tools compiled. It turns out the problem with Apple M(1-4) architecture and cross tools is still there (I had to fix that when I started with TLVC almost 2 years ago). Maybe you could get @tkchia to fix it:
https://review.haiku-os.org/c/buildtools/+/4329/2/gcc/gcc/config/aarch64/aarch64.h#1003

@Mellvik
Copy link
Owner Author

Mellvik commented Oct 19, 2024

Update - this turns out to be the right link for the fix: https://review.haiku-os.org/c/buildtools/+/4329

@ghaerr
Copy link

ghaerr commented Oct 21, 2024

@Mellvik:

After looking into this fix further, I saw that the MBR images created using "make images" had incorrect partition tables generated by setboot, which I'm sure was further confusing matters. This is fixed in ghaerr/elks#2084.

@Mellvik
Copy link
Owner Author

Mellvik commented Oct 22, 2024

Thanks for the heads up @ghaerr. I've been fortunate not to encounter this one (I just recently started using hd images in qemu). I'll be sure to add the fix. (The list is becoming dangerously looong, looks like I really need a cleanup weekend).

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