Comments (3)
We have a bunch of code in snapd / Ubuntu Core around creating partitions / structures that now via the ubuntu-image rewrite uses this library
Great!
It would be great both for creating images for consumption on physical media that has 4K physical sector size / block size and for our own VM based testing to be able to create disk images via some option that use 4K as the sector size instead of the default 512 that is currently hard-coded here in diskfs.go
Right. If it is an actual block device, it reads it from the block device here; if not, it just assumes 512 bytes here
It sounds reasonable to be able to override it.
Maybe a new function CreateWithSectorSize or some additional Format flag in Create()?
I think an additional flag is better than a proliferation of functions. We easily could have more parameters in the future, which can make it unwieldy. Granted, this is just a stylistic preference, but I am allowed to prefer. :-)
I have used variadic parameters in the past to keep things from growing too much or changing a signature, but that seems overkill here. Let's just add a parameter. On the other hand, that does break the existing API, which semver would indicate should cut a new release. I have no great desire to cut 2.0.0 just for this.
Eh, let's go for the parameter and not worry too much about semver's strict rules here.
Care to open a PR for it?
from go-diskfs.
Hi, I will try to take a stab at it next week, but if I don't get around to it, please by all means someone else can take over working on this issue.
from go-diskfs.
Thanks @sil2100 for working on this!
from go-diskfs.
Related Issues (20)
- io.Copy error? HOT 11
- Question: Can this be used to flash images to disks? HOT 5
- Allow writing sparse disk images HOT 3
- Support for Darwin HOT 2
- Command line utility HOT 5
- minimal gpt partition size is wrong HOT 3
- Is there a golang util to manage RAID(0, 1, 5 6, 10...)? HOT 2
- Where is the type `PartitionTable` defined? HOT 9
- How to close the disk? HOT 1
- gpt can have size larger than minimum size
- Partitions not created HOT 15
- SectorSizeDefault not declared by package diskfs HOT 3
- Is 0o666 a typo? HOT 1
- Can't seem to read fat32 partition HOT 1
- Any plans for a release version? HOT 3
- Implement standard fs.FS interface and friends HOT 3
- Support status for solaris, aix, freebsd, illumos, netbsd, openbsd and plan9 HOT 3
- Incorrect number of partitions reported for the Ubuntu 22.04.02 Server ISO HOT 4
- corrupt GPT with examples/efi_create.go HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-diskfs.