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

False detection of root partition. #11

Open
jaskaran-khurana opened this issue Feb 1, 2023 · 1 comment
Open

False detection of root partition. #11

jaskaran-khurana opened this issue Feb 1, 2023 · 1 comment

Comments

@jaskaran-khurana
Copy link
Contributor

jaskaran-khurana commented Feb 1, 2023

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.

@jaskaran-khurana
Copy link
Contributor Author

I have a disk with seperate root and var partition both get same partuuid, I installed ubuntu server from iso
root@ubuntu1804:/mnt/repos/myclone/encrypt-cloud-image# lsblk -n -J -o type,fstype,uuid,parttype /dev/nbd0p2
{
   "blockdevices": [
      {"type": "part", "fstype": "ext4", "uuid": "dd446044-2a18-4e42-9551-9f52b2f96fde", "parttype": "0fc63daf-8483-4772-8e79-3d69d8477de4"}
   ]
}
root@ubuntu1804:/mnt/repos/myclone/encrypt-cloud-image# lsblk -n -J -o type,fstype,uuid,parttype /dev/nbd0p3
{
   "blockdevices": [
      {"type": "part", "fstype": "ext4", "uuid": "ce6ce620-1841-40e3-b01c-7b0ba412e282", "parttype": "0fc63daf-8483-4772-8e79-3d69d8477de4"}
   ]
}

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

No branches or pull requests

1 participant