canonical / canonical/encrypt-cloud-image

False detection of root partition.

Open
#11 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
11
Forks
17
PR merge metrics
No merged PRs in 30d

Description

In main.go we are discovering root partition by using filesystem guid, incase of migrating traditional server images which have efi boot root, the detection logic false detects boot as the root partition. Should we do something similar to https://www.freedesktop.org/software/systemd/man/systemd-gpt-auto-generator.html

///THis is doing false detection in main.go
root := partitions.FindByPartitionType(linuxFilesystemGUID)

@chrisccoulson could you please take a look at this ask, maybe we need to harden this check.
Scenario is we take a Ubuntu server image, remove grub and linux kernel and add the Ubuntu linux fde kernel package there, then run encryption tools on that image, it is detecting boot partition as root partition and encrypting that. I have moved detection logic to our service and pass uuid to the tools based on detection.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in main.go at the root partition lookup using partitions.FindByPartitionType(linuxFilesystemGUID), then compare the scenario with systemd-gpt-auto-generator’s partition-selection rules. Reproduce the Ubuntu server image case described in the issue and determine how boot is being selected as root. Done means the encryption tools receive the actual root partition rather than encrypting boot.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.