-
Notifications
You must be signed in to change notification settings - Fork 0
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
add the ability to partition used disks #31
base: main
Are you sure you want to change the base?
Conversation
682f8ca
to
6be07e9
Compare
9f95d12
to
7e8f815
Compare
pkg/storage/filesystem/device.go
Outdated
func isValidAsDevice(space DiskSpace) bool { | ||
// empty space around and in-between partitions used for | ||
// partitioning table metadata and partitions alignment | ||
const minDeviceSizeBytes = 2 * 1024 * 1024 // 2 MB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a 2MB disk is not really usable in practice. I suggest this is in creased to 2GB or even 5GB
What do you think @xmonader ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much @Omarabdul3ziz for creating this PR. I left a minor comment :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Omarabdul3ziz , @muhamadazmy please check
pkg/storage/filesystem/device.go
Outdated
|
||
func (d *DeviceInfo) AllocateEmptySpace(ctx context.Context, space DiskSpace) error { | ||
args := []string{ | ||
d.Path, "mkpart", "primary", space.Start, space.End, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this command is only valid for DOS Disklabels (DOS Partition table)
for GPT disklabels it's mkpart $somename $fstype space.start space.end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, the script creates a partition for BTRFS with Label ZOSCACHE
you can mount that directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/diskfs/go-diskfs
instead of shelling into parted commands, this would be a lot more manageable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the code already handle the zos-cache
named devices, this part for preparing all possible spaces zos can use for cache if no zos-cache
partition is found.
Description
Tested on
zospxe