-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
storage: Remount filesystems after resizing them #19418
storage: Remount filesystems after resizing them #19418
Conversation
|
7a8bb8a
to
e8510ce
Compare
e8510ce
to
d1ea16d
Compare
I just noticed that we support creating a partitionless filesystem so basically NVM: you can't seem to create a half formatted partitionless disk, this would be insanely silly :) Resizing grow to full (created a separate issue for this)Resizing XFS to the max gave an error (which I closed...) about the sizes mismatching. It turns out the partition is now resized but the FS is not so a user will end up with: I can't grow this now, a user will get:
|
Comments related to the PR: Shrinking /boot/efi does succeed? But re-mounting does not workfstab looks like:
Actions list does not show it will
|
self.content_row_action(fsys_row, "Mount") | ||
self.confirm() | ||
self.wait_mounted(fsys_row, fsys_tab) | ||
self.wait_mounted(fsys_row, fsys_tab) |
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.
Ideally we verify that the mount options are the same?
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.
When any resize action fails, either due to space constraints or something else we already umounted the FS and changing the size and then trying to resize will fail as Cockpit errors out with "FS is already umounted"
/dev/vda2 is mounted on both /boot/efi and /efi before the resize, but there is no fstab entry for /efi. Do you know why that is? (Why is it mounted twice?) But we should fix Cockpit in any case:
I think the first option is best. |
Yes, that's a old bug... |
Well, this is caught in the dialog before starting any action. But yeah, very small sizes will likely never succeed and Cockpit could prevent that. But since in the case of shrinking, the filesystem is resized first, and if that fails immediately, no harm has been done, no? The only thing to improve is the error message or user experience. |
Thanks for investigating this. Can we do anything about it in Cockpit? Maybe refusing to resize vfat is the best option. |
TL;DR On RHEL-9-4 we have this findmnt
This was with a standard Fedora-39 image.
I recall what I did. I was trying to resize /boot which umount's both /boot/efi and /boot
But now I can't reproduce it on Fedora -39. But on RHEL-9-4 this problem does happen:
Note that the only different is /boot being xfs instead of ext4? This is a rather interesting bug
Or show a warning that it won't be remounted?
|
It's not a libblockdev bug per se, well it depends on what you expect from an API. FAT16/32 can only be resized to certain block sizes, maybe xfs too? But libblockdev hard errors if you propose to resize it to 15.5MB or so. I created a follow up issue for this in Cockpit. |
d1ea16d
to
b6ea463
Compare
Fixed, see #19418 (comment) |
.filter(function (s) { return s.indexOf("x-parent") === 0 }) | ||
.join(","); | ||
if (dir[0] != "/") | ||
dir = "/" + dir; |
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 added line is not executed by any test. Details
actions: is_top ? get_actions(_("unmount")) : [_("unmount")], | ||
has_fstab_entry, | ||
set_noauto: !is_top && !is_temporary, | ||
actions: (is_top ? get_actions(_("unmount")) : [_("unmount")]).concat(has_fstab_entry ? [_("mount")] : []), |
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 added line is not executed by any test. Details
Cockpit should try to predict errors as much as possible and steer the user away from triggering them, but it's always an option to just let the tool fail in obscure ways. So if VFAT has baroque restrictions on what sizes it can be resized to, which depend on the version of parted that we are ultimately using, then I think we can just shrug, and expose the ugly belly of the beast. |
@@ -791,6 +815,9 @@ export function get_active_usage(client, path, top_action, child_action) { | |||
} | |||
|
|||
function enter_unmount(block, location, is_top) { | |||
const [, mount_point] = get_fstab_config_with_client(client, block); |
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.
Seeing that get_fstab_config_with_client
can return [], this leads to mount_point
being undefined, it might be better to use ===
below. But looking at it, it should do the right thing currently.
No description provided.