-
Notifications
You must be signed in to change notification settings - Fork 117
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
Allow writing sparse disk images #139
Comments
I assume you are talking about this here? Where it writes the entire partition from a stream, and thus assumes it should fill it up, else error? In principle, I don't object to it. I want to make sure we are supporting sparse images correctly, though. Is it valid to have a GPT on a disk (or disk image) where the actual size is less than the size listed in the partition table? How does GPT handle that? What happens if we try to read from that disk in the future? E.g. part1 is listed in the table as 1024MB, but you only write 512MB. When someone comes to read the partition, it is the entry in the partition table that tells it the size, i.e. where it starts and ends, represented by this struct. I haven't looked extensively at how gpt handles sparse volumes. If this is a legitimate usage of gpt partitions, and there is a way to handle this correctly according to spec, then we should add it. |
Yes, that's the location I'm referring to. I'm writing a filesystem into the partition, and when mounting the disk, the available space reflects the size of the filesystem, not the partition (e.g. |
Correct, because it is reading filesystem information, not the partition table. Other tools would give you that (like
Usually there are links to the various specs in the directories in the source, but the Do post here what you find in the spec. I am good with removing that constraint check (or at least making sure it is not bigger), if we can be safe with it.
I didn't understand this. |
I'm trying to generate sparse disk images where I write a partition table, but the data I write into the partitions is much smaller than the partition size. Unfortunately, when I tried this with go-diskfs, the
WriteContents
function in gpt'spartiton.go
file checks that the written data matches the partition size. Can we relax this check so it checks that written size <= partition size?The text was updated successfully, but these errors were encountered: