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

🌱 Add LVM activation support for OEM and recovery partitions for ARM images #997

Closed
Tracked by #1454
venkatnsrinivasan opened this issue Mar 1, 2023 · 15 comments · Fixed by kairos-io/immucore#113
Assignees
Labels

Comments

@venkatnsrinivasan
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Currently ARM images have no OEM partition. As part of this pull request , support for LVM based partitions was add to the arm image builder tools - kairos-io/osbuilder#25 .
Presently LVM partitions for OEM and recovery are not activated at boot time to take effect. Need some enhancements to get these picked up.
Describe the solution you'd like
Activate LVM partitions on boot to mount OEM partitions. Also boot from LVM into recovery mode.

see #622

@venkatnsrinivasan venkatnsrinivasan added the enhancement New feature or request label Mar 1, 2023
@mudler mudler changed the title Add LVM activation support for OEM and recovery partitions for ARM images 🌱 Add LVM activation support for OEM and recovery partitions for ARM images Mar 2, 2023
@mudler mudler removed their assignment Mar 2, 2023
@jimmykarily jimmykarily moved this to Todo 🖊 in 🧙Issue tracking board Mar 6, 2023
@Itxaka
Copy link
Member

Itxaka commented Mar 8, 2023

@venkatnsrinivasan Is there any way I can easily test this? Do I need to generate raw images for rpi or something? Or is this possible in a normal install with an ISO?

@venkatnsrinivasan
Copy link
Collaborator Author

venkatnsrinivasan commented Mar 8, 2023

@Itxaka I only made changes to creating the raw rpi images script so for now you need to generate raw images using the build-arm-image.sh in osbuilder. I used UTM on mac /rpi to test. Another option could be to do manual install using an iso for amd64 and before rebooting convert the COS_OEM and COS_RECOVERY to LVM. I did that initially.

@mudler mudler added the ARM label Apr 3, 2023
@mudler mudler moved this from Todo 🖊 to In Progress 🏃 in 🧙Issue tracking board Apr 10, 2023
@mudler mudler moved this from In Progress 🏃 to Todo 🖊 in 🧙Issue tracking board Apr 10, 2023
@mudler
Copy link
Member

mudler commented Apr 11, 2023

we have some bits describing how to test LVM on amd64 here: https://github.com/kairos-io/infra-as-code

@mauromorales mauromorales self-assigned this Apr 11, 2023
@mauromorales mauromorales moved this from Todo 🖊 to In Progress 🏃 in 🧙Issue tracking board Apr 11, 2023
@mauromorales mauromorales removed their assignment Apr 11, 2023
@mauromorales mauromorales moved this from In Progress 🏃 to Todo 🖊 in 🧙Issue tracking board Apr 11, 2023
@mauromorales mauromorales self-assigned this Apr 12, 2023
@mauromorales mauromorales moved this from Todo 🖊 to In Progress 🏃 in 🧙Issue tracking board Apr 12, 2023
@mudler mudler mentioned this issue Apr 13, 2023
29 tasks
@mudler mudler moved this from In Progress 🏃 to Todo 🖊 in 🧙Issue tracking board Apr 17, 2023
@mauromorales mauromorales removed their assignment Apr 17, 2023
@Itxaka Itxaka self-assigned this Apr 18, 2023
@Itxaka Itxaka moved this from Todo 🖊 to In Progress 🏃 in 🧙Issue tracking board Apr 18, 2023
@Itxaka
Copy link
Member

Itxaka commented Apr 18, 2023

I been testing this with the following cloud-config extra steps:

stages:
  after-install:
    - name: "Set LVM"
      commands:
        - |
          umount /dev/vda5
          pvcreate /dev/vda5 -f
          pvcreate /dev/vdb
          vgcreate PersistentLVM /dev/vda5 /dev/vdb
          lvcreate -n Persistent -l 100%FREE PersistentLVM
          mkfs.ext4 -L COS_PERSISTENT /dev/mapper/PersistentLVM-Persistent

@Itxaka
Copy link
Member

Itxaka commented Apr 18, 2023

incredibly enough, this works out of the box due to dracut-initqueue mounting the lvm module and activating it by itself.

But in the case of COS_OEM, this does not trigger properly, probably a race condition between immucore trying to mount it and dracut enabling the module

[    6.762075] immucore[890]: <nil> ERR error="no such device" options=["rw","suid","dev","exec","async"] type= what=/dev/disk/by-label/COS_OEM where=/sysroot/oem

@Itxaka
Copy link
Member

Itxaka commented Apr 18, 2023

Seems like indeed, immucore should run lvm vgchange -ay at the start of the DAG so anything on LVM is activated and ready to be used

@Itxaka
Copy link
Member

Itxaka commented Apr 19, 2023

[   11.011233] immucore[863]: <nil> ERR work/pkg/mount/state.go:167 > error="no such device" options=["rw","suid","dev","exec","async"] type= what=/dev/disk/by-label/COS_OEM where=/sysroot/oem

Looks like the DiskFSType which checks the disk type is being run before COS_OEM is available, so it cannot infer the type properly?

@mauromorales
Copy link
Member

I saw this error when trying to boot the Ubuntu RPi

@Itxaka
Copy link
Member

Itxaka commented Apr 19, 2023

I saw this error when trying to boot the Ubuntu RPi

yep! Looks like the function is being run at the start of immucore. That works nice for existing fs, but for anything that gets mounted or appears later, it doesnt work. Just added a just-in-time check for fs when trying to mount to fix this, in case things change between start and the mount command which should fix this.

@Itxaka
Copy link
Member

Itxaka commented Apr 19, 2023

to test with OEM partition:

stages:
  initramfs:
    - name: "Set hostname"
      hostname: kairos-LVM
  after-install:
    - name: "Set LVM"
      commands:
        - |
          umount /dev/vda2 || true
          pvcreate /dev/vda2 -f
          pvcreate /dev/vdb
          vgcreate OemLVM /dev/vda2 /dev/vdb
          lvcreate -n Oem -l 100%FREE OemLVM
          mkfs.ext4 -L COS_OEM /dev/mapper/OemLVM-Oem

@Itxaka Itxaka moved this from In Progress 🏃 to Under review 🔍 in 🧙Issue tracking board Apr 19, 2023
@Itxaka
Copy link
Member

Itxaka commented Apr 19, 2023

Im wondering if upgrade will even work. As long as we are just using the labels it should but...meh it migth not.

@github-project-automation github-project-automation bot moved this from Under review 🔍 to Done ✅ in 🧙Issue tracking board Apr 19, 2023
@Itxaka
Copy link
Member

Itxaka commented Apr 20, 2023

Im wondering if upgrade will even work. As long as we are just using the labels it should but...meh it migth not.

seems liek it does as we dont touch the oem partition :D

@Itxaka Itxaka reopened this Apr 20, 2023
@github-project-automation github-project-automation bot moved this from Done ✅ to Under review 🔍 in 🧙Issue tracking board Apr 20, 2023
@Itxaka
Copy link
Member

Itxaka commented Apr 20, 2023

Missing package updates for immucore in kairos :D

@Itxaka
Copy link
Member

Itxaka commented Apr 21, 2023

blocked by #1330

@Itxaka
Copy link
Member

Itxaka commented Apr 21, 2023

Lvm support is in

@Itxaka Itxaka closed this as completed Apr 21, 2023
@github-project-automation github-project-automation bot moved this from Under review 🔍 to Done ✅ in 🧙Issue tracking board Apr 21, 2023
@mudler mudler mentioned this issue May 26, 2023
29 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants