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

mkfatimage16: -k option works strangely #1829

Open
stsp opened this issue Dec 6, 2022 · 5 comments
Open

mkfatimage16: -k option works strangely #1829

stsp opened this issue Dec 6, 2022 · 5 comments

Comments

@stsp
Copy link
Member

stsp commented Dec 6, 2022

man says that -k sets image size in
kilobytes. But that doesn't seem to be
the case, judging by the resulting image
file size.
Andrew, do you want to take a look? :)

@andrewbird
Copy link
Member

Seem okay to me. Remember though that it creates image files with a hole, not padded with zeros.

@stsp
Copy link
Member Author

stsp commented Dec 6, 2022

https://www.thegeekdiary.com/what-are-sparse-files-in-linux/
According to this, ls shows the
full size of a sparse file.
So:

$ mkfatimage16 -f a.img -k 10240
$ ls -l a.img 
-rw-rw-r-- 1 stas stas 33920 дек  6 16:53 a.img

Makes sense?

@andrewbird
Copy link
Member

Actually I just did mkfatimage16 -k 1024 test1.img and although its size in DOS shows 1M size, its size on disk seems to be have been truncated rather than made sparse. Doing cp --sparse=never test1.img test2.img didn't expand it, so something seems wrong. I'll have a look later, unless you get to it first.

@stsp
Copy link
Member Author

stsp commented Dec 6, 2022

I won't, I've got a new toy coding
with ia16-gcc for 32bits. :) Eventually
I'll (probably) make it public.

@andrewbird
Copy link
Member

It seems you need to specify -p also to create the full size (as sparse) file. I'm not quite sure what the reasoning is for the default.

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

No branches or pull requests

2 participants