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

btrfs installation is unencrypted! #2294

Open
rustybird opened this Issue Sep 5, 2016 · 9 comments

Comments

Projects
None yet
4 participants
@rustybird

rustybird commented Sep 5, 2016

Qubes OS version:

R3.2 rc3


If you install with btrfs as as the root filesystem, it will be unencrypted.

Steps to reproduce the behavior:

  • Choose I will configure partitioning
  • On the MANUAL PARTITIONING screen, either keep LVM or choose Btrfs in the partitioning scheme dropdown.
  • Create /boot and swap.
  • Create /. If you previously chose Btrfs, the Encrypt checkbox is unselected and greyed out. If you previously chose LVM, switch to Btrfs now; then the Encrypt checkbox will be selected and greyed out.
  • In any case, the btrfs root filesystem will actually be installed to an unencrypted partition.

General notes:

Man, that partitioning wizard just keeps getting worse and worse.

Not workarounds:

  • If you manually create a LUKS container in the terminal and unlock it in the installer, you can't choose btrfs as its filesystem
  • If you also manually create a new btrfs filesystem inside the LUKS container, the installer will unselect and gray out the Reformat check box and then complain that reformatting the root mountpoint is required to continue... (ノಠ益ಠ)ノ彡┻━┻

Workarounds:

  • modprobe btrfs so dracut picks up the module, install as ext4, use btrfs-convert, replace the root fs UUID in grub.cfg
  • Slightly cleaner: In the end, I replaced the installer's mke2fs and mount binaries with a small wrapper script that mangles their invocations as needed
  • See comment below
@tasket

This comment has been minimized.

Show comment
Hide comment
@tasket

tasket Sep 14, 2016

IIRC you should be able to choose btrfs for automatic partitioning as a sort-of workaround -- if erasing the disk is OK. That gives you btrfs on luks. You could even install this way onto a different disk, then reboot and 'btrfs device add' a prepared luks volume on the target disk and then delete the initial device; this will move the contents of the installed root fs to your target disk.

But, yeah, the anaconda frontend is terrible.

tasket commented Sep 14, 2016

IIRC you should be able to choose btrfs for automatic partitioning as a sort-of workaround -- if erasing the disk is OK. That gives you btrfs on luks. You could even install this way onto a different disk, then reboot and 'btrfs device add' a prepared luks volume on the target disk and then delete the initial device; this will move the contents of the installed root fs to your target disk.

But, yeah, the anaconda frontend is terrible.

@rustybird

This comment has been minimized.

Show comment
Hide comment
@rustybird

rustybird Sep 15, 2016

@ttasket:

IIRC you should be able to choose btrfs for automatic partitioning as a sort-of workaround

Do you mean the menu where you could choose between several different automatic partitioning methods (LVM, btrfs, LVM+btrfs, ...)? At least R3.1-rc2 still had it, but I can't find anything of the sort for the R3.2 release candidates, am I overlooking something? I'm installing in BIOS mode, in case that makes any difference for Anaconda.

@ttasket:

IIRC you should be able to choose btrfs for automatic partitioning as a sort-of workaround

Do you mean the menu where you could choose between several different automatic partitioning methods (LVM, btrfs, LVM+btrfs, ...)? At least R3.1-rc2 still had it, but I can't find anything of the sort for the R3.2 release candidates, am I overlooking something? I'm installing in BIOS mode, in case that makes any difference for Anaconda.

@tasket

This comment has been minimized.

Show comment
Hide comment
@tasket

tasket Sep 15, 2016

@rustybird
Yes. Actually, using R3.2rc1 disc just now I was able to selectively delete old partitions (no disk wipe needed), then choose the partitioning type as 'btrfs'. Next I clicked the underlined 'link' above the partitioning type to automatically create mountpoints (I know that sounds backwards, and it looks that way too).

When I clicked 'Done' it showed a list of queued actions that included deleting old partitions, creating LUKS volumes, and formatting one of the LUKS volumes as btrfs. I didn't go ahead with the install, however.

tasket commented Sep 15, 2016

@rustybird
Yes. Actually, using R3.2rc1 disc just now I was able to selectively delete old partitions (no disk wipe needed), then choose the partitioning type as 'btrfs'. Next I clicked the underlined 'link' above the partitioning type to automatically create mountpoints (I know that sounds backwards, and it looks that way too).

When I clicked 'Done' it showed a list of queued actions that included deleting old partitions, creating LUKS volumes, and formatting one of the LUKS volumes as btrfs. I didn't go ahead with the install, however.

@rustybird

This comment has been minimized.

Show comment
Hide comment
@rustybird

rustybird Sep 15, 2016

@ttasket:

Hmm, I tried it with RC1 now and still can't find the right moves to get through Anaconda Island R3.2: The Curse of Anaconda Island. Maybe it depends on what partitions you had before installing, can you describe that?

For example, if I first start a default installation on an empty disk and reboot into the installer again when the automatic partitioning is done, and then (A) delete the LUKS container, or (B) unlock it and delete the root filesystem, the Click here to create them automatically link always errors out saying (for A) the root mountpoint is undefined, or (for B) there's not enough free space.

When trying to install to an empty disk, the error on Click here to create them automatically is also (A).

@ttasket:

Hmm, I tried it with RC1 now and still can't find the right moves to get through Anaconda Island R3.2: The Curse of Anaconda Island. Maybe it depends on what partitions you had before installing, can you describe that?

For example, if I first start a default installation on an empty disk and reboot into the installer again when the automatic partitioning is done, and then (A) delete the LUKS container, or (B) unlock it and delete the root filesystem, the Click here to create them automatically link always errors out saying (for A) the root mountpoint is undefined, or (for B) there's not enough free space.

When trying to install to an empty disk, the error on Click here to create them automatically is also (A).

@tasket

This comment has been minimized.

Show comment
Hide comment
@tasket

tasket Sep 15, 2016

@rustybird
I tried it again-- BTW this is with an external USB HD selected as the destination.

If I simply chose "I will configure partitioning" and then created space by deleting the partitions listed under the "Unknown" grouping, then select 'btrfs' in the dropdown box.... anaconda would say there was an error when I clicked "Click here to create them".

But if I left the partitioning on full automatic and checked the box to let me create free space, when I clicked Done a special popup box appeared for the purpose of flagging partitions as 'delete'. Once I finished with this, switching to "I will configure partitioning" worked... Select 'btrfs' from the dropdown box then click "Click here to create them" would complete without error and I could see the new partitions defined.

I have not tried unlocking LUKS containers in anaconda in a long time. My experience is that it will never figure out your intention or act on it correctly. Its best to let it create a new LUKS container.

tasket commented Sep 15, 2016

@rustybird
I tried it again-- BTW this is with an external USB HD selected as the destination.

If I simply chose "I will configure partitioning" and then created space by deleting the partitions listed under the "Unknown" grouping, then select 'btrfs' in the dropdown box.... anaconda would say there was an error when I clicked "Click here to create them".

But if I left the partitioning on full automatic and checked the box to let me create free space, when I clicked Done a special popup box appeared for the purpose of flagging partitions as 'delete'. Once I finished with this, switching to "I will configure partitioning" worked... Select 'btrfs' from the dropdown box then click "Click here to create them" would complete without error and I could see the new partitions defined.

I have not tried unlocking LUKS containers in anaconda in a long time. My experience is that it will never figure out your intention or act on it correctly. Its best to let it create a new LUKS container.

@rustybird

This comment has been minimized.

Show comment
Hide comment
@rustybird

rustybird Sep 15, 2016

Yes! Thanks so much for figuring that out and describing it! I would like to make additional space available - Done - Reclaim space is indeed the magic incantation, and can even be run on a totally empty drive. Somehow, that makes Click here to create them automatically work like it should.

rustybird commented Sep 15, 2016

Yes! Thanks so much for figuring that out and describing it! I would like to make additional space available - Done - Reclaim space is indeed the magic incantation, and can even be run on a totally empty drive. Somehow, that makes Click here to create them automatically work like it should.

@rustybird

This comment has been minimized.

Show comment
Hide comment
@rustybird

rustybird Feb 18, 2018

As of R4.0rc4, the foray into I would like to make additional space available is no longer needed.

As of R4.0rc4, the foray into I would like to make additional space available is no longer needed.

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Mar 6, 2018

Member

@rustybird does it mean the issue doesn't apply to R4.0-rc4?

Member

marmarek commented Mar 6, 2018

@rustybird does it mean the issue doesn't apply to R4.0-rc4?

@rustybird

This comment has been minimized.

Show comment
Hide comment
@rustybird

rustybird Mar 7, 2018

does it mean the issue doesn't apply to R4.0-rc4?

Manual partitioning still creates an unencrypted btrfs filesystem. But at least the only case in which it falsely claims to encrypt is if the user switches from LVM Thin to LVM to btrfs.

Automatic btrfs partitioning works fine though.

does it mean the issue doesn't apply to R4.0-rc4?

Manual partitioning still creates an unencrypted btrfs filesystem. But at least the only case in which it falsely claims to encrypt is if the user switches from LVM Thin to LVM to btrfs.

Automatic btrfs partitioning works fine though.

marmarek added a commit to marmarek/qubes-installer-qubes-os that referenced this issue Mar 27, 2018

anaconda: really set default paritioning layout
setDefaultPartitioning is called when executing kickstart "autopart"
command - which is the case if one choose to not change disk
partitioning. But in manual partitioning there is also an option to
start with automatic layout and in that case setDefaultPartitioning
isn't called at all. Which results in failed partitioning (missing '/'
and bootable partition).

Similar thing is already fixed in master commit
378cfc4.

QubesOS/qubes-issues#2294
Fixes QubesOS/qubes-issues#3334

@qubesos-bot qubesos-bot referenced this issue in QubesOS/updates-status Jul 14, 2018

Closed

installer-qubes-os v3.2-2-qubes-release (r3.2) #582

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment