cockpit-project / cockpit

Cockpit is a web-based graphical interface for servers.
http://www.cockpit-project.org/
GNU Lesser General Public License v2.1
11.03k stars 1.1k forks source link

btrfs: support resizing #19903

Open jelly opened 8 months ago

jelly commented 8 months ago

Page: storage

Btrfs filesystems should be resizable by Cockpit, btrfs itself only supports online resizing while in Cockpit all our resizing happens offline. We even explicitly check in client.js by querying the fsinfo if offline grow/shrink is supported.

Our resize dialog code also checks if the filesystem is in use:

    const usage = get_active_usage(client,
                                   block && info.grow_needs_unmount ? block.path : null,
                                   _("grow"), null,
                                   true);

And does unmounting if required. For btrfs the Filesystem.BTRFS object has it's own resize method which we need to call instead of Filesystem.Resize().

So the question becomes:

jelly commented 8 months ago

@KKoukiou We also need to think about this in relation to Anaconda, when partitioning if you want to resize btrfs you'll have to mount, resize, unmount do we really want Cockpit to support that use case?

jelly commented 8 months ago

Cockpit makes the assumption that a filesystem which supports OFFLINE_GROW and OFFLINE_SHRINK may also support ONLINE_GROW/SHRINK. However btrfs only supports ONLINE_GROW and ONLINE_SHRINK so the shrink/grow button is disabled in Cockpit currently.