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

use cryptsetup to retrieve container uuid #2545 #2547

Conversation

phillxnet
Copy link
Member

Previously we used lsblk for this purpose, but sporadically lsblk would return an empty uuid for our just-created LUKS container. Thought to be due to it not having yet been updated re system state. Hence the use of the more specific LUKS command.

Fixes #2545

Include

  • New get_luks_container_uuid(disk_byid) in luks.py.
  • Fresh black formatting.
  • Minor comment improvements.
  • Leaving in-place the prior general procedure lsblk based mechanism as this may server elsewhere.

Previously we used lsblk for this purpose, but
sporadically lsblk would return an empty uuid for
our just-created LUKS container. Thought to be due
to it not having yet been updated re system state.
Hence the use of the more specific LUKS command.

## Include
- New get_luks_container_uuid(disk_byid) in luks.py.
- Fresh black formatting.
- Minor comment improvements.
- Leaving in-place the prior general procedure
lsblk based mechanism as this may server elsewhere.
@phillxnet
Copy link
Member Author

phillxnet commented May 2, 2023

Testing

Prior to this pr the issue detailed failure (no uuid in keyfile name) would appear sporadically but by far not the majority of the time. One attempt to reproduce took 4 consecutive tries before there was a failure. On the exact same test system (updated "Uses openSUSE Tumbleweed" Rockstor instance installed from our latest installer) post proposed patch no occurrence of the bug was observed over the creation and deletion of 4 LUKS containers in the following pattern:

  1. reboot
  2. make all 4 disks into LUKS containers.
  3. delete all 4 LUKS containers (locked still).
  4. repeat 2 & 3
  5. repeat steps 1. to 4. - 3 more times.

The above was done on both the reproducer Tumbleweed base as well as a Lea 15.4 base. No instance of the missing uuid was observed.

Resulting in the creation and deletion of 24 LUKS containers (interleaved reboots) on each of the base OS platforms. All within the Rockstor Web-UI to provide an end-to-end testing scenario.

@phillxnet phillxnet merged commit bdc3df2 into rockstor:testing May 3, 2023
@phillxnet phillxnet deleted the 2545_LUKS_auto_unlock_via_keyfile_missing_uuid branch May 3, 2023 16:54
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.

None yet

1 participant