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

Add support for /home reuse to automatic partitioning #5814

Merged
merged 8 commits into from
Oct 10, 2024

Conversation

rvykydal
Copy link
Contributor

@rvykydal rvykydal commented Aug 9, 2024

This is a draft, POC of an approach trying to follow the analysis by @poncovka and @vojtechtrefny which is linked in the https://issues.redhat.com/browse/INSTALLER-4020

It is extending autopartitioning (partitioning AUTOMATIC) with some mount point assignment (partitioning MANUAL) mechanisms.

Tested (supposed) to be working on all partitioning schemes (plain, btrfs, lvm, thinlv), reusing unencrypted autopart.

The idea is to just provide flexible enough mechanism (extending the automatic partitioning request structure), most of the logic, checks, assumptions about the OSs / partitions found should happen in the UI / client providing the feature. (Maybe adding some helper API later)

The backend logic assumes unique existing mount points (eg /home) for the requests (reuse/erase/remove). We could extend it with the device specification if/when we support multiple existing mount points and their selection in the UI (passing the device to the backend instead of mountpoint) but I am not sure we even want to support this case.

The kickstart API doesn't have to be public/published, now it is there just as ground for the discussion, tests, PartitioningRequest structure update and work on webui UI support.

Pykickstart support draft PR: pykickstart/pykickstart#499

Draft of kickstart tests: rhinstaller/kickstart-tests#1278

Webui draft PR: rhinstaller/anaconda-webui#424

TODO:

  • we should handle bootloader partitions automagically - detect required partitions and check there is unambigous (efi or biosboot...) partition to delete (or preserve)
  • check consistency of partitioning scheme
  • reuse fstab mount options (/home is missing compression opts). I am afraid we don't have this data - but it must be the same for reusing /home via mount point assignment - need to check.
  • update unit tests if needed, fix the tests
  • ? check dual boot with Windows (currently only tested with multiple Fedora OSs)

@pep8speaks
Copy link

pep8speaks commented Aug 9, 2024

Hello @rvykydal! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 422:100: E501 line too long (101 > 99 characters)
Line 693:100: E501 line too long (102 > 99 characters)
Line 694:100: E501 line too long (101 > 99 characters)

Comment last updated at 2024-10-08 12:18:05 UTC

@rvykydal
Copy link
Contributor Author

rvykydal commented Aug 26, 2024

Hello @vojtechtrefny, could you check if the solution makes sense?

@rvykydal rvykydal mentioned this pull request Aug 30, 2024
12 tasks
@rvykydal rvykydal changed the title [WIP] Add support for /home reuse to automatic partitioning Add support for /home reuse to automatic partitioning Sep 3, 2024
@rvykydal rvykydal marked this pull request as ready for review September 3, 2024 09:08
@jkonecny12
Copy link
Member

Thanks a lot and sorry for complicating this...

@rvykydal
Copy link
Contributor Author

rvykydal commented Oct 7, 2024

Thanks a lot and sorry for complicating this...

Thank you. My bad, the tests should have been already there in the PR

We use 'destroy' only for plain partition mountpoints as we can't destroy
lv or btrfs subvolume - it would not free space for the new one (and its
vg or btrfs volume). For lvs and btrfs subvols we reuse 'reformat' from
mount point assignment (real erase would be perhaps better, even for
mount point assignment as recreating the device complicates the logic)
But handle efi vs biosboot etc automagically.
@rvykydal
Copy link
Contributor Author

rvykydal commented Oct 8, 2024

/kickstart-test --testtype smoke

@rvykydal
Copy link
Contributor Author

rvykydal commented Oct 8, 2024

I've added the unit tests, @jkonecny12 could you look at the PR again?

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.

This is great improvement! Thanks a lot!

@jkonecny12
Copy link
Member

/packit build

@rvykydal rvykydal merged commit 1d77360 into rhinstaller:master Oct 10, 2024
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f42 Fedora 42
Development

Successfully merging this pull request may close these issues.

6 participants