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

Improve btrfs handling in custom partitioning #4812

Conversation

rvykydal
Copy link
Contributor

@rvykydal rvykydal commented Jun 5, 2023

The patches should improve the manipulation with btrfs subvolumes in GUI Custom partitioning as reported in https://bugzilla.redhat.com/show_bug.cgi?id=2186158.

One of the patches should fix removing of btrfs subvolumes:
Original (parent subvolume /root is removed incorrectly):
https://rvykydal.fedorapeople.org/btrfs/rhbz2186158/removing_parent_subvolume.webm
Patched:
https://rvykydal.fedorapeople.org/btrfs/rhbz2186158/preserving_parent_subvolume.webm

The other one fixes displaying btrfs subvolumes in Custom partitioning:
Original:
https://bugzilla.redhat.com/show_bug.cgi?id=2186158#c6
Patched:
https://rvykydal.fedorapeople.org/btrfs/rhbz2186158/remove_btrfs_home.webm

Although the patches don't solve btrfs volume reformatting, they should allow to reuse /home subvolume by mounting it, removing and adding root subvolume and reformatting other non-btrfs partitions as in:
https://rvykydal.fedorapeople.org/btrfs/rhbz2186158/reuse_home_by_removing_and_adding_btrfs_root.webm

rvykydal added 2 commits June 5, 2023 10:22
…158)

When removing a btrfs subvolume, do not remove its empty parents which
are also subvolumes (only empty parent volumes should be removed).
Do not accept btrfs volume returned by resolve_device blivet method if
we are looking for a subvolume.
@rvykydal rvykydal added the f39 label Jun 5, 2023
@rvykydal rvykydal requested a review from poncovka June 5, 2023 09:46
@rvykydal
Copy link
Contributor Author

rvykydal commented Jun 5, 2023

@vojtechtrefny can you please look at the PR ?

Copy link
Member

@jkonecny12 jkonecny12 left a comment

Choose a reason for hiding this comment

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

Looks good to me from what I can tell.

Copy link
Contributor

@vojtechtrefny vojtechtrefny left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@rvykydal
Copy link
Contributor Author

rvykydal commented Jun 6, 2023

I've opened an issue for Blivet to fix the btrfs subvolume resolution there:storaged-project/blivet#1134 rather than with this PR patch, but I don't want to block this PR on it.

@rvykydal
Copy link
Contributor Author

rvykydal commented Jun 6, 2023

/kickstart-test --testtype smoke

Copy link
Contributor

@VladimirSlavik VladimirSlavik left a comment

Choose a reason for hiding this comment

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

Thank you, code LGTM, I have only nitpicks.

@@ -299,6 +299,11 @@ def _parse_fstab(devicetree, chroot):
if device is None:
continue

# If a btrfs volume is found but a subvolume is expected, ignore the volume.
if device.type == "btrfs volume" and "subvol=" in options:
log.debug("subvolume from %s for %s not found", options, devspec)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this too well, so sorry if I'm wrong, but... is it not found, or skipped?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A subvolume was not found (for example it had been removed by GUI action).

Conan-Kudo

This comment was marked as duplicate.

Copy link
Contributor

@Conan-Kudo Conan-Kudo left a comment

Choose a reason for hiding this comment

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

Thank you for these improvements!

@rvykydal rvykydal merged commit eb0d282 into rhinstaller:master Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

5 participants