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

Disable remove extended partition for EFI operation systems #509

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adamkankovsky
Copy link
Contributor

@adamkankovsky adamkankovsky commented Nov 12, 2024

image

@garrett
Copy link
Contributor

garrett commented Nov 12, 2024

So we don't have an assiciation between extended and logical partitions, so we can't do something like this:

image

So, instead of a top-down approach where you're trying to delete the container and the children, if you delete all the children, then the container disappears (in a bottom-up approach). The fact that the extended partition even exists is an artifact of a hack to shoehorn flexibility to allow logical partitions to exist next to primary partitions. Extended partitions don't matter overall; they're implementation details that exist to make logical partitions possible.

In other words, if we detect extended partitions (like on an MBR disk, with an empty "type"), we can label them and have a clickable info icon that can explain it, like this:

image

This is a quick mockup, so ignore some of the incorrect details (like missing resizes, having some actions disabled, etc.)

What you should notice:

  • "extended partition" that is styled (grey and italics here)
  • (?) icon that you can click
  • popover with text that explains the situation
  • no trash icon (not even a disabled one) as it's not possible to even do anything with this partition at all

The extended partition is kind of a "ghost" that Anaconda automatically deletes when it's not needed.

The text:

vda4 is an MBR extended partition that contains logical partitions. Removing all logical partitions will also automatically remove the extended partition.

"vda4" should be the partition name, and it should be bold.

@garrett
Copy link
Contributor

garrett commented Nov 12, 2024

We chatted more, and the size is kind of redundant and mostly misleading on extended partitions too, as the logical partitions are the ones actually using size. So we should probably remove that from the list as well.

image

Copy link
Contributor

@KKoukiou KKoukiou left a comment

Choose a reason for hiding this comment

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

Can you explain in the commit message a bit more clearly why this is needed?

src/components/storage/ReclaimSpaceModal.jsx Outdated Show resolved Hide resolved
@@ -359,14 +355,16 @@ const DeviceActionDelete = ({ device, hasBeenRemoved, newDeviceSize, onAction })

// Disable the remove action for disk devices without partitions
const isRemoveDisabled = device.type.v === "disk" && device.children.v.length === 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please integrate the second check here:
const isDiskWithoutChildren = device.type.v === "disk" && device.children.v.length === 0;
const isExtendedPartition = device.attrs?.v.isleaf === "False" && device.children.v.length === 0;
const isRemoveDisabled = isDiskWithoutChildren || isExtendedPartition;

@vojtechtrefny
Copy link
Contributor

So, instead of a top-down approach where you're trying to delete the container and the children, if you delete all the children, then the container disappears (in a bottom-up approach). The fact that the extended partition even exists is an artifact of a hack to shoehorn flexibility to allow logical partitions to exist next to primary partitions. Extended partitions don't matter overall; they're implementation details that exist to make logical partitions possible.

I'd add that in blivet in general extended partitions are treated as implementation detail, something that allows you to create more than 4 partitions on MSDOS partition table. In general we create and remove extended partitions automatically as needed. (It is possible to control this manually and blivet-gui allows that, but Anaconda itself, including manual partitioning does not.)
We also don't treat extended partitions as a containers -- the logical partitions are not children of the extended partition, all partitions are children of the disk. Extended partitions are a big hack and I am really glad that GPT is now default everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants