-
Notifications
You must be signed in to change notification settings - Fork 14
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
fix: kernel partition sync when overwriting GPT #115
Conversation
Add a second method to handle the case when the partition table is fully overwritten. See siderolabs/talos#9701 Signed-off-by: Andrey Smirnov <[email protected]>
40683ff
to
5bff648
Compare
|
||
// syncKernelComplete synchronizes the kernel partition table with the current table by overwriting the whole table. | ||
// | ||
// It is incompatible with mounted partitions. |
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.
Wasn't there a syscall to just tell the kernel to re-read the partition table? Also we must probably check this is not running on a disk which has a mounted partition and return an error if so
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 idea is that if something calls gpt.New
vs. gpt.Read
then we know that whatever existing partitions are going to be removed.
The call would fail if the mounted partitions are there, but it's not the job of this library to handle that (it should be handled in the layer up).
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.
And by that syscall I meant BLKRRPART to be clear
/m |
Fixes siderolabs#9701 See siderolabs/go-blockdevice#115 Signed-off-by: Andrey Smirnov <[email protected]>
Fixes siderolabs#9701 See siderolabs/go-blockdevice#115 Signed-off-by: Andrey Smirnov <[email protected]> (cherry picked from commit 8a7476c)
Fixes siderolabs#9701 See siderolabs/go-blockdevice#115 Signed-off-by: Andrey Smirnov <[email protected]> (cherry picked from commit 8a7476c)
Add a second method to handle the case when the partition table is fully overwritten.
See siderolabs/talos#9701