-
Notifications
You must be signed in to change notification settings - Fork 353
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
base: master
Are you sure you want to change the base?
Conversation
Hello @rvykydal! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2024-09-19 14:47:12 UTC |
ef788a0
to
ca47dad
Compare
ca47dad
to
2a671cb
Compare
Hello @vojtechtrefny, could you check if the solution makes sense? |
d1e6b66
to
7367c72
Compare
7367c72
to
20ed5df
Compare
20ed5df
to
af8c029
Compare
af8c029
to
fab73b1
Compare
fab73b1
to
913ca57
Compare
913ca57
to
56b53e6
Compare
A few questions. How API / kickstart will work on multiboot systems? Is the How will this feature work in plain partitioning? What will happen if user of existing BTRFS will use Do we even want to have pykickstart API? I know that pykickstart is usually taken as the most powerful installation type but I see this more like mainly useful for UI and dangerous for Kickstart use feature type. |
I agree. As I said, we don't need to expose kickstart API at this point, just extend the structure as UI entry point, but it would be nice to have a way to test (and maybe use) the feature via kickstart. |
The commit storage: make _get_windows_data more robust is needed to fix webui tests using the feature. I made it a separate PR: #5868 |
Thank you for great questions.
Currently there is an assumption in the PR that there is unique mountpoint found among existing installations (on selected disks). It is the business of the UI to ensure it is the case before requesting home reuse. If the backend finds non-unique mountpoints (or in some cases no mountpoint - in some cases this maybe does not have to be fatal, like if requesting removing If we want to support multiple mountpoints (eg
Good point I think we cau use
I am not sure I understand the question.
Yes, good question, it is the second item in the TODO list above.
I agree with the concern, and as I said in the fist comment we don't:
It is just nice for testing (I am using it heavily), discussion of the use cases (plain vs btrfs partitioning) etc. |
I think it's better to stick to the original proposal and not support setups with multiple
We could even just use |
if len(devices) > 1: | ||
raise StorageError(_("Multiple devices found for bootloader partition '{}': {}") | ||
.format(part_type, | ||
", ".join([device.name for device in devices]))) |
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.
So does this fail with two disks both with a BIOS boot partition? Because that's not a problem (it's not necessary, but also doesn't break anything).
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.
Good point, I'll think about looseing the requirement.
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.
Looks good to me in general. This is surprisingly simple change, I like that :-)
Good point about testing. If the KS support helps us with testing I guess it is worth the effort. I would also like to know what @jstodola thinks about this. How problematic would be to support this on RHEL, if we want to support it there. |
About future possible support for multiple installed systems. First, I totally agree to go with only single installed system. autopart --reuse=/home is much more helpful than autopart --reuse=/dev/sda1 On the other hand having something like autopart --use-free-space --remove=/dev/sda1 might be highly valuable future feature. Maybe I'm getting too wild here. But from the above example it doesn't seem possible to support mounts or devs. And having mount:dev solution seems contra productive to me because dev is the only required in that case. |
We can consider it if there are customer requests for this feature, otherwise I vote for not supporting it on RHEL. As for the kickstart support - I would prefer not having it to avoid additional maintenance. Or, if it is really so valuable for testing, the new options could be marked as experimental, unsupported and not recommended for general use. |
What is this supposed to do? I don't think we (backend/API) should not make the decision about which mps/devices to reuse / remove and reformat. It should be requested explicitly by client/user. Otherwise I'd be afraid of getting to the point where we won't be able to support too generic API. Explicit API makes less commitments. Although it may be less comfortable for the user, I think main use case for /home reuse is UI (where also ambiguities can be solved and result passed to the backend).
It think is not, I think we don't want to support removing arbitrary devices in scope of this feature. |
I think for delivering the feature we can do just with the request data structure extension without any kickstart support / API. |
It should allow users to use autopart in a way that only metioned partitions are remove and everything else stays the intact. However, thinking about it second time |
Another question, do we need |
Hm, I'd need more concrete suggestion, I might be missing something but what you suggest seems to me like doing partitioning ("devicetree will get these actions" ^^^) before partitioning (autopart actions) to me. Both stages (clear partitions and schedule partitions) are done in scope of a partitioning application. |
I guess you are pointing me that sharing two partitioning types is not possible. In that case I understand. I somehow hoped that we would be able to share devicetree between two types but I see the issues there. We don't want to go that way. |
5e95090
to
06b5bb9
Compare
|
06b5bb9
to
fc6917e
Compare
File "/usr/lib/python3.13/site-packages/dasbus/server/handler.py", line 265, in _handle_call return handler(*parameters, **additional_args) File "/usr/lib64/python3.13/site-packages/pyanaconda/modules/storage/devicetree/viewer_interface.py", line 194, in GetExistingSystems return OSData.to_structure_list(self.implementation.get_existing_systems()) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^ File "/usr/lib64/python3.13/site-packages/pyanaconda/modules/storage/devicetree/viewer.py", line 493, in get_existing_systems windows_data = self._get_windows_data() File "/usr/lib64/python3.13/site-packages/pyanaconda/modules/storage/devicetree/viewer.py", line 530, in _get_windows_data if str(device.part_type_uuid) == EFI_PARTITION_TYPE: ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.13/site-packages/blivet/threads.py", line 49, in run_with_lock return m(*args, **kwargs) File "/usr/lib/python3.13/site-packages/blivet/devices/partition.py", line 380, in part_type_uuid if hasattr(parted.Partition, "type_uuid") and self.parted_partition.type_uuid: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'type_uuid'
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.
fc6917e
to
51b6946
Compare
|
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 (partitioningMANUAL
) 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:
/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.