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

Use partprobe to re-read partition table #856

Merged
merged 2 commits into from
Apr 22, 2021

Conversation

nicolasbock
Copy link
Contributor

The blkdev command is fragile re-reading partition tables if a
partition is mounted. This change replaces it with the partprobe
command.

Closes-Bug: https://bugs.launchpad.net/cloud-init/+bug/1920939
Signed-off-by: Nicolas Bock nicolas.bock@canonical.com

@nicolasbock
Copy link
Contributor Author

I just sigend the CLA.

@giggsoff
Copy link
Contributor

I just sigend the CLA.

Seems, you should do the last step from hacking:

If you already have a change that you want to submit, you can also include the change to tools/.github-cla-signers

@nicolasbock
Copy link
Contributor Author

Done

@TheRealFalcon
Copy link
Member

@nicolasbock , thanks for this submission!

The overall idea is a good one, but unfortunately partprobe doesn't come pre-installed on very many linux distributions. Can you update the change to use partprobe if it exists, but fall back to using blockdev if partprobe does not exist?

The `blkdev` command is fragile re-reading partition tables if a
partition is mounted. This change replaces it with the `partprobe`
command.

Closes-Bug: https://bugs.launchpad.net/cloud-init/+bug/1920939
Signed-off-by: Nicolas Bock <nicolas.bock@canonical.com>
@nicolasbock
Copy link
Contributor Author

Thanks @TheRealFalcon for the review! I have updated the PR to include blkdev as fallback as you suggested.

@github-actions
Copy link

Hello! Thank you for this proposed change to cloud-init. This pull request is now marked as stale as it has not seen any activity in 14 days. If no activity occurs within the next 7 days, this pull request will automatically close.

If you are waiting for code review and you are seeing this message, apologies! Please reply, tagging mitechie, and he will ensure that someone takes a look soon.

(If the pull request is closed and you would like to continue working on it, please do tag mitechie to reopen it.)

@github-actions github-actions bot added the stale-pr Pull request is stale; will be auto-closed soon label Apr 22, 2021
@nicolasbock
Copy link
Contributor Author

Hi @mitechie ! Could you have a look at this PR? Thanks!

@mitechie mitechie removed the stale-pr Pull request is stale; will be auto-closed soon label Apr 22, 2021
@mitechie
Copy link
Contributor

Thanks for the ping. Let me check in with @TheRealFalcon about getting another look.

@nicolasbock
Copy link
Contributor Author

Thanks for the ping. Let me check in with @TheRealFalcon about getting another look.

Thanks!

Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicolasbock My apologies! I saw your comment earlier but I misread it as you were going to make the change, not that you had already made the change.

This looks good to me now. Thanks!

@TheRealFalcon TheRealFalcon merged commit ced836e into canonical:master Apr 22, 2021
@nicolasbock nicolasbock deleted the lp_1920939 branch April 22, 2021 18:40
@nicolasbock
Copy link
Contributor Author

Thanks again for the review @TheRealFalcon !

TheRealFalcon added a commit to TheRealFalcon/cloud-init that referenced this pull request Apr 30, 2021
In canonical#856 we added the ability to use partprobe instead of blockdev for
reading partitions. Test that partprobe succeeds where blockdev fails.

Also add a mechanism to our integration tests to allow a callable to be
called between `lxc init` and `lxc start`
TheRealFalcon added a commit to TheRealFalcon/cloud-init that referenced this pull request May 5, 2021
In canonical#856 we added the ability to use partprobe instead of blockdev for
reading partitions. Test that partprobe succeeds where blockdev fails.

Also add a mechanism to our integration tests to allow a callable to be
called between `lxc init` and `lxc start`
TheRealFalcon added a commit to TheRealFalcon/cloud-init that referenced this pull request May 5, 2021
In canonical#856 we added the ability to use partprobe instead of blockdev for
reading partitions. Test that partprobe succeeds where blockdev fails.

Also add a mechanism to our integration tests to allow a callable to be
called between `lxc init` and `lxc start`
TheRealFalcon added a commit that referenced this pull request May 14, 2021
In #856 we added the ability to use partprobe instead of blockdev for
reading partitions. Test that partprobe succeeds where blockdev fails.

Also add a mechanism to our integration tests to allow a callable to be
called between `lxc init` and `lxc start`
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

Successfully merging this pull request may close these issues.

None yet

4 participants